Function calculateCollateralDepositRequiredForTrade

  • Similar to calculatetMarginUSDCRequiredForTrade, but calculates how much of a given collateral is required to cover the margin requirements for a given trade. Basically does the same thing as getMarginUSDCRequiredForTrade but also accounts for asset weight of the selected collateral.

    Returns collateral required in the precision of the target collateral market.

    Parameters

    • driftClient: DriftClient
    • targetMarketIndex: number
    • baseSize: BN
    • collateralIndex: number
    • Optional userMaxMarginRatio: number

    Returns BN

Generated using TypeDoc