Skip to content

Risk Management

Essential risk management practices for trading on the Rate Swap Protocol.

Health Factor

Your position health determines liquidation risk:

Health = Collateral_Value + Realized_PnL + Unrealized_MTM - Maintenance_Requirement

Where:

  • Collateral_Value: Your deposited quote tokens (e.g., USDC)
  • Realized_PnL: Accumulated funding settlements in your positions
  • Unrealized_MTM: Mark-to-market value of open positions
  • Maintenance_Requirement: Minimum margin based on notional exposure

Status:

  • Healthy: health >= 0
  • Liquidatable: health < 0

Monitoring Health

  • Check health factor before and after trades
  • Add collateral if health is declining
  • Reduce position size to improve health
  • Monitor realized PnL accumulation from funding settlements

Margin Requirements

Initial Margin

Required to open or increase position:

Initial_Margin = |notional| × initial_margin_bps / 10000

Example: 500 bps (5%) means $5,000 initial margin per $100,000 notional.

Maintenance Margin

Minimum to avoid liquidation:

Maintenance_Margin = |notional| × maintenance_margin_bps / 10000

Example: 300 bps (3%) means $3,000 maintenance per $100,000 notional.

Margin Floor (Per-Position)

The protocol also enforces a minimum margin floor based on rate and time:

R_eff = max(|current_rate|, min_rate_floor)
T_eff = max(time_to_maturity, min_time_floor)
Floor_Margin = |notional| × R_eff × T_eff × multiplier / SECONDS_PER_YEAR

Your effective margin requirement is: max(BPS_Margin, Floor_Margin)

This prevents undercollateralization when rates or time-to-maturity are very small.

Margin Buffer

Keep extra collateral above maintenance:

  • Protects against sudden rate moves
  • Provides buffer for adverse funding settlements
  • Reduces liquidation risk

Liquidation

Accounting-Only Settlement

Before understanding liquidation, it's important to understand how the protocol settles funding:

Key concept: Settlement is purely bookkeeping - no SPL token transfers occur during funding settlement.

When your position is settled:

  1. Your realized_pnl is updated: position.realized_pnl += rate_settlement_delta
  2. The pool's counterparty balance is updated: market.pool_rate_accumulator -= rate_settlement_delta
  3. No tokens move until you explicitly deposit or withdraw

This accounting-only approach means:

  • Funding payments accumulate in your position's realized_pnl
  • Your equity includes both collateral AND accumulated realized PnL
  • Tokens only transfer when you withdraw margin

When Liquidation Occurs

Your position is liquidatable when:

  • Health < 0 (after settling funding and computing MTM)
  • Oracle is fresh and settlement is valid

Crank-Only Liquidation Process

The protocol uses a crank-only liquidation model:

  1. Anyone can trigger liquidation - it's permissionless
  2. Funding settles (accounting-only) to latest oracle index
  3. Health is computed - must be negative to proceed
  4. Close amount calculated using closed-form approximation:
    K = |health| × WAD / (maintenance_rate - penalty_rate - sign_adjusted_mtm)
  5. Position reduced via AMM at current market rate
  6. Penalty applied (accounting-only):
    • Deducted from victim's position.realized_pnl
    • Credited to pool's market.pool_rate_accumulator
  7. Post-liquidation health verified to be improved and near zero

Important: The liquidator does NOT receive the penalty directly. All penalties go to the pool, benefiting LPs. This is different from traditional liquidation systems where liquidators receive a reward.

Avoiding Liquidation

  • Monitor health factor continuously
  • Deposit additional collateral proactively
  • Reduce position size in adverse markets
  • Close positions before they reach liquidation threshold
  • Keep buffer for adverse funding accumulation

Circuit Breakers

The protocol has market-level circuit breakers that can affect your trading:

Market Status

  • Normal: All trades allowed
  • Closing-Only: Only risk-reducing trades (can only decrease |notional|)
  • Halted: Only liquidations allowed, no trading

When Circuit Breakers Activate

Circuit breakers may be triggered when:

  • Oracle data becomes unreliable
  • Extreme market volatility occurs
  • Emergency admin intervention is needed

Impact on Your Positions

During Closing-Only mode:

  • You can reduce or close positions
  • You cannot increase position size
  • Liquidations still function normally

During Halted mode:

  • You cannot trade at all
  • Liquidations can still occur
  • Wait for market to reopen

