Oracle
Contract that holds price fetching information for assets
Last updated
Contract that holds price fetching information for assets
Last updated
This contract queries Osmosis TWAP and Pyth network for prices. It has two paths for getting prices, either Pyth-only or Osmosis TWAP + Pyth's OSMO/USD. The latter option uses OSMO denominated TWAP prices that are then used later to produce USD(-par) prices && is necessary for bridged/wrapped tokens so the protocol can accurately price risk between variants (ex: Axelar USDC vs Wormhole USDC vs Noble native USDC). The Pyth OSMO/USD price is prioritized, if unavailable it medianizes the USD-par TWAP prices from Osmosis to denominate prices in. This means CDT, the Positions contract's debt token, flips betweem USD and USD-par (USDC initially) pegs depending on USD's price availability.
Notes:
When the final quote price of the pools_for_osmo_twap
isn't uosmo
, the oracle will attempt to use its own pricing info to convert said price into USD. Ex: milkTIA's quote in TIA will query the oracle for TIA's price to end with a USD price
Key | Type | Description |
---|---|---|
* = optional
UpdateConfig
Updates contract configuration
* = optional
AddAsset
Add Asset oracle information to the contract
EditAsset
Replace existing asset oracle info
* = optional
Config
Returns contract configuration
Price
Returns list of asset prices and average price
* = optional
Prices
Returns list of PriceResponse for list of assets
Assets
Returns list of oracle info for a list of assets
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
*owner
String
Contract owner, defaults to info.sender
*positions_contract
String
Positions contract address
*osmosis_proxy_contract
String
Osmosis Proxy contract
*oracle_contract
String
Oracle contract
*owner
String
Contract owner
*positions_contract
String
Position's contract address
*osmosis_proxy_contract
String
Osmosis Proxy contract
*osmo_usd_pyth_feed_id
PriceIdentifier
OSMO/USD Pyth price feed id
*pyth_osmosis_address
String
Pyth Network's oracle contract address
*pools_for_usd_par_twap
TWAPPoolInfo
Osmosis pools for OSMO/USD-par TWAP
asset_info
AssetInfo
Asset info
oracle_info
AssetOracleInfo
Oracle info for added asset
asset_info
AssetInfo
Asset info
*oracle_info
AssetOracleInfo
Asset oracle info
remove
bool
Toggle to remove asset
asset_info
AssetInfo
Asset info
twap_timeframe
u64
TWAP timeframe (in days) for TWAP prices
oracle_time_limit
u64
Pyth Oracle time limit in seconds
*basket_id
Uint128
Basket_id to select oracle quote asset for CDT
asset_info
Vec<AssetInfo>
Asset infos
twap_timeframe
u64
TWAP timeframe (in days) for TWAP prices
oracle_time_limit
u64
Pyth Oracle time limit in seconds
asset_infos
Vec<AssetInfo>
List of Asset Info