> ## Documentation Index
> Fetch the complete documentation index at: https://docs.derive.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio Margin Parameters

## Account Details

| Parameter            | Contract Variable               | All universes | Description                                                                                                                             |
| -------------------- | ------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| MAX\_ACCOUNT\_SIZE   | `Pmrm2.max_subaccount_size`     | 100           | The maximum number of assets (options, cash, base, perpetuals) a single portfolio margined subaccount can hold. Constrained by compute. |
| LIQUIDATION\_PENALTY | `Pmrm2.liquidation_penalty_bps` | 500 bps       | Penalty applied when the subaccount is liquidated.                                                                                      |
| STATIC\_RATE         | `Pmrm2.static_rate`             | 0.05          | The static interest rate the manager uses where no rate feed applies.                                                                   |

## Portfolio Margin Scenarios

These are the scenarios used when computing portfolio margin. All regular scenarios have dampening 1. Entries are of the form (Spot Shock (%), Volatility Shock).

| Scenario | BTC              | ETH            | SOL/XRP        | HYPE/ZEC/LIT/PUMP | XAUT            | ADA/CC/VVV        |
| -------- | ---------------- | -------------- | -------------- | ----------------- | --------------- | ----------------- |
| 1        | (+14%, Up)       | (+16%, Up)     | (+24%, Up)     | (+27%, Up)        | (+10%, Up)      | (+33%, Up)        |
| 2        | (+10.5%, Up)     | (+12%, Up)     | (+18%, Up)     | (+20.25%, Up)     | (+7.5%, Up)     | (+24.75%, Up)     |
| 3        | (+10.5%, Static) | (+12%, Static) | (+18%, Static) | (+20.25%, Static) | (+7.5%, Static) | (+24.75%, Static) |
| 4        | (+10.5%, Down)   | (+12%, Down)   | (+18%, Down)   | (+20.25%, Down)   | (+7.5%, Down)   | (+24.75%, Down)   |
| 5        | (+7%, Up)        | (+8%, Up)      | (+12%, Up)     | (+13.5%, Up)      | (+5%, Up)       | (+16.5%, Up)      |
| 6        | (+7%, Static)    | (+8%, Static)  | (+12%, Static) | (+13.5%, Static)  | (+5%, Static)   | (+16.5%, Static)  |
| 7        | (+7%, Down)      | (+8%, Down)    | (+12%, Down)   | (+13.5%, Down)    | (+5%, Down)     | (+16.5%, Down)    |
| 8        | (+3.5%, Up)      | (+4%, Up)      | (+6%, Up)      | (+6.75%, Up)      | (+2.5%, Up)     | (+8.25%, Up)      |
| 9        | (+3.5%, Static)  | (+4%, Static)  | (+6%, Static)  | (+6.75%, Static)  | (+2.5%, Static) | (+8.25%, Static)  |
| 10       | (+3.5%, Down)    | (+4%, Down)    | (+6%, Down)    | (+6.75%, Down)    | (+2.5%, Down)   | (+8.25%, Down)    |
| 11       | (+0%, Up)        | (+0%, Up)      | (+0%, Up)      | (+0%, Up)         | (+0%, Up)       | (+0%, Up)         |
| 12       | (+0%, Static)    | (+0%, Static)  | (+0%, Static)  | (+0%, Static)     | (+0%, Static)   | (+0%, Static)     |
| 13       | (+0%, Down)      | (+0%, Down)    | (+0%, Down)    | (+0%, Down)       | (+0%, Down)     | (+0%, Down)       |
| 14       | (-3.5%, Up)      | (-4%, Up)      | (-6%, Up)      | (-6.75%, Up)      | (-2.5%, Up)     | (-8.25%, Up)      |
| 15       | (-3.5%, Static)  | (-4%, Static)  | (-6%, Static)  | (-6.75%, Static)  | (-2.5%, Static) | (-8.25%, Static)  |
| 16       | (-3.5%, Down)    | (-4%, Down)    | (-6%, Down)    | (-6.75%, Down)    | (-2.5%, Down)   | (-8.25%, Down)    |
| 17       | (-7%, Up)        | (-8%, Up)      | (-12%, Up)     | (-13.5%, Up)      | (-5%, Up)       | (-16.5%, Up)      |
| 18       | (-7%, Static)    | (-8%, Static)  | (-12%, Static) | (-13.5%, Static)  | (-5%, Static)   | (-16.5%, Static)  |
| 19       | (-7%, Down)      | (-8%, Down)    | (-12%, Down)   | (-13.5%, Down)    | (-5%, Down)     | (-16.5%, Down)    |
| 20       | (-10.5%, Up)     | (-12%, Up)     | (-18%, Up)     | (-20.25%, Up)     | (-7.5%, Up)     | (-24.75%, Up)     |
| 21       | (-10.5%, Static) | (-12%, Static) | (-18%, Static) | (-20.25%, Static) | (-7.5%, Static) | (-24.75%, Static) |
| 22       | (-10.5%, Down)   | (-12%, Down)   | (-18%, Down)   | (-20.25%, Down)   | (-7.5%, Down)   | (-24.75%, Down)   |
| 23       | (-14%, Up)       | (-16%, Up)     | (-24%, Up)     | (-27%, Up)        | (-10%, Up)      | (-33%, Up)        |

