Function calculateAmmReservesAfterSwap
- calculateAmmReservesAfterSwap(amm: Pick<AMM, "pegMultiplier" | "quoteAssetReserve" | "sqrtK" | "baseAssetReserve">, inputAssetType: AssetType, swapAmount: BN, swapDirection: SwapDirection): [BN, BN]
-
Parameters
-
amm: Pick<AMM, "pegMultiplier" | "quoteAssetReserve" | "sqrtK" | "baseAssetReserve">
-
-
swapAmount: BN
-
Returns [BN, BN]
Calculates what the amm reserves would be after swapping a quote or base asset amount.
Returns
quoteAssetReserve and baseAssetReserve after swap. : Precision AMM_RESERVE_PRECISION