Skip to main content

Definitions

Risk values are denominated in USD. USDC is the quote and settlement asset.

Position size

The signed number of contracts in a perpetual futures market. A long position has a positive position size, and a short position has a negative position size.

Fill size

The signed number of contracts exchanged when orders are matched. A buy has a positive fill size, and a sell has a negative fill size.

Iverson bracket

We sometimes use the Iverson bracket I[]\mathbb{I}[\cdot], where I[P]=1\mathbb{I}[P] = 1 if PP is true, and 00 otherwise. This simplifies notation in various places.

Tokens

Assets such as USDC and ETH held in an account. Positive token balances can contribute collateral; negative balances represent borrows.

Weight

A number in (0,1](0, 1] defining the contribution of this token to the overall account value. The weight accounts for factors such as volatility and liquidity.

For example, suppose BTC has weight 0.9 and USD price 1000 USD/BTC. If a user deposits 1 BTC, then their account value increases by 0.9 * 1 BTC * 1000 USD/BTC = 900 USD.

Position notional (PN)

The position notional is the value of a user's position. For perpetual markets, it is defined as:

PNperp=position sizephigh index\text{PN}_\text{perp} = |\text{position size}| \cdot p_\text{high index}

Because PN measures risk, it uses the upper-bound index price to conservatively maximize exposure.

Position open notional (PON)

The position open notional is the maximum position notional achievable by filling the user's open orders. It limits how much risk a user can take through open orders.

For perpetual markets, it is defined as:

PONperp=max{position sizephigh index+bid order sizepbid,position sizeask order sizephigh index}\begin{align*} \text{PON}_\text{perp} &= \max\big\{ |\text{position size} \cdot p_\text{high index} + \sum{\text{bid order size} \cdot p_\text{bid}}|, \\ &\qquad |\text{position size} - \sum{\text{ask order size}}| \cdot p_\text{high index} \big\} \end{align*}

Because PON measures risk, it uses the upper-bound index price to conservatively maximize exposure.

Token value (TV)

The USD value of an account's positive token balances after applying token weights and conservative index prices. TV represents the account's collateral value.

Account value (AV)

The account value is computed by summing the unrealized profit and loss (PnL) of the user's positions, token balances, and borrows. Unrealized PnL has not yet been reflected in the user's balances by closing the position. PnL is realized when a position is closed.

To compute this, let popenp_\text{open} be the price at which the position was opened, corresponding to its purchase or sale price. In practice, a user's position may have been opened by purchasing or selling contracts at different prices. To simplify implementation, it is sufficient to reweight the open price accordingly. For example, suppose a user purchases 5 contracts at price 20 and 10 contracts at price 30. Then:

popen=520+10305+10=26.6(6)p_\text{open} = \frac{5 \cdot 20 + 10 \cdot 30}{5 + 10} = 26.6(6)

To value positions conservatively, Nord uses the upper-bound index price for shorts and the lower-bound index price for longs. The open price must be reweighted after each fill for both makers and takers. Because position size is negative for short positions, unrealized PnL is:

