fn internal_get_return(
        &self,
        token_in: usize,
        amount_in: Balance,
        token_out: usize,
        fees: &AdminFees,
    ) -> SwapResult {
        // make amounts into comparable-amounts
        let c_amount_in = self.amount_to_c_amount(amount_in, token_in);

        self.get_invariant()
            .swap_to(
                token_in,
                c_amount_in,
                token_out,
                &self.c_amounts,
                &Fees::new(self.total_fee, &fees),
            )
            .expect(ERR70_SWAP_OUT_CALC_ERR)

    }
/// Returns number of tokens in outcome, given amount.
/// Tokens are provided as indexes into token list for given pool.
/// All tokens are comparable tokens
Returns number of tokens in outcome, given amount.
Tokens are provided as indexes into token list for given pool.
All tokens are comparable tokens
Returns number of tokens in outcome given amount . Tokens are provided as indexes into token list for given pool . All tokens are comparable tokens
fn internal_get_return(
        &self,
        token_in: usize,
        amount_in: Balance,
        token_out: usize,
        fees: &AdminFees,
    ) -> SwapResult {
        // make amounts into comparable-amounts
        let c_amount_in = self.amount_to_c_amount(amount_in, token_in);
        self.get_invariant()
            .swap_to(
                token_in,
                c_amount_in,
                token_out,
                &self.c_amounts,
                &Fees::new(self.total_fee, &fees),
            )
            .expect(ERR70_SWAP_OUT_CALC_ERR)
    }
fn internal_get_return ( & self , token_in : usize , amount_in : Balance , token_out : usize , fees : & AdminFees , ) -> SwapResult { // make amounts into comparable-amounts let c_amount_in = self . amount_to_c_amount ( amount_in , token_in ) ; self . get_invariant ( ) . swap_to ( token_in , c_amount_in , token_out , & self . c_amounts , & Fees :: new ( self . total_fee , & fees ) , ) . expect ( ERR70_SWAP_OUT_CALC_ERR ) }
Returns number of tokens in outcome, given amount.
Returns number of tokens in outcome given amount .
&self
token_in
usize
amount_in
Balance
token_out
usize
fees
&AdminFees
&self
token_in
usize
amount_in
Balance
token_out
usize
fees
&AdminFees