Function calculateMarginUSDCRequiredForTrade

  • Calculates the margin required to open a trade, in quote amount. Only accounts for the trade size as a scalar value, does not account for the trade direction or current open positions and whether the trade would actually be risk-increasing and use any extra collateral.

    Returns

    Parameters

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

    Returns BN

Generated using TypeDoc