pub fn calculate_shares(
    asset_reserve: u128,
    asset_amount: u128,
    share_issuance: u128
) -> Option<u128>
Expand description

Calculating amount of shares given to LP for added liquidity shares = issuance * amount / reserve

  • asset_reserve - asset reserve
  • asset_b_reserve - amount added by LP
  • share_issuance - total issuance of share asset