Function calculateAmmReservesAfterSwap

  • 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

    Parameters

    • amm: Pick<AMM, "pegMultiplier" | "quoteAssetReserve" | "sqrtK" | "baseAssetReserve">
    • inputAssetType: AssetType
    • swapAmount: BN
    • swapDirection: SwapDirection

    Returns [BN, BN]

Generated using TypeDoc