Trait hydradx_traits::pools::SpotPriceProvider
source · pub trait SpotPriceProvider<AssetId> {
type Price;
fn pair_exists(asset_a: AssetId, asset_b: AssetId) -> bool;
fn spot_price(asset_a: AssetId, asset_b: AssetId) -> Option<Self::Price>;
}
Required Associated Types§
Required Methods§
fn pair_exists(asset_a: AssetId, asset_b: AssetId) -> bool
sourcefn spot_price(asset_a: AssetId, asset_b: AssetId) -> Option<Self::Price>
fn spot_price(asset_a: AssetId, asset_b: AssetId) -> Option<Self::Price>
Return spot price for given asset pair
Returns None if such pair does not exist