Options
All
  • Public
  • Public/Protected
  • All
Menu

@pontem/liquidswap-sdk

Index

References

Renames and re-exports SDK

Type aliases

CalculateRatesParams: { additionalFee?: number; amount: Decimal | number; curveType: CurveType; fromToken: AptosResourceType; interactiveToken: "from" | "to"; toToken: AptosResourceType; version?: typeof VERSION_0 | typeof VERSION_0_5 }

Type declaration

  • Optional additionalFee?: number
  • amount: Decimal | number
  • curveType: CurveType
  • fromToken: AptosResourceType
  • interactiveToken: "from" | "to"
  • toToken: AptosResourceType
  • Optional version?: typeof VERSION_0 | typeof VERSION_0_5
CreateTXPayloadParams: { curveType: CurveType; fromAmount: Decimal | number; fromToken: AptosResourceType; interactiveToken: "from" | "to"; slippage: number; stableSwapType: "high" | "normal"; toAmount: Decimal | number; toToken: AptosResourceType; version?: typeof VERSION_0 | typeof VERSION_0_5 }

Type declaration

  • curveType: CurveType
  • fromAmount: Decimal | number
  • fromToken: AptosResourceType
  • interactiveToken: "from" | "to"
  • slippage: number
  • stableSwapType: "high" | "normal"
  • toAmount: Decimal | number
  • toToken: AptosResourceType
  • Optional version?: typeof VERSION_0 | typeof VERSION_0_5

Functions

  • convertDecimalToFixedString(value: Decimal, decimals: number): string
  • convertValueToDecimal(value: string | number, decimals?: undefined | number): Decimal
  • Parameters

    • value: string | number
    • decimals: undefined | number = 0

    Returns Decimal

  • getCoinInWithFees(coinOutVal: Decimal, reserveOutSize: Decimal, reserveInSize: Decimal, fee: Decimal): Decimal
  • Calculates rate with uncorrelated curve for 'from' input based on 'to' input

    Parameters

    • coinOutVal: Decimal

      amount of second('to') token

    • reserveOutSize: Decimal

      amount of reserves for second('to') token

    • reserveInSize: Decimal

      amount of reserves for first('from') token

    • fee: Decimal

      amount of fee

    Returns Decimal

  • getCoinOutWithFees(coinInVal: Decimal, reserveInSize: Decimal, reserveOutSize: Decimal, fee: Decimal): Decimal
  • Calculates rate with uncorrelated curve for 'to' input based on 'from' input

    Parameters

    • coinInVal: Decimal

      amount of first('from') token

    • reserveInSize: Decimal

      amount of reserves for first('from') token

    • reserveOutSize: Decimal

      amount of reserves for second('to') token

    • fee: Decimal

      amount of fee

    Returns Decimal

  • getCoinsInWithFeesStable(coinOut: Decimal, reserveOut: Decimal, reserveIn: Decimal, scaleOut: Decimal, scaleIn: Decimal, fee: Decimal): Decimal
  • Calculates rate with stable curve for 'from' input based on 'to' input

    Parameters

    • coinOut: Decimal

      amount of second('to') token

    • reserveOut: Decimal

      amount of reserves for second('to') token

    • reserveIn: Decimal

      amount of reserves for first('from') token

    • scaleOut: Decimal

      precision for the ('to')token in decimal places

    • scaleIn: Decimal

      precision for the ('from')token in decimal places

    • fee: Decimal

      amount of fee

    Returns Decimal

  • getCoinsOutWithFeesStable(coinIn: Decimal, reserveIn: Decimal, reserveOut: Decimal, scaleIn: Decimal, scaleOut: Decimal, fee: Decimal): Decimal
  • Calculates rate with stable curve for 'from' input based on 'to' input

    Parameters

    • coinIn: Decimal

      amount of first('from') token

    • reserveIn: Decimal

      amount of reserves for first ('from') token

    • reserveOut: Decimal

      amount of reserves for second ('to') token

    • scaleIn: Decimal

      precision for the ('from') token in decimal places

    • scaleOut: Decimal

      precision for the ('to') token in decimal places

    • fee: Decimal

      amount of fee

    Returns Decimal

Generated using TypeDoc