How to Set Up Risk Management for a Perps Exchange
How to design and implement a comprehensive risk management framework for a perpetual futures trading platform.
Risk management is the foundation of any sustainable perpetual futures exchange. It protects traders from excessive losses, prevents socialized losses across the platform, and ensures the exchange remains solvent during extreme market events. Setting up risk management involves configuring margin requirements, building or integrating a liquidation engine, establishing position and leverage limits, funding an insurance fund, and implementing real-time monitoring. This guide covers each component in detail, whether you are building from scratch or configuring a whitelabel platform.
Margin Model Design
The margin model determines how much collateral traders must maintain relative to their position size. Choose and configure the right model for your platform's risk profile.
- Cross-margin: All positions share the same collateral pool. Profit from one position offsets margin requirements for another. This is more capital-efficient for traders holding multiple positions but means a large loss on one position can liquidate the entire account.
- Isolated margin: Each position has its own dedicated collateral. A liquidation on one position does not affect others. This gives traders more control over risk per position but requires more total capital for the same exposure.
- Portfolio margin (advanced): Uses risk-based models (like SPAN or VaR) to calculate margin requirements based on the overall portfolio's risk profile. Offsetting positions reduce margin requirements. This is the most capital-efficient model but the most complex to implement.
- Initial margin vs maintenance margin: Initial margin is required to open a position (typically 1/leverage). Maintenance margin is the minimum required to keep a position open (typically 50% of initial margin). The gap between them provides a buffer before liquidation.
If routing through Hyperliquid or Aster DEX, the venue's margin model is applied automatically. Your platform's role is to present margin requirements clearly and optionally apply additional margin buffers for extra safety.
Configure Leverage Limits
Leverage limits are your primary tool for controlling systemic risk. Set them thoughtfully based on each asset's characteristics.
- Per-asset leverage tiers. Set maximum leverage based on the asset's liquidity and volatility. High-liquidity assets (BTC, ETH) can safely support higher leverage (up to 50x). Mid-cap assets should be limited to 20-30x. Small-cap and volatile assets should be capped at 5-10x.
- Dynamic leverage based on position size. Reduce maximum leverage as position size increases. A trader might get 50x on a $1,000 BTC position but only 20x on a $100,000 position. This prevents large leveraged positions that are difficult to liquidate without significant slippage.
- Account-level leverage limits. Set a maximum total account leverage that limits the aggregate risk across all positions. Even if individual positions are within limits, the combined exposure should not exceed a defined threshold.
- Graduated leverage on new accounts. Consider starting new accounts with lower maximum leverage (e.g., 10x) and increasing limits after they demonstrate trading activity and competence. This protects inexperienced traders from catastrophic early losses.
Liquidation Engine Design
The liquidation engine is the most critical risk management component. It must execute reliably and quickly during the most volatile market conditions.
- Liquidation trigger: A position is flagged for liquidation when equity falls below the maintenance margin requirement. Calculate this continuously using the mark price (not the last traded price) to prevent manipulation via thin order book attacks.
- Partial liquidation: Rather than closing the entire position at once, reduce the position size incrementally until the margin ratio returns above the maintenance threshold. This is less punitive to traders and reduces market impact.
- Liquidation price display: Calculate and display the liquidation price for every open position in real time. Traders use this to manage their risk and add margin before liquidation occurs. The formula depends on the margin model, entry price, position size, and current margin balance.
- Bankruptcy price handling: If a liquidated position closes at a price worse than the bankruptcy price (where equity reaches zero), the remaining loss must be absorbed by the insurance fund or socialized across profitable traders. Design the system to minimize the frequency of this scenario.
- Performance under stress: Liquidation engines must perform fastest when markets move most violently, which is exactly when system load is highest. Load test your liquidation engine under extreme scenarios (10x normal volume, rapid price movements) to ensure it does not lag when it matters most.
When routing through Hyperliquid or Aster DEX, the venue operates the liquidation engine. Your platform should monitor positions and provide early warning notifications to traders as they approach liquidation thresholds.
Insurance Fund Management
The insurance fund covers losses that exceed a liquidated trader's collateral, preventing socialized losses across other traders.
- Fund sources: The insurance fund is typically seeded with an initial allocation from the platform and grows over time from a portion of liquidation penalties (the difference between the liquidation price and the bankruptcy price on successful liquidations).
- Fund sizing: The insurance fund should be large enough to absorb several simultaneous large liquidations during extreme market moves. A rule of thumb is to maintain a fund equal to at least 1% of total open interest on the platform.
- Socialized loss mechanism: If the insurance fund is exhausted, losses must be socialized. The most common approach is auto-deleveraging (ADL), where profitable traders on the opposite side of the market have their positions partially closed to cover the shortfall.
- Transparency: Publish the insurance fund balance in real time. Traders evaluate platform safety partly based on the insurance fund size. Hiding it creates distrust; displaying it prominently demonstrates confidence.
Real-Time Monitoring and Alerts
Proactive monitoring allows your team to intervene before risk events escalate into crises.
- Open interest monitoring: Track total open interest by asset and direction. Rapidly growing one-sided open interest indicates building systemic risk. Set alerts when open interest in any pair exceeds historical norms.
- Concentration risk alerts: Monitor whether any single trader holds a disproportionate share of open interest in any pair. Large concentrated positions create liquidation risks that can cascade through the order book.
- Funding rate monitoring: Extreme funding rates indicate market imbalance. Persistent high funding rates stress traders on one side of the market and increase liquidation probability.
- Liquidation cascade detection: Monitor for cascading liquidations where one liquidation pushes the price further, triggering more liquidations. This positive feedback loop can cause rapid, severe price dislocations.
- Insurance fund health: Alert when the insurance fund drops below a defined threshold relative to open interest. This may trigger emergency measures like reduced leverage limits or trading pauses.
Risk Parameters for Different Platform Types
Risk management configuration should match your platform's target audience and risk tolerance.
| Parameter | Conservative Platform | Standard Platform | Aggressive Platform |
|---|---|---|---|
| Max leverage (BTC/ETH) | 20x | 50x | 100x+ |
| Max leverage (altcoins) | 5x | 20x | 50x |
| Maintenance margin | 5% | 2.5% | 1% |
| Position limits | Strict per-user caps | Tiered by volume | Minimal limits |
| Insurance fund target | 2% of OI | 1% of OI | 0.5% of OI |
| New user restrictions | Mandatory 10x cap | Warning on high leverage | None |
Choose the profile that matches your brand positioning. Platforms targeting experienced traders can use more aggressive parameters, while those targeting newcomers should default to conservative settings with the option for experienced users to unlock higher limits.
Frequently Asked Questions
Do I need to build my own liquidation engine?
If routing through an on-chain venue like Hyperliquid or Aster DEX, the venue handles liquidations natively. Your platform should monitor positions and alert traders, but you do not need to execute liquidations yourself. If building a custom matching engine, you must build the liquidation engine as a critical component.
How do I size the insurance fund for a new exchange?
Start with an initial seed of at least $50,000-$100,000 or 1-2% of your expected initial open interest. Grow the fund from liquidation fee revenue. Monitor the ratio of insurance fund to open interest continuously and add additional capital if it drops below your target threshold.
What causes liquidation cascades?
Liquidation cascades occur when large liquidations push the market price, triggering more liquidations in a feedback loop. They are most common in low-liquidity markets with high open interest concentration. Prevention measures include position limits, dynamic leverage reduction for large positions, and circuit breakers during rapid price movements.
Should I offer 100x leverage?
High leverage attracts certain trader segments but increases systemic risk and the frequency of liquidations. Most professional platforms cap leverage at 50x for major pairs and lower for altcoins. If you offer 100x, implement strict position limits at that leverage level and clear risk warnings. The reputational cost of frequent user liquidations may outweigh the marketing appeal of high leverage.
How does risk management differ for whitelabel versus custom-built exchanges?
Whitelabel platforms inherit the risk management of the underlying execution venue. Your configuration options are limited to parameters the venue and whitelabel provider expose: leverage limits, pair selection, and fee-based risk adjustments. Custom-built exchanges have full control over margin models, liquidation mechanics, and risk parameters but bear full responsibility for their correctness.
Ready to launch your exchange?
perps.studio gives you the infrastructure to deploy a fully branded perpetual futures exchange in minutes.