base
Chain-agnostic logics for the Oracle contract.
Links
- Contract repo: https://github.com/mars-protocol/outposts/tree/master/contracts/oracle/base
- Audits: https://github.com/mars-protocol/mars-audits/tree/main/red-bank
InstantiateMsg
Params | Type | Description |
---|---|---|
owner | String | The contract's owner, who can update config and price sources |
base_denom | String | The asset in which prices are denominated in |
ExecuteMsg
set_price_source
Specifies the price source to be used for a coin.
The input parameters for method are chain-specific.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
price_source | T | Coin's price source. See OsmosisPriceSource for an example of a chain specific integration. |
remove_price_source
Removes price source for a coin.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
update_owner
Manages admin role state.
QueryMsg
config
Queries contract config.
Returns a Config<String>
response.
price_source
Queries a coin's price source.
The response type of this query is chain-specific.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
PriceSourceResponse<String>
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
price_source | T | Coin's price source. See OsmosisPriceSource for an example of a chain specific integration. |
price_sources
Enumerates all coins' price sources.
The response type of this query is chain-specific.
Params | Type | Description |
---|---|---|
start_after | Option<String> | Denom to start after. |
limit | Option<u32> | Amount of price sources to list. |
Returns a vector that contains objects of type PriceSourceResponse<String>
.
price
Queries a coin's price.
This query may be dependent on block time (e.g. if the price source is TWAP), so may not work properly with time travel queries on archive nodes.
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
PriceResponse
Params | Type | Description |
---|---|---|
denom | String | Denom of the asset |
price | Decimal | Price of the asset |
prices
Enumerates all coins' prices.
This query may be dependent on block time (e.g. if the price source is TWAP), so may not work properly with time travel queries on archive nodes.
Params | Type | Description |
---|---|---|
start_after | Option<String> | Price to start after. |
limit | Option<u32> | Amount of prices to list. |
Returns a vector that contains objects of type PriceResponse
.