Trait common::GetMarketInfo
source · pub trait GetMarketInfo<AssetId> {
// Required methods
fn buy_price(
base_asset: &AssetId,
target_asset: &AssetId
) -> Result<Fixed, DispatchError>;
fn sell_price(
base_asset: &AssetId,
target_asset: &AssetId
) -> Result<Fixed, DispatchError>;
fn enabled_target_assets() -> BTreeSet<AssetId>;
}
Expand description
Trait for bounding liquidity proxy associated type representing primary market in TBC.
Required Methods§
sourcefn buy_price(
base_asset: &AssetId,
target_asset: &AssetId
) -> Result<Fixed, DispatchError>
fn buy_price( base_asset: &AssetId, target_asset: &AssetId ) -> Result<Fixed, DispatchError>
The price in terms of the target_asset
at which one can buy
a unit of the base_asset
on the primary market (e.g. from the bonding curve pool or xst).
sourcefn sell_price(
base_asset: &AssetId,
target_asset: &AssetId
) -> Result<Fixed, DispatchError>
fn sell_price( base_asset: &AssetId, target_asset: &AssetId ) -> Result<Fixed, DispatchError>
The price in terms of the target_asset
at which one can sell
a unit of the base_asset
on the primary market (e.g. to the bonding curve pool or xst).
sourcefn enabled_target_assets() -> BTreeSet<AssetId>
fn enabled_target_assets() -> BTreeSet<AssetId>
Returns set of enabled collateral/synthetic/reserve assets on bonding curve.