docs/content/standards/deepbook-margin/contract-information/risk-ratio.mdx
Risk ratios are the core mechanism that governs leverage limits and position safety in DeepBook Margin. Understanding these ratios is essential for managing margin positions effectively.
The risk ratio is defined as:
risk_ratio = total_assets / total_debts
Where assets and debts are valued in a common denomination using oracle prices. A higher risk ratio indicates a safer position with more collateral relative to debt.
Each trading pair has four risk ratio thresholds that control different operations:
The minimum risk ratio required after withdrawing collateral.
The minimum risk ratio required after borrowing additional funds.
The risk ratio threshold at which a position becomes eligible for liquidation.
The target risk ratio that liquidation aims to restore the position to.
The maximum leverage for a trading pair is determined by the Min Borrow Risk Ratio:
$$\text{Max Leverage} \approx \frac{1}{1 - \frac{1}{\text{Min Borrow Risk Ratio}}}$$
| Min Borrow Risk Ratio | Approximate Max Leverage |
|---|---|
| 1.25 | 5x |
| 1.5 | 3x |
| 2.0 | 2x |
Consider a SUI/USDC position with the following risk parameters:
Opening a position:
Price moves in your favor:
Price moves against you:
When a position is liquidated:
These rewards ensure liquidators are incentivized to maintain system health and the protocol has reserves against defaults.