The same as swapInvariantIterations but for adding liquidity.
Keeps the amount of iteration used to calculate invariant in the last call to getSwapGrossAmountReceived or getSwapAmountDeposited. Needed to calculate transaction fee.
Price is calculated by simulating a swap for 10**6 of micro values. This price is highly inaccurate for low liquidity pools. In case of ConvergenceError we try to simulate a swap using a different swap amount. Returns NaN if all retries will fail.
Returns amount of liquidity tokens that are going to be minted when adding liquidity.
May return NaN for highly unbalanced pools.
Converts amountDeposited to amountReceived. Ignores fee calculations.
Generated using TypeDoc
An implementation of a math behind stableswap pools.