pub fn swap(
        &mut self,
        token_in: &AccountId,
        amount_in: Balance,
        token_out: &AccountId,
        min_amount_out: Balance,
        admin_fee: AdminFees,
    ) -> Balance {
        match self {
            Pool::SimplePool(pool) => {
                pool.swap(token_in, amount_in, token_out, min_amount_out, &admin_fee)
            }
            Pool::StableSwapPool(pool) => {
                pool.swap(token_in, amount_in, token_out, min_amount_out, &admin_fee)
            }
        }
    }
/// Swaps given number of token_in for token_out and returns received amount.
Swaps given number of token_in for token_out and returns received amount.
Swaps given number of token_in for token_out and returns received amount .
pub fn swap(
        &mut self,
        token_in: &AccountId,
        amount_in: Balance,
        token_out: &AccountId,
        min_amount_out: Balance,
        admin_fee: AdminFees,
    ) -> Balance {
        match self {
            Pool::SimplePool(pool) => {
                pool.swap(token_in, amount_in, token_out, min_amount_out, &admin_fee)
            }
            Pool::StableSwapPool(pool) => {
                pool.swap(token_in, amount_in, token_out, min_amount_out, &admin_fee)
            }
        }
    }
pub fn swap ( & mut self , token_in : & AccountId , amount_in : Balance , token_out : & AccountId , min_amount_out : Balance , admin_fee : AdminFees , ) -> Balance { match self { Pool :: SimplePool ( pool ) => { pool . swap ( token_in , amount_in , token_out , min_amount_out , & admin_fee ) } Pool :: StableSwapPool ( pool ) => { pool . swap ( token_in , amount_in , token_out , min_amount_out , & admin_fee ) } } }
Swaps given number of token_in for token_out and returns received amount.
Swaps given number of token_in for token_out and returns received amount .
&mut self
token_in
&AccountId
amount_in
Balance
token_out
&AccountId
min_amount_out
Balance
admin_fee
AdminFees
&mut self
token_in
&AccountId
amount_in
Balance
token_out
&AccountId
min_amount_out
Balance
admin_fee
AdminFees