Per-Market Leverage
Per-Market leverage introduces market specific leverage limits, giving traders finer control over their positions while improving account safety.
Instead of every position sharing a single account level limit, each perpetual market now defines its own maximum leverage cap.
This allows higher leverage on stable assets and stricter limits on more volatile ones.
How Per-Market Leverage Works
Each perpetual market defines its own maximum leverage through its protocol-set initial margin ratio (margin_ratio_initial), with an additional surcharge (the IMF factor) applied to large positions. This is the most leverage anyone can use in that market.
On top of the market cap, you can optionally hold yourself to a lower limit, either account-wide (account.max_margin_ratio) or per position (position.max_margin_ratio). These overrides can only make your limit more conservative; they can never raise it above the market’s cap.
Your override only applies to initial margin, the check run when you open or increase a position. It does not touch maintenance margin, which always uses the market’s own margin_ratio_maintenance (plus its IMF surcharge on large size). Capping yourself to 10x on a 20x market lowers the size you can open; it does not move your liquidation threshold, which stays wherever the market sets it.
When evaluating a position for the initial-margin check, Velocity uses the largest (most conservative) applicable margin ratio, equivalently, the lowest leverage:
effective_margin_ratio = max(
market.margin_ratio_initial, // protocol cap for the market (+ IMF surcharge on large size)
account.max_margin_ratio, // your optional account-wide cap
position.max_margin_ratio // your optional per-position cap
)| Market | Market cap (margin_ratio_initial) | Your optional override | Effective leverage | Result |
|---|---|---|---|---|
| SOL-PERP | 20x (5% margin) | none | 20x | Market cap applies |
| SOL-PERP | 20x (5% margin) | 10x | 10x | Your override is more conservative |
Illustrative. SOL-PERP’s live initial margin ratio is 5% (20x); each market’s current values live on-chain.
The market side of the ratio is itself a max: the protocol-set margin_ratio_initial against the IMF size premium for large positions. A market in Settlement status is a special case and always uses a margin ratio of 0.
A higher margin ratio means lower leverage, so the most conservative limit always wins for the initial-margin check. From this ratio, the protocol derives the maximum position size you can open with your available collateral. The liquidation threshold, by contrast, is set separately: it always comes from the market’s own maintenance margin ratio and is unaffected by your account or per-position overrides.
Risk and Control
Per-market leverage gives traders more flexibility and control:
- Apply different leverage limits for different strategies or market conditions.
- High-risk markets can be capped tightly without restricting more stable ones.
- Each market’s maximum leverage and liquidation threshold are clear and predictable.
Per-market leverage caps do not isolate risk between positions. Unless a position is an isolated position, all of a subaccount’s positions share one pool of collateral and one maintenance-margin requirement: a large loss on one market (say HYPE-PERP) still draws down the collateral backing your other positions (say BTC-PERP) and can contribute to a cross-margin liquidation. To fully segregate a position’s collateral and liquidation, use an isolated position.
Code Implementation
Files and functions
Per-market leverage logic is implemented in:
state/user.rsstoresmax_margin_ratioon thePerpPositionstructVelocityClient.updateUserPerpPositionCustomMarginRatio(@velocity-exchange/sdk,velocityClient.ts) updates per-position settings