## \[New!] Skew Rails

V2's PM2 evaluated **two** skew scenarios (one linear, one abs). V3 evaluates **four** — each skew shape in both directions — and aggregates them per expiry rather than per portfolio.

| Rail        | Contract Variable                       | Shape                     | Direction              |
| ----------- | --------------------------------------- | ------------------------- | ---------------------- |
| LINEAR\_CW  | `margin_scenarios[].vol_shock = Linear` | Linear twist of the smile | Clockwise (+1)         |
| LINEAR\_CCW | `margin_scenarios[].vol_shock = Linear` | Linear twist of the smile | Counter-clockwise (-1) |
| ABS\_UP     | `margin_scenarios[].vol_shock = Abs`    | Symmetric wing lift       | Up (+1)                |
| ABS\_DOWN   | `margin_scenarios[].vol_shock = Abs`    | Symmetric wing lift       | Down (-1)              |

All four are evaluated at zero spot shock. The skew loss is **decoupled across expiries**: for each expiry the worst rail is taken independently, and only the negative per-expiry results are summed:

```python Formula theme={null}
Skew Loss = dampening * sum_over_expiries( min(0, min_over_rails( expiry PnL at that rail )) )
```

## Tail Scenarios

These are the tail scenarios, which apply large spot shocks with non-trivial dampening. All are evaluated with volatility shocked up. Pairs are of the form (spot shock (%), dampening factor).

| Scenario | BTC               | ETH               | SOL               | HYPE             | XRP               | ZEC/LIT/PUMP                       | XAUT              | ADA/CC/VVV                         |
| -------- | ----------------- | ----------------- | ----------------- | ---------------- | ----------------- | ---------------------------------- | ----------------- | ---------------------------------- |
| 1        | (-66%, 0.122624)  | (-66%, 0.14)      | (-66%, 0.272711)  | (-66%, 0.3273)   | (-66%, 0.290933)  | (-66%, 0.327273)                   | (-66%, 0.091667)  | (-66%, 0.4)                        |
| 2        | (-33%, 0.245)     | (-33%, 0.28)      | (-33%, 0.545422)  | (-33%, 0.6545)   | (-33%, 0.581778)  | N/A (captured in vanilla scenario) | (-33%, 0.181667)  | N/A (captured in vanilla scenario) |
| 3        | (+50%, 0.161741)  | (+50%, 0.1848)    | (+50%, 0.36)      | (+50%, 0.432)    | (+50%, 0.384)     | (+50%, 0.432)                      | (+50%, 0.12)      | (+50%, 0.528)                      |
| 4        | (+100%, 0.080871) | (+100%, 0.0924)   | (+100%, 0.18)     | (+100%, 0.216)   | (+100%, 0.192)    | (+100%, 0.216)                     | (+100%, 0.06)     | (+100%, 0.264)                     |
| 5        | (+200%, 0.020218) | (+200%, 0.0231)   | (+200%, 0.045022) | (+200%, 0.05065) | (+200%, 0.045022) | (+200%, 0.054)                     | (+200%, 0.015)    | (+200%, 0.132)                     |
| 6        | (+300%, 0.008976) | (+300%, 0.010267) | (+300%, 0.02)     | (+300%, 0.024)   | (+300%, 0.021333) | (+300%, 0.024)                     | (+300%, 0.006667) | (+300%, 0.088)                     |
| 7        | (+400%, 0.005044) | (+400%, 0.005775) | (+400%, 0.011244) | (+400%, 0.0135)  | (+400%, 0.012)    | (+400%, 0.0135)                    | (+400%, 0.00375)  | (+400%, 0.066)                     |
| 8        | (+500%, 0.003228) | (+500%, 0.003696) | (+500%, 0.0072)   | (+500%, 0.00864) | (+500%, 0.00768)  | (+500%, 0.00864)                   | (+500%, 0.0024)   | (+500%, 0.0528)                    |

