Function calculateSwapOutput

  • Helper function calculating constant product curve output. Agnostic to whether input asset is quote or base

    Returns

    newInputAssetReserve and newOutputAssetReserve after swap. : Precision AMM_RESERVE_PRECISION

    Parameters

    • inputAssetReserve: BN
    • swapAmount: BN
    • swapDirection: SwapDirection
    • invariant: BN

    Returns [BN, BN]

Generated using TypeDoc