Incentivizing an IAM

Incentivizing Vault Markets

  1. Add the token or points campaign you wish to distribute by calling ` function addRewardsToken(address rewardsToken)` with the address of the token/campaign

  2. Start a rewards interval by calling the function `setRewardsInterval(address reward, uint256 start, uint256 end, uint256 totalRewards, address frontendFeeRecipient)` with the address of your reward, campaign start and end timestamps, the total amount of rewards you wish to distribute, and the address of the frontend which should receive the frontend fee

  3. Repeat for up to 20 different rewards tokens / points campaigns

  4. Call `allocateOrder` on the vaultOrderbook to select orders which are now in-range to pull them into your vault

Extend or increase rewards on an existing campaign by calling `extendRewardsInterval(address reward, uint256 rewardsAdded, uint256 newEnd, address frontendFeeRecipient)`, but note that adding rewardsAdded, and extending the campaign until newEnd, must not result in a lower rate than the current rate. This allows IPs to take action on orders they see on the Royco Vault Orderbook by increasing rates until the orders are satisfied and can be allocated into the vault.

Incentivizing Recipe Markets

Unlike vault markets, incentivizing a recipe market only requires an IP to interact with the Royco Recipe Orderbook. Recipe markets actually pay an AP a static amount of rewards instead of streaming those rewards among all depositors in a pool so recipe markets behave more like a traditional orderbook. IPs can offer to pay a certain amount of incentive by placing IPOrders using

```function createIPOrder(uint256 targetMarketID, uint256 quantity, uint256 expiry, address[] memory tokensOffered, uint256[] memory tokenAmounts) ```

  • `targetMarketID` should be the ID of the market you wish to incentivize. IDs are 0-indexed given sequentially as markets are created, and and are returned by the createMarket function. Market details can be recovered by passing an ID to the marketIDToWeirollMarket mapping

  • `quantity` is the total amount of input token you’d like to take in

  • `expiry` is the time you’d like the order to expire, and prevent any additional deposits

  • `tokensOffered` is the list of addresses of tokens (or points campaigns) you wish to give in exchange for filling the order

  • `tokenAmounts` is the list of amounts of each incentive asset you wish to give in exchange for filling the order (array positions must correspond with the previous array)

In addition to placing your own orders, IPs can fill specific AP orders, giving APs their requested amount of incentives, and instantly have them execute an action. This is useful to capture juicy APs who want just a little bit more of a reward than an IPs own limit order, and for bootstrapping markets without ever creating an IP order, instead relying on APs to determine efficient incentive spend for them. Filling an AP order can be done by calling the function ```fillAPOrder(APOrder calldata order, uint256 fillAmount, address frontendFeeRecipient)```. Because APOrders are emitted as events rather than stored in contract storage, the params of the APOrder must be passed into the function call in the `order` parameter, `fillAmount` specifies the amount of depositAsset to take from the AP, and `frontendFeeRecipient` specifies the frontend which facilitated the fill.

Last updated