base
Chain-agnostic logics for the rewards collector contract.
Links
- Contract repo: https://github.com/mars-protocol/outposts/tree/master/contracts/rewards-collector/base
- Audits: https://github.com/mars-protocol/mars-audits/tree/main/red-bank
InstantiateMsg
Params | Type | Description |
---|---|---|
owner | T | The contract's owner |
address_provider | T | Address provider returns addresses for all protocol contracts |
safety_tax_rate | Decimal | Percentage of fees that are sent to the safety fund |
safety_fund_denom | String | The asset to which the safety fund share is converted |
fee_collector_denom | String | The asset to which the fee collector share is converted |
channel_id | String | The channel ID of the mars hub |
timeout_seconds | u64 | Number of seconds after which an IBC transfer is to be considered failed, if no acknowledgement is received |
slippage_tolerance | Decimal | Maximum percentage of price movement (minimum amount you accept to receive during swap) |
ExecuteMsg
update_owner
Manages admin role state.
update_config
Updates contract config.
Params | Type | Description |
---|---|---|
new_cfg | CreateOrUpdateConfig | New config parameters |
CreateOrUpdateConfig
Params | Type | Description |
---|---|---|
address_provider | Option<String> | Address provider returns addresses for all protocol contracts |
safety_tax_rate | Option<Decimal> | Percentage of fees that are sent to the safety fund |
safety_fund_denom | Option<String> | The asset to which the safety fund share is converted |
fee_collector_denom | Option<String> | The asset to which the fee collector share is converted |
channel_id | Option<String> | The channel id of the Mars Hub |
timeout_seconds | Option<u64> | Number of seconds after which an IBC transfer is to be considered failed, if no acknowledgement is received |
slippage_tolerance | Option<Decimal> | Maximum percentage of price movement (minimum amount you accept to receive during swap) |
set_route
Configure the route for swapping an asset. This is chain-specific, and can include parameters such as slippage tolerance and the routes for multi-step swaps.
Params | Type | Description |
---|---|---|
denom_in | Option<String> | Denom of the asset going in |
denom_out | Option<String> | Denom of the asset going out |
route | Route | Route for swapping an assets. See OsmosisRoute for an example of a chain specific integration. |
withdraw_from_red_bank
Withdraw maTokens from the Red Bank.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
amount | Option<Uint128> | Amount to withdraw |
distribute_rewards
Distribute the accrued protocol income between the safety fund and the fee modules on Mars Hub, according to the split set in config. Callable by any address.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
amount | Option<Uint128> | Amount of rewards to distribute |
swap_asset
Swap any asset on the contract.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
amount | Option<Uint128> | Amount of assets to swap |
QueryMsg
config
Queries config parameters.
route
Get routes for swapping an input denom into an output denom.
NOTE
The response type of this query is chain-specific.
Params | Type | Description |
---|---|---|
denom_in | String | Denom of the asset going in |
denom_out | String | Denom of the asset going out |
routes
Enumerate all swap routes.
NOTE
The response type of this query is chain-specific.
Params | Type | Description |
---|---|---|
start_after | Option<(String, String)> | Denom of the asset going in |
limit | Option<u32> | Denom of the asset going out |