Position Sizing

Conservative Approach

  • Use 2-3x initial margin (e.g., 10-15% collateral for 5% IM)
  • Limit position size to small % of portfolio
  • Diversify across multiple markets/maturities

Leverage Considerations

Higher leverage = higher risk:

  • More sensitive to rate movements
  • Less buffer for adverse funding
  • Faster path to liquidation

DV01 Budgeting

Calculate your DV01 exposure:

DV01 = |notional| × T_eff × 0.0001

where:
  T_eff = max(time_to_maturity_years, min_time_floor_years)

Limit total DV01 to a fraction of your capital.

Note: The protocol uses DV01-based liquidity gating. For risk-increasing trades, available liquidity is reduced by a DV01 reserve, so very large trades may see reduced depth.

Risk Caps

Open Interest (OI) Caps

Each market has a maximum gross open interest:

  • Trades that would exceed the OI cap are rejected
  • Liquidations always succeed (they reduce OI)
  • OI = sum of |notional| across all positions

DV01 Caps

Each market has a maximum gross DV01:

  • Risk-increasing trades that would exceed the cap are rejected
  • Limits the market's sensitivity to rate movements

If your trade is rejected due to caps, try:

  • Reducing trade size
  • Waiting for other positions to close
  • Trading on a different market

Rate Risk Management

Scenario Analysis

Model position P&L under different rate scenarios:

  • Rates up 1%, 2%, 5%
  • Rates down 1%, 2%, 5%
  • Stress scenarios (extreme moves)

Stop Losses

Set mental stop-loss levels:

  • Close position if MTM loss exceeds threshold
  • Exit if health factor falls below comfortable level

Time Decay

Positions near maturity have different risk:

  • Lower DV01 (less rate sensitivity)
  • Margin floor may dominate margin requirement
  • Consider closing before maturity

Funding Risk

Funding Accumulation

Under accounting-only settlement:

  • Funding settlements accumulate in position.realized_pnl
  • Adverse funding drains your effective equity
  • Monitor realized_pnl in your positions

Funding Buffer

Maintain extra collateral to absorb funding volatility:

  • Estimate potential funding over holding period
  • Keep buffer above expected funding payments

Oracle Risk

Staleness

  • Stale oracle halts trading and settlements
  • Positions frozen until oracle updates
  • Ensure oracle reliability before large positions

Manipulation

  • Oracle manipulation could impact settlement
  • Protocol uses trusted oracle sources
  • Monitor oracle updates for anomalies

Portfolio Risk

Diversification

  • Spread exposure across multiple markets
  • Different rate indices (funding, borrow, etc.)
  • Different maturities

Correlation

  • Some rate indices correlate highly
  • Diversification benefit depends on correlation
  • Monitor cross-market exposure

Maximum Exposure

Set limits on:

  • Total notional across all positions
  • Total DV01 budget
  • Maximum % of collateral at risk

Best Practices

  1. Start Small: Begin with conservative position sizes
  2. Monitor Continuously: Check health, MTM, realized PnL regularly
  3. Keep Buffer: Maintain collateral well above maintenance margin
  4. Understand Accounting: Know how realized_pnl accumulates
  5. Watch Circuit Breakers: Be aware of market status
  6. Respect Caps: Size trades to fit within OI/DV01 limits
  7. Plan Exits: Know when you'll close positions
  8. Understand Mechanics: Fully grasp funding, MTM, liquidation
  9. Test Scenarios: Model worst-case outcomes before trading
  10. Stay Informed: Track oracle updates and protocol changes

Emergency Procedures

If Health is Declining

  1. Immediately deposit more collateral, or
  2. Close part of position to reduce margin requirements
  3. Monitor for liquidation threshold

If Liquidation is Imminent

  • Close position manually to avoid liquidation penalty
  • Note: Penalty goes to pool, not to a liquidator
  • Withdraw remaining collateral after closing
  • Reassess risk tolerance and position sizing

If Market is Closing-Only

  • You can still close or reduce positions
  • Cannot open new positions or increase size
  • Wait for market to return to Normal status

If Market is Halted

  • Positions frozen until market reopens
  • Cannot trade, but liquidations can still occur
  • Wait for protocol admin to restore market

If Oracle is Stale

  • Positions frozen until oracle updates
  • Cannot trade, withdraw, or settle
  • Wait for oracle authority to update

Next Steps

Released under the ISC License.