unrealized PnL={position size(plow indexpopen)position size0position size(phigh indexpopen)position size<0\text{unrealized PnL} = \begin{cases} \text{position size} \cdot (p_\text{low index} - p_\text{open}) & \text{position size} \ge 0 \\ \text{position size} \cdot (p_\text{high index} - p_\text{open}) & \text{position size} < 0 \end{cases}

TV is the total value of the user's weighted positive token balances. Because TV represents positive collateral value, it uses the lower-bound index price.

TV=tokensbalanceweightI[balance0]plow index\text{TV} = \sum_{\text{tokens}} \text{balance}\cdot\text{weight}\cdot\mathbb{I}[\text{balance} \ge 0] \cdot p_\text{low index}

Positive token balances are weighted, while negative balances are treated as borrows without a collateral weight. Account value also includes unsettled funding payments.

AV=marketsunrealized PnL+TV+tokensbalanceI[balance<0]phigh index\text{AV} = \sum_{\text{markets}} \text{unrealized PnL} + \text{TV} + \sum_{\text{tokens}} \text{balance} \cdot \mathbb{I}[\text{balance} < 0] \cdot p_\text{high index}

Equivalently:

AV=marketsunrealized PnL+tokensbalance{weightplow indexbalance0phigh indexbalance<0\text{AV} = \sum_{\text{markets}} \text{unrealized PnL} + \sum_{\text{tokens}} \text{balance} \cdot \begin{cases} \text{weight} \cdot p_\text{low index} & \text{balance} \ge 0 \\ p_\text{high index} & \text{balance} < 0 \end{cases}

AV is denominated in USD. TV corresponds to the user's collateral, whereas AV also discounts borrows and includes current PnL. This ensures that borrows are capped by collateral.

Profit and loss (PnL)

The change in a position's value. Unrealized PnL is the value change of an open position; realized PnL is reflected in the account balance when exposure is closed.

Margin fraction (MF)

Account value divided by current position notional. MF measures the health of current positions.

Open margin fraction (OMF)

The smaller of account value and token value, divided by position open notional. OMF measures account health after accounting for open orders.

Initial margin fraction (IMF)

The minimum open margin required to open a position, increase exposure, or borrow assets.

Cancel margin fraction (CMF)

The open-margin threshold at which risk-increasing open orders become eligible for cancellation.

Maintenance margin fraction (MMF)

The margin threshold below which positions and borrows become eligible for liquidation.

Index price

An index price provided by an oracle is not a single scalar value. The oracle aggregates prices for an asset and expresses the result as a median price Pm and confidence interval C, such that the actual index price falls within the [Pm-C, Pm+C] interval with 95% probability. For more details, see Confidence intervals.

Risk computations use a conservative index price: they reduce positive values and increase negative values so that account health is not overestimated.

Different kinds of index price are marked as follows:

  • Median index price: pindexp_\text{index}
  • Lower-bound index price: plow indexp_\text{low index}
  • Upper-bound index price: phigh indexp_\text{high index}

Freeze

If the price update condition below is true, the market is frozen.

Let:

  • PprevP_{\text{prev}} be the previous price
  • PnewP_{\text{new}} be the new price
  • Δt\Delta t be the elapsed duration
  • rthr_{\text{th}} be the threshold rate
  • vv be the confidence relaxation factor
  • Δp=PprevPnew\Delta p = \left|P_{\text{prev}} - P_{\text{new}}\right| be the absolute price change
  • VprevV_{\text{prev}} be the previous confidence
  • VnewV_{\text{new}} be the new confidence
  • kk be the required confidence narrowing factor

vv is set as:

v={vrelaxif ΔpVprev and VnewkVprev1otherwisev = \begin{cases} v_{\text{relax}} & \text{if } \Delta p \le V_{\text{prev}} \text{ and } V_{\text{new}} \cdot k \le V_{\text{prev}} \\ 1 & \text{otherwise} \end{cases}

Then freeze if:

PprevPnewPprevΔt>rthv\frac{\left|P_{\text{prev}} - P_{\text{new}}\right|}{P_{\text{prev}} \cdot \Delta t} > r_{\text{th}} \cdot v

Outage

An oracle outage begins when no updated price has been received for one minute.

An update with the same price but a different timestamp is considered a valid update.

Mark price

The market-derived price used to measure a perpetual market's premium or discount relative to its index price.

Funding index

A per-market accumulator used to calculate funding owed or received since a position's last funding settlement.

Liquidator

A permissionless actor that initiates eligible liquidation actions.

Backstop

The designated account that takes distressed positions during backstop liquidation.

System account

The protocol-controlled account that receives system fees and records deficits produced during backstop liquidation.

These materials are provided for informational purposes only and do not constitute financial, investment, legal, or tax advice, or an offer or solicitation to buy or sell any asset. Trading digital assets and derivatives involves substantial risk, including the possible loss of some or all capital. Products may not be available in all jurisdictions. Users are responsible for evaluating suitability and complying with applicable laws.