Skip to main content

Price Oracle

Prices can be queried with GetPrice{ .. }, GetPrices{ .. }, and GetAllPrices{ .. }. Neptune's price feeds are powered by PYTH and Injective chain data.

Query Messages

GetPrice { .. }
RUST
pub enum QueryMsg {
    /// Returns the price of a single asset
    #[returns(PriceInfo)]
    GetPrice { asset: AssetInfo },
}

GetPrices { .. }
RUST
pub enum QueryMsg {
    /// Returns the price of multiple assets
    #[returns(neptune_common::asset::AssetMap<PriceInfo> )]
    GetPrices { assets: Vec<AssetInfo> },
}

GetAllPrices { .. }
RUST
pub enum QueryMsg {
    /// Returns the price of all assets
    #[returns(neptune_common::asset::AssetMap<PriceInfo> )]
    GetAllPrices { start_after: Option<AssetInfo>, limit: Option<u32> },
}

Price Oracle Query Response

PriceInfo is defined below in this Common Data Type.

PriceInfo
RUST
pub struct PriceInfo {
    pub price: Decimal256,
    pub decimals: u8,
    pub time_last_updated: Timestamp,
    pub confidence: Decimal256,
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.