Incentivizing an IAM
Offering incentives on Vault IAMs
An IP may incentivize Vault IAMs by:
Add the address (or points campaign) you wish to distribute by calling
` function addRewardsToken(address rewardsToken)`
Start a rewards interval by calling the function
`setRewardsInterval(address reward, uint256 start, uint256 end, uint256 totalRewards, address frontendFeeRecipient).
address reward: current address of rewards
uint256 start: campaign start timestamp
uint256 end: campaign end timestamps
uint256 totalRewards: the total amount of rewards you wish to distribute
address frontendFeeRecipient: the address of the frontend which should receive the frontend fee.
Repeat for up to 20 different rewards tokens / points campaigns
Call
`allocateOffer`
on the vaultHub to select offers which are now in-range to pull them into your vault
An IP may extend or increase rewards on an existing campaign by calling: `extendRewardsInterval(address reward, uint256 rewardsAdded, uint256 newEnd, address frontendFeeRecipient)`
. 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 offers by increasing rates until the offers are satisfied and can be allocated into the underlying Vaults.
Multiple IPs may offer incentives on the same underlying ERC-4626 Vault if the IAM creator sets ’address reward’
to e.g. a 1-of-3 multi-signature wallet. Or they may choose to deploy a new IAM on the same underlying ERC-4626 Vault. However, in the latter case, the AP will not receive incentives from other IAMs.
Offering incentives on Recipe IAMs
Recipe IAMs pay an AP a static amount of rewards, instead of streaming those rewards to all depositors. IPs can offer to pay a certain amount of incentive by placing IPOffers using
```function createIPOffer(uint256 targetMarketID, uint256 quantity, uint256 expiry, address[] memory tokensOffered, uint256[] memory tokenAmounts) ```
`targetMarketID`
the ID of the market you wish to incentivize. IDs are 0-indexed sequentially as markets are created and returned by the createMarket function. Market details can be recovered by passing an ID to the marketIDToWeirollMarket mapping.`quantity`
the total amount of input token desired.`expiry`
the time the offer will expire, after which deposits will not be rewarded.`incentivesOffered`
the list of addresses of tokens (or points campaigns) you wish to give in exchange for filling the offer.`incentiveAmountsPaid`
is the amount of incentives the IP wishes to pay (including fees).
IPs can fill specific conditional AP offers by offering their requested amount of incentives and atomically distributing incentives with the AP’s programmatic execution of the offer.
Filling an AP offer can be done by calling the function ```fillAPOffer(APOffer calldata offer, uint256 fillAmount, address frontendFeeRecipient)```
. Because APOffers are emitted as onchain events rather than stored in contract storage, the params of the APOffer must be passed into the function call in the `offer`
parameter, `fillAmount`
specifies the amount of depositAsset to take from the AP, and `frontendFeeRecipient`
specifies the frontend which facilitated the fill.
Last updated