incentives
Manage MARS incentives for depositors.
Links
- Contract address:
osmo1nkahswfr8shg8rlxqwup0vgahp0dk4x8w6tkv3rra8rratnut36sk22vrm
- Testnet address:
osmo1zxs8fry3m8j94pqg7h4muunyx86en27cl0xgk76fc839xg2qnn6qtpjs48
- Contract repo: https://github.com/mars-protocol/outposts/tree/master/contracts/incentives
- Audits: https://github.com/mars-protocol/mars-audits/tree/main/red-bank
InstantiateMsg
Instantiates the Incentives contract.
Params | Type | Description |
---|---|---|
owner | String | Contract owner |
address_provider | String | Address provider |
mars_denom | String | Mars token denom |
ExecuteMsg
set_asset_incentive
Set emission per second for an asset to its depositor at Red Bank.
Params | Type | Description |
---|---|---|
denom | String | Asset denom associated with the incentives |
emission_per_second | Option<Uint128> | How many MARS will be assigned per second to be distributed among all Red Bank depositors |
start_time | Option<u64> | Start time of the incentive (in seconds) since the UNIX epoch (00:00:00 on 1970-01-01 UTC) |
duration | Option<u64> | How many seconds the incentives last |
balance_change
Handle balance change updating user and asset rewards. Sent from an external contract, triggered on user balance changes. Will return an empty response if no incentive is applied for the asset
Params | Type | Description |
---|---|---|
user_addr | Addr | User address. Address is trusted as it must be validated by the Red Bank contract before calling this method |
denom | String | Denom of the asset of which deposited balance is changed |
user_amount_scaled_before | Uint128 | The user's scaled collateral amount up to the instant before the change |
total_amount_scaled_before | Uint128 | The market's total scaled collateral amount up to the instant before the change |
claim_rewards
Claim rewards. MARS rewards accrued by the user will be staked before being sent.
update_config
Update contract config (only callable by owner).
Params | Type | Description |
---|---|---|
address_provider | Option<String> | Address provider |
mars_denom | Option<String> | Mars token denom |
update_owner
Manages admin role state.
QueryMsg
config
Get contract config.
ConfigResponse
Params | Type | Description |
---|---|---|
owner | Option<String> | Contract owner |
proposed_new_owner | Option<String> | The contract's proposed owner |
address_provider | Addr | Address provider |
mars_denom | String | Mars Token Denom |
asset_incentive
Get info about asset incentive for a given denom.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
AssetIncentiveResponse
Params | Type | Description |
---|---|---|
denom | String | Asset denom |
emission_per_second | Uint128 | How much MARS per second is emitted to be then distributed to all Red Bank depositors |
start_time | u64 | Start time of the incentive (in seconds) since the UNIX epoch (00:00:00 on 1970-01-01 UTC) |
duration | u64 | How many seconds the incentives last |
index | u64 | Total MARS assigned for distribution since the start of the incentive |
last_updated | u64 | Last time (in seconds) index was updated |
asset_incentives
Enumerate asset incentives with pagination
Params | Type | Description |
---|---|---|
start_after | String | Denom of asset to start after |
limit | String | Number of asset incentives to list |
asset_incentives
returns a vector of the AssetIncentiveResponse
response struct defined above.
user_unclaimed_rewards
Get user current unclaimed rewards.
Params | Type | Description |
---|---|---|
user | String | User address |
Returns Uint128