Skip to main content
logo

osmosis

The Osmosis Oracle contract inherits logics from the base Oracle contract, with the Osmosis query and price source plugins. The contract provides prices denominated in uosmo for assets used in the protocol.

ExecuteMsg

OsmosisPriceSource

Osmosis PriceSource response type.

price_source.rs
Copy

_23
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
_23
#[serde(rename_all = "snake_case")]
_23
pub enum OsmosisPriceSource {
_23
Fixed {
_23
price: Decimal,
_23
},
_23
Spot {
_23
pool_id: u64,
_23
},
_23
ArithmeticTwap {
_23
pool_id: u64,
_23
window_size: u64,
_23
downtime_detector: Option<DowntimeDetector>,
_23
},
_23
GeometricTwap {
_23
pool_id: u64,
_23
window_size: u64,
_23
downtime_detector: Option<DowntimeDetector>,
_23
},
_23
XykLiquidityToken {
_23
pool_id: u64,
_23
},
_23
}

NOTE

For Spot and Twap variants, pool_id must point to an Osmosis pool consists of the asset of interest and OSMO.

VariantsDescription
FixedReturns a fixed value
SpotOsmosis spot price quoted in OSMO
ArithmeticTwapOsmosis arithmetic twap price quoted in OSMO
GeometricTwapOsmosis geometric twap price quoted in OSMO
XykLiquidityTokenOsmosis LP token (of an XYK pool) price quoted in OSMO