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§

source

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).

source

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).

source

fn enabled_target_assets() -> BTreeSet<AssetId>

Returns set of enabled collateral/synthetic/reserve assets on bonding curve.

Implementations on Foreign Types§

source§

impl<AssetId: Ord> GetMarketInfo<AssetId> for ()

source§

fn buy_price( _base_asset: &AssetId, _collateral_asset: &AssetId ) -> Result<Fixed, DispatchError>

source§

fn sell_price( _base_asset: &AssetId, _collateral_asset: &AssetId ) -> Result<Fixed, DispatchError>

source§

fn enabled_target_assets() -> BTreeSet<AssetId>

Implementors§