## Volatility Shocks

These parameters govern the shocked IVs used when computing portfolio margin.

| Parameter                  | Contract Variable                   | BTC/ETH | SOL/HYPE/XRP | ZEC/LIT/PUMP | XAUT  | ADA/CC/VVV | Range             | Description                                                                                                                  |
| -------------------------- | ----------------------------------- | ------- | ------------ | ------------ | ----- | ---------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| VOL\_RANGE (up)            | `vol_shock_params.vol_range_up`     | 0.40    | 0.50         | 0.55         | 0.30  | 0.60       | \[0.01, 2.0]      | Multiplicative scaling of the implied volatility when considering an increase in volatility.                                 |
| VOL\_RANGE (down)          | `vol_shock_params.vol_range_down`   | 0.25    | 0.30         | 0.30         | 0.15  | 0.30       | \[0.01, 1.0]      | Multiplicative scaling of the implied volatility when considering a decrease in volatility.                                  |
| VEGA\_POWER (under 30 DTE) | `vol_shock_params.short_term_power` | 0.3     | 0.3          | 0.3          | 0.3   | 0.3        | \[0.0, 0.5]       | A power scaling of the multiplicative volatility shock, for short dated expiries.                                            |
| VEGA\_POWER (over 30 DTE)  | `vol_shock_params.long_term_power`  | 0.13    | 0.13         | 0.13         | 0.13  | 0.13       | \[0.0, 0.5]       | As above, for long dated expiries.                                                                                           |
| DTE\_FLOOR                 | `vol_shock_params.dte_floor_sec`    | 1 day   | 1 day        | 1 day        | 1 day | 1 day      | \[0.01, 100] days | A floor on the time-to-expiry used when computing the volatility shock. Avoids divergence from dividing by near-zero values. |
| MIN\_VOL\_EVAL\_SHOCKED    | `vol_shock_params.min_vol_up_shock` | 0.50    | 0.60         | 0.60         | 0.20  | 0.60       | \[0, 20]          | Floor on the evaluated (shocked) volatility in the vol-up scenarios.                                                         |

## Contingency Margin

These parameters govern the contingency margin accounting for possibilities not encoded in the spot and IV shocks.

