docs/content/standards/deepbook-margin/margin-risks.mdx
Margin trading amplifies both gains and losses. Before using DeepBook Margin, it's critical to understand the risks involved. This guide explains the key risks and provides concrete examples to help you make informed decisions.
The most significant risk in margin trading is liquidation - the forced closure of your position when it becomes too risky for the protocol to maintain.
When you borrow funds to trade, you must maintain a minimum risk ratio (the ratio of your total assets to total debts). If your position's risk ratio falls to or below the Liquidation Risk Ratio, anyone can liquidate your position.
:::caution Warning Zone For SUI/USDC (5x leverage), when your risk ratio falls between 1.1 and 1.2, you are in the warning zone. For WAL/USDC and DEEP/USDC (3x leverage), the warning zone is between 1.2 and 1.3. At these levels, even minor price movements can push you into liquidation. Monitor your position carefully and consider adding collateral or reducing your position size. :::
Liquidation in DeepBook Margin is partial, not total. The protocol only liquidates enough of your position to restore your risk ratio to the Target Liquidation Risk Ratio (1.25 for SUI/USDC, 1.5 for WAL/USDC and DEEP/USDC).
During liquidation:
This means if you're liquidated, you won't lose your entire position. The liquidator repays just enough debt to bring your ratio back to the target, leaving you with a smaller but healthier position.
However, if your position is severely underwater (assets barely cover debt plus rewards), a full liquidation may occur where all debt is repaid and the lending pool may incur bad debt.
Let's walk through a concrete example using the SUI/USDC trading pair, which has a Liquidation Risk Ratio of 1.1.
Opening position:
The path to liquidation:
| SUI Price (USDC) | SUI Value (USDC) | Total Assets (USDC) | Risk Ratio | Status |
|---|---|---|---|---|
| 1.50 | 400 | 500 | 1.25 | Safe (at min borrow ratio) |
| 1.425 | 380 | 480 | 1.20 | Warning zone |
| 1.35 | 360 | 460 | 1.15 | Danger zone |
| 1.275 | 340 | 440 | 1.10 | Liquidatable |
| 1.20 | 320 | 420 | 1.05 | Underwater |
What happens at 1.275 USDC per SUI:
Key insight: With 5x leverage, a mere 15% adverse price movement can trigger liquidation. Without leverage, you'd simply be down 15% on paper.
Unlike traditional margin calls that give you time to add collateral, DeFi liquidations happen instantly:
Cryptocurrency prices are highly volatile. Leverage amplifies this volatility on your equity, whether you're long or short.
| Leverage | 10% Adverse Move | 20% Adverse Move | 30% Adverse Move |
|---|---|---|---|
| 1x (no leverage) | -10% equity | -20% equity | -30% equity |
| 2x | -20% equity | -40% equity | -60% equity |
| 3x | -30% equity | -60% equity | -90% equity |
| 5x | -50% equity | Liquidated | Liquidated |
An "adverse move" means:
With 5x leverage:
Crypto markets can move 10-20% in hours. Flash crashes, short squeezes, exchange outages, or major news events can trigger rapid price movements that liquidate leveraged positions before you can react.
When you borrow funds, you pay interest that accrues continuously. This interest is variable and can change significantly based on pool utilization.
DeepBook Margin uses a kinked interest rate model where rates increase gradually up to an optimal utilization point, then spike dramatically.
Current USDC pool parameters:
| Utilization | Interest Rate (APR) |
|---|---|
| 0% | 0% |
| 50% | 7.5% |
| 80% (optimal) | 12% |
| 85% | 37% |
| 90% (max) | 62% |
Imagine you open a leveraged position expecting to pay ~12% APR (at 80% utilization):
On a 400 USDC borrow:
Over a month, this difference compounds significantly and can erode your position's equity even if prices don't move against you.
Interest accrues to your debt, which means:
Example: Starting with a 1.25 risk ratio and 37% APR interest:
DeepBook Margin uses Pyth price oracles to value your assets and debts. While the protocol includes several protections, some oracle-related risks remain:
DeepBook Margin implements multiple safeguards against oracle issues:
Just because you can borrow at 5x doesn't mean you should. Consider:
DeepBook Margin supports TPSL orders that automatically close your position:
If you're new to margin trading:
| Risk | What Can Happen | How to Mitigate |
|---|---|---|
| Liquidation | Price volatility causes position to be forcibly closed, lose collateral + fees | Use less leverage, set stop losses, monitor positions |
| Interest rates | Borrowing costs spike unexpectedly | Check utilization, factor in rate variability |
| Oracle risk | Prices may not reflect true market | Understand oracle mechanics, avoid extreme leverage |