fn admin_fee_to_liquidity(
        &mut self,
        sender_id: &AccountId,
        token_id: usize,
        c_amount: Balance,
    ) -> Balance {
        let invariant = self.get_invariant();

        let mut c_amounts = vec![0_u128; self.c_amounts.len()];
        c_amounts[token_id] = c_amount;

        let (new_shares, _) = invariant
            .compute_lp_amount_for_deposit(
                &c_amounts,
                &self.c_amounts,
                self.shares_total_supply,
                &Fees::zero(),
            )
            .expect(ERR67_LPSHARE_CALC_ERR);
        self.c_amounts[token_id] += c_amount;

        self.mint_shares(sender_id, new_shares);
        new_shares
    }
/// convert admin_fee into shares without any fee.
/// return share minted this time for the admin/referrer.
convert admin_fee into shares without any fee.
return share minted this time for the admin/referrer.
convert admin_fee into shares without any fee . return share minted this time for the admin / referrer .
fn admin_fee_to_liquidity(
        &mut self,
        sender_id: &AccountId,
        token_id: usize,
        c_amount: Balance,
    ) -> Balance {
        let invariant = self.get_invariant();
        let mut c_amounts = vec![0_u128; self.c_amounts.len()];
        c_amounts[token_id] = c_amount;
        let (new_shares, _) = invariant
            .compute_lp_amount_for_deposit(
                &c_amounts,
                &self.c_amounts,
                self.shares_total_supply,
                &Fees::zero(),
            )
            .expect(ERR67_LPSHARE_CALC_ERR);
        self.c_amounts[token_id] += c_amount;
        self.mint_shares(sender_id, new_shares);
        new_shares
    }
fn admin_fee_to_liquidity ( & mut self , sender_id : & AccountId , token_id : usize , c_amount : Balance , ) -> Balance { let invariant = self . get_invariant ( ) ; let mut c_amounts = vec ! [ 0_u128 self c_amounts len ( ) ] ; c_amounts [ token_id ] = c_amount ; let ( new_shares , _ ) = invariant . compute_lp_amount_for_deposit ( & c_amounts , & self . c_amounts , self . shares_total_supply , & Fees :: zero ( ) , ) . expect ( ERR67_LPSHARE_CALC_ERR ) ; self . c_amounts [ token_id ] += c_amount ; self . mint_shares ( sender_id , new_shares ) ; new_shares }
convert admin_fee into shares without any fee.
convert admin_fee into shares without any fee .
&mut self
sender_id
&AccountId
token_id
usize
c_amount
Balance
&mut self
sender_id
&AccountId
token_id
usize
c_amount
Balance