| Parameter                 | Contract Variable              | BTC/ETH | SOL/XAUT | HYPE   | XRP    | ZEC/CC/LIT/PUMP | ADA/VVV | Range        | Description                                                                                                                                             |
| ------------------------- | ------------------------------ | ------- | -------- | ------ | ------ | --------------- | ------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PEG\_FACTOR               | `other_cont.peg_loss_factor`   | 4.0     | 4.0      | 4.0    | 4.0    | 4.0             | 4.0     | \[0.0, 20.0] | Increases IM\_FACTOR when USDC depegs beyond a threshold value.                                                                                         |
| INITIAL\_PERP\_FACTOR     | `other_cont.im_perp_percent`   | 0.015   | 0.0175   | 0.0175 | 0.02   | 0.027           | 0.024   | \[0.0, 1.0]  | Perp contingency for initial margin: a small percentage of the spot price per perpetual contract.                                                       |
| MAINTENANCE\_PERP\_FACTOR | `other_cont.mm_perp_percent`   | 0.0075  | 0.01     | 0.01   | 0.01   | 0.015           | 0.015   | \[0.0, 1.0]  | As above, for maintenance margin.                                                                                                                       |
| IM\_OPTION\_FACTOR        | `other_cont.im_option_percent` | 0.0025  | 0.004    | 0.005  | 0.0075 | 0.0102          | 0.0072  | \[0.0, 1.0]  | A percentage of the spot price added per net short contract per strike to the asset contingency. For SOL, an extra 0.4% of spot per naked short option. |
| MM\_OPTION\_FACTOR        | `other_cont.mm_option_percent` | 0.0015  | 0.0025   | 0.003  | 0.0045 | 0.006           | 0.0042  | \[0.0, 1.0]  | As above, for maintenance margin.                                                                                                                       |
| IM\_FUTURES\_FACTOR       | `other_cont.im_future_percent` | 0       | 0        | 0      | 0      | 0               | 0       | \[0.0, 1.0]  | Dated futures are not listed at V3 launch, so the futures contingency is zero in every market.                                                          |
| MM\_FUTURES\_FACTOR       | `other_cont.mm_future_percent` | 0       | 0        | 0      | 0      | 0               | 0       | \[0.0, 1.0]  | As above, for maintenance margin.                                                                                                                       |

## Discounting

These parameters govern how long and short sub-portfolios are discounted.

| Parameter          | Contract Variable                          | All markets | Range        | Description                                                                               |
| ------------------ | ------------------------------------------ | ----------- | ------------ | ----------------------------------------------------------------------------------------- |
| shortRateMultScale | `margin_params.short_rate_mult_scale`      | 0.0         | \[0.0, 10.0] | Multiplicative scaling of the risk free rate used when discounting a short sub-portfolio. |
| shortRateAddScale  | `margin_params.short_rate_add_scale`       | 0.10        | \[0.0, 10.0] | Additive scaling of the risk free rate used when discounting a short sub-portfolio.       |
| longRateMultScale  | `margin_params.long_rate_mult_scale`       | 0.0         | \[0.0, 10.0] | Multiplicative scaling of the risk free rate used when discounting a long sub-portfolio.  |
| longRateAddScale   | `margin_params.long_rate_add_scale`        | 0.10        | \[0.0, 10.0] | Additive scaling of the risk free rate used when discounting a long sub-portfolio.        |
| STATIC\_SCALE\_POS | `margin_params.long_base_static_discount`  | 0.98        | \[0.0, 1.1]  | A flat scaling of the sub-portfolio's shocked mark value (applies only if positive).      |
| STATIC\_SCALE\_NEG | `margin_params.short_base_static_discount` | 1.02        | \[0.9, 10.0] | A flat scaling of the sub-portfolio's shocked mark value (applies only if negative).      |

## Forward Contingency

These parameters govern the forward contingency, which accounts for forward basis movements against the trader.

| Parameter    | Contract Variable                   | BTC/ETH/XAUT | SOL/HYPE | XRP/ZEC/ADA/CC/LIT/PUMP/VVV | Range     | Description                                                         |
| ------------ | ----------------------------------- | ------------ | -------- | --------------------------- | --------- | ------------------------------------------------------------------- |
| ADD\_FACTOR  | `basis_cont.basis_cont_add_factor`  | 0.5          | 0.25     | 0.35                        | \[0, 5.0] | Additive scaling factor when computing the basis contingency.       |
| MULT\_FACTOR | `basis_cont.basis_cont_mult_factor` | 2.0          | 2.0      | 2.0                         | \[0, 5.0] | Multiplicative scaling factor when computing the basis contingency. |

