Skip to Content
MarginsAccount Margins

1. Understanding Account Margins (Numerators & Dollar Values)

A critical technical detail of the Nord API is that the https://zo-mainnet.n1.xyz/account/{accountId} endpoint returns numerators for the account margins, representing actual USDC dollar values . In contrast to the official margining docs, this structure is used because all margin requirements for a user share a common denominator, the Position Open Notional (PON) which is omitted to show absolute risk values in dollar format.

API Margin Values

tv (Token Value)

  • Formula: (balanceweightpindex)\sum (\text{balance} \cdot \text{weight} \cdot p_{index})

  • Description: The discounted dollar value of all positive asset balances (spot assets).

mf (Account Value / av)

  • Formula: (balanceweightpindex)+(PnL)(borrowpindexweight)\sum (\text{balance} \cdot \text{weight} \cdot p_{index}) + \sum (\text{PnL}) - \sum \left( \frac{\text{borrow} \cdot p_{index}}{\text{weight}} \right)

  • Description: Total net account equity, accounting for assets, liabilities, and unrealized PnL.

pon (Position Open Notional)

  • Formula: (position_sizepindexIMFbase)+(order_notionalIMFbase)\sum (|\text{position\_size}| \cdot p_{index} \cdot IMF_{base}) + \sum (\text{order\_notional} \cdot IMF_{base})

  • Description: The total weighted risk of the account, including both open positions and pending orders.

pn (Position Notional)

  • Formula: (position_sizepindexIMFbase)\sum (|\text{position\_size}| \cdot p_{index} \cdot IMF_{base})

  • Description: A subset of pon representing the weighted dollar value of open positions only.

imf (Initial Margin Fraction)

  • Formula: (PONIMFbase)\sum (PON \cdot IMF_{base})

  • Description: The total dollar amount required to be maintained in order to open new positions.

omf (Open Margin Fraction)

  • Formula: min(AV,TV)\min(AV, TV)

  • Description: The effective equity value used by the system to check against the initial margin requirement.

cmf (Cancel Margin Fraction)

  • Formula: (PONCMFbase)\sum (PON \cdot CMF_{base}) where CMFbaseCMF_{base} is (5/8)IMFbase(5/8) \cdot IMF_{base} (perp) or IMFbaseIMF_{base} (spot).

  • Description: The dollar threshold below which the system will begin canceling open orders.

mmf (Maintenance Margin Fraction)

  • Formula: (PONMMFbase)\sum (PON \cdot MMF_{base}) where MMFbaseMMF_{base} is (1/2)IMFbase(1/2) \cdot IMF_{base} (perp) or (1.03/weight1)(1.03/\text{weight} - 1) (spot).

  • Description: The minimum dollar equity required to avoid liquidation of open positions.


2. Leverage & The Risk Engine

It is important to distinguish between the front-end user interface and the back-end risk engine regarding leverage.

  • Front-end Leverage Slider: This works solely as a risk-management tool for the user. It allows you to artificially limit your exposure, but it does not change the underlying margin requirements of the exchange.

  • Back-end Risk Engine: The engine always operates under the assumption of the Maximum Leverage allowed for a specific market.

    • Example: If Bitcoin (BTC) allows 50x leverage (0.02 IMF), and you open a 1,000positionwhileyourfrontendsliderissetto"10x,"theUImightimplyyouareusing1,000 position while your front-end slider is set to "10x," the UI might imply you are using 100 of margin. However, the risk engine calculates you are only using $20 of margin ($1000 * 0.02$). The front-end will artificially limit the maximum order value you can open even if the risk engine allows for more.
  • Liquidation Prices: This logic explains why your liquidation price does not change when you adjust the leverage slider. The risk engine calculates your liquidation point based on the maximum possible leverage to ensure the safety of the protocol, regardless of the front-end leverage you have set.


3. Liquidation & Cancellation Rules

When an account becomes unhealthy, Nord triggers specific actions in a strict sequence to reduce risk.

  • Order Cancellation (omf < cmf): If your account value (omf) drops below the cmf threshold, the system cancels open orders that would increase your position size. This happens before position liquidation to restore health without closing active trades.

  • Position Liquidation (mf < mmf): If the account value (mf) drops below the mmf threshold, the exchange begins reducing your positions.

  • Bankruptcy (mf <= 0): If account value becomes negative, the account is cleared by the insurance fund.

  • Execution: All liquidation orders are Fill-or-Kill (FoK), meaning they are executed immediately or cancelled.


4. Margin Definitions for Markets

The thresholds for imf, cmf, and mmf are derived from the risk profile of each market at https://zo-mainnet.n1.xyz/info (Note that in contrast to the account margin, the margin information here actually shows the decimal value for the market itself, not dollar value).

  • Initial Margin (IMF): The primary representative of maximum leverage. For example, a 0.02 IMF is equal to 50x leverage.

  • Maintenance Margin (MMF): Typically set at half of the IMF (e.g., if IMF is 0.02, MMF is 0.01).

  • Cancel Margin (CMF): For perpetuals, this is defined as 5/8 of the IMF.


5. Funding Accumulation

Funding at Nord follows an accumulation model for maximum efficiency.

  • Accumulation Frequency: Funding is not paid out every hour; instead, it is accumulated every hour based on the current funding rates.

  • Lazy Settlement: This accumulated value is tracked via a global Funding Index.

  • Realization: Payments are only settled and reflected in your actual balance when your position is updated, such as through a trade.

  • Risk Calculation: If a position is untouched, funding continues to accumulate as unsettled funding. This unsettled amount is still factored into your omf and mf to ensure accurate risk monitoring.


6. Primary Formulas

Max Available to Trade

To find the maximum notional value you can open on a specific market (mm) as allowed by the risk engine (considering cross-margining):

Available Notional=omfuserimfuserIMFbase,m\text{Available Notional} = \frac{omf_{\text{user}} - imf_{\text{user}}}{\text{IMF}_{\text{base}, m}}

  • omfuseromf_{\text{user}}: Operational Margin Factor (the minimum of your total Account Value and weighted Token Value).

  • imfuserimf_{\text{user}}: Your current total initial margin requirement numerator.

  • IMFbase,m\text{IMF}_{\text{base}, m}: The specific initial margin rate for the asset.

Liquidation Price

Calculates the distance from the current index price where mfusermf_{\text{user}} will equal mmfusermmf_{\text{user}}.

For Longs:

pliq=pcurrentmfusermmfusers×(1MMFbase)p_{\text{liq}} = p_{\text{current}} - \frac{mf_{\text{user}} - mmf_{\text{user}}}{s \times (1 - MMF_{\text{base}})}

For Shorts:

pliq=pcurrent+mfusermmfusers×(1+MMFbase)p_{\text{liq}} = p_{\text{current}} + \frac{mf_{\text{user}} - mmf_{\text{user}}}{s \times (1 + MMF_{\text{base}})}

  • mfusermmfusermf_{\text{user}} - mmf_{\text{user}}: Your dollar cushion before reaching the liquidation threshold.

  • s×(1±MMFbase)s \times (1 \pm MMF_{\text{base}}): Position sensitivity. The (1±MMFbase)(1 \pm MMF_{\text{base}}) factor accounts for the “double-squeeze”: as price moves against you, your account value drops and your required maintenance margin increases.

Last updated on