pub trait TradeExecution<Origin, AccountId, AssetId, Balance> {
    type Error;

    fn calculate_sell(
        pool_type: PoolType<AssetId>,
        asset_in: AssetId,
        asset_out: AssetId,
        amount_in: Balance
    ) -> Result<Balance, ExecutorError<Self::Error>>; fn calculate_buy(
        pool_type: PoolType<AssetId>,
        asset_in: AssetId,
        asset_out: AssetId,
        amount_out: Balance
    ) -> Result<Balance, ExecutorError<Self::Error>>; fn execute_sell(
        who: Origin,
        pool_type: PoolType<AssetId>,
        asset_in: AssetId,
        asset_out: AssetId,
        amount_in: Balance,
        min_limit: Balance
    ) -> Result<(), ExecutorError<Self::Error>>; fn execute_buy(
        who: Origin,
        pool_type: PoolType<AssetId>,
        asset_in: AssetId,
        asset_out: AssetId,
        amount_out: Balance,
        max_limit: Balance
    ) -> Result<(), ExecutorError<Self::Error>>; }

Required Associated Types§

Required Methods§

Implementations on Foreign Types§

Implementors§