The two spot scenarios used for the basis contingency are the smallest magnitude spot-up scenario and the smallest magnitude spot-down scenario, both with IV static:

| Market                  | UP\_SCENARIO\_MOVE (`basis_cont.scenario_spot_up`) | DOWN\_SCENARIO\_MOVE (`basis_cont.scenario_spot_down`) |
| ----------------------- | -------------------------------------------------- | ------------------------------------------------------ |
| BTC                     | 1.035                                              | 0.965                                                  |
| ETH                     | 1.04                                               | 0.96                                                   |
| SOL / XRP               | 1.06                                               | 0.94                                                   |
| HYPE / ZEC / LIT / PUMP | 1.0675                                             | 0.9325                                                 |
| XAUT                    | 1.025                                              | 0.975                                                  |
| ADA / CC / VVV          | 1.0825                                             | 0.9175                                                 |

## Initial Margin and Oracle Contingency

These govern how initial margin is defined, and the circumstances where it increases due to stablecoin depegs or low data confidence.

| Parameter             | Contract Variable               | All markets | Range        | Description                                                                                                        |
| --------------------- | ------------------------------- | ----------- | ------------ | ------------------------------------------------------------------------------------------------------------------ |
| IM\_FACTOR            | `margin_params.im_factor`       | 1.0         | \[0.5, 10.0] | Scales the maxLoss and contingencies when computing initial margin.                                                |
| MM\_FACTOR            | `margin_params.mm_factor`       | 0.80        | \[0.5, 10.0] | As above, for maintenance margin.                                                                                  |
| USDC\_THRESHOLD       | `other_cont.peg_loss_threshold` | 0.99        | \[0.0, 1.05] | Value of USDC beneath which the depeg contingency comes into effect.                                               |
| CONFIDENCE\_THRESHOLD | `other_cont.conf_threshold`     | 0.55        | \[0.0, 1.0]  | Value of the confidence beneath which the data is considered low confidence, attracting additional initial margin. |
| CONFIDENCE\_SCALE     | `other_cont.conf_margin`        | 0.4         | \[0, 2.0]    | Percentage of the spot price added when considering the oracle contingency.                                        |

## Skew Shock Parameters

| Parameter               | Contract Variable              | All markets | Range      | Description                                                                      |
| ----------------------- | ------------------------------ | ----------- | ---------- | -------------------------------------------------------------------------------- |
| linearBaseCap           | `skew_params.linear_base_cap`  | 0.25        | ≤ 10       | Maximum multiple of the volatility for the linear scenario.                      |
| absBaseCap              | `skew_params.abs_base_cap`     | 0.25        | ≤ 10       | As above, for the abs scenario.                                                  |
| linearCBase             | `skew_params.linear_c_base`    | -0.1        | ≥ -10      | How much to lower the maximum multiple for longer dated expiries.                |
| absCBase                | `skew_params.abs_c_base`       | -0.1        | ≥ -10      | As above, for the abs scenario.                                                  |
| minKStar                | `skew_params.min_k_star`       | 0.01        | ≥ 0        | Minimum width before flattening the vol increase for the skew scenarios.         |
| widthScale              | `skew_params.width_scale`      | 4.0         | ≤ 10       | How many standard deviations (on ATM vol) after which the IV increase is capped. |
| volParameterStatic      | `skew_params.vol_param_static` | 0.60        | \[0, 10]   | Estimate of IV used to approximate Kstar.                                        |
| volParameterScale       | `skew_params.vol_param_scale`  | 0.0         | \[-20, 20] | Corrects vol for longer timescales.                                              |
| SKEW\_WEIGHTING\_LINEAR | —                              | 1.0         | \[0, 10]   | Weight applied to the linear rails when aggregating the skew loss.               |
| SKEW\_WEIGHTING\_ABS    | —                              | 1.0         | \[0, 10]   | Weight applied to the abs rails when aggregating the skew loss.                  |

## Risk Cancellation

Risk cancelling collateral has its spot exposure shocked together with the universe's derivatives, rather than simply being haircut. A token is risk cancelling **only in the universe that hosts its currency's derivatives**; everywhere else it is plain collateral at a wider haircut.

| Universe | Risk cancelling collateral                                       |
| -------- | ---------------------------------------------------------------- |
| Prime    | (w)BTC, cbBTC, LBTC (into BTC); (w)ETH, wstETH, weETH (into ETH) |
| Hype     | HYPE, kHYPE (into HYPE)                                          |
| Alt      | (w)SOL, jitoSOL (into SOL); fXRP (into XRP); cbADA (into ADA)    |
| RWA      | None — XAUT is plain collateral in V3                            |

## Collateral Haircuts

PM expresses collateral credit as a **deduction**: a long balance is credited `value x (1 - MM_LONG)` towards maintenance margin and `value x (1 - IM_LONG)` towards initial margin. Both numbers below are **totals**, not increments.

Cells are `IM haircut / MM haircut`. A dash means the universe does not accept that token, which is a 100% haircut.

| Asset   | Prime                | Hype              | Alt                | RWA              |
| ------- | -------------------- | ----------------- | ------------------ | ---------------- |
| BTC     | 0.14 / 0.126 *(RC)*  | 0.3025 / 0.25     | 0.3025 / 0.25      | 0.3025 / 0.25    |
| cbBTC   | 0.14 / 0.126 *(RC)*  | 0.3025 / 0.25     | 0.3025 / 0.25      | 0.3025 / 0.25    |
| LBTC    | 0.225 / 0.186 *(RC)* | 0.405 / 0.3       | 0.405 / 0.3        | 0.405 / 0.3      |
| ETH     | 0.07 / 0.06 *(RC)*   | 0.25 / 0.2        | 0.25 / 0.2         | 0.25 / 0.2       |
| wstETH  | 0.1 / 0.086 *(RC)*   | 0.28 / 0.2        | 0.28 / 0.2         | 0.28 / 0.2       |
| weETH   | 0.235 / 0.156 *(RC)* | 0.454 / 0.3       | 0.454 / 0.3        | 0.454 / 0.3      |
| HYPE    | —                    | 0.23 / 0.1 *(RC)* | —                  | —                |
| kHYPE   | —                    | 0.23 / 0.1 *(RC)* | —                  | —                |
| SOL     | —                    | —                 | 0.16 / 0.11 *(RC)* | —                |
| jitoSOL | —                    | —                 | 0.21 / 0.11 *(RC)* | —                |
| fXRP    | —                    | —                 | 0.2 / 0.18 *(RC)*  | —                |
| cbADA   | —                    | —                 | 0.13 / 0.1 *(RC)*  | —                |
| XAUT    | —                    | —                 | —                  | 0.07 / 0.05      |
| fxUSDC  | 0.009975 / 0.005     | 0.009975 / 0.005  | 0.009975 / 0.005   | 0.009975 / 0.005 |
| USDT    | 0.04058 / 0.02       | 0.04058 / 0.02    | 0.04058 / 0.02     | 0.04058 / 0.02   |
| USDe    | 0.20015 / 0.15       | 0.20015 / 0.15    | 0.20015 / 0.15     | 0.20015 / 0.15   |
| sUSDe   | 0.3 / 0.2            | 0.3 / 0.2         | 0.3 / 0.2          | 0.3 / 0.2        |
| DRV     | 0.901 / 0.85         | 0.901 / 0.85      | 0.901 / 0.85       | 0.901 / 0.85     |

*(RC)* marks a risk cancelling row. Every non-marked row is plain collateral.


## Related topics

- [Standard Margin Parameters](/untitled-page-2.md)
- [Portfolio Margin](/portfolio-margin.md)
- [Common Parameters](/common-parameters-parameters-that-are-not-specific-to-one-margin-engine-listing-and-settlement-limits-the-oracle-feeds-both-engines-read-and-the-fees-charged-on-trading-and-on-account-creation-per.md)
