• Calculates position fees from increasing or decreasing a position. The following fees apply:

    • Margin fee, applied to the delta of the position size
    • Swap fee, applied if adding or removing collateral when the input collateral address differs from the position, requiring a swap. As it is a sync function, it relies on a valid cache of the hLP config, or throws if it does not exist.

    Parameters

    • isIncrease: boolean
    • sizeDelta: BigNumber
    • collateralDelta: BigNumber
    • actualCollateralAddress: string
    • inputCollateralAddress: string
    • stableSwapFeeBasisPoints: number
    • swapFeeBasisPoints: number
    • marginFeeBasisPoints: number
    • getTokenByAddress: ((address) => TokenInfoGlp)
        • (address): TokenInfoGlp
        • Parameters

          • address: string

          Returns TokenInfoGlp

    • Optional hpsmPeg: Peg
      Optional

    Returns SimulatePositionFees

Generated using TypeDoc