Function getStrictTokenValue

  • Calculates the value of a given token amount using the worst of the provided oracle price and its TWAP.

    Returns

    The calculated value of the given token amount, scaled by PRICE_PRECISION

    Parameters

    • tokenAmount: BN

      The amount of tokens to calculate the value for (from getTokenAmount)

    • spotDecimals: number

      The number of decimals in the token.

    • oraclePriceData: OraclePriceData

      The oracle price data (typically a token/USD oracle).

    • oraclePriceTwap: BN

      The Time-Weighted Average Price of the oracle.

    Returns BN

Generated using TypeDoc