Circuit Breakers
Overview
Section titled “Overview”Circuit breakers automatically pause or restrict trading when abnormal conditions are detected. They protect users and the platform from cascading failures, manipulation, and extreme volatility.
Trigger Conditions
Section titled “Trigger Conditions”Price-Based Triggers
Section titled “Price-Based Triggers”| Condition | Threshold | Action |
|---|---|---|
| AMM-Oracle deviation | >30% | Pause trading |
| Price move (1 hour) | >50% | Warning + increased fees |
| Price move (24 hour) | >80% | Pause trading |
| Flash crash detection | >20% in 5 min | Pause 15 min |
Volume-Based Triggers
Section titled “Volume-Based Triggers”| Condition | Threshold | Action |
|---|---|---|
| Single trade | >10% of pool | Require confirmation |
| Hourly volume | >50% of pool | Warning |
| Daily volume | >200% of pool | Manual review |
System-Based Triggers
Section titled “System-Based Triggers”| Condition | Threshold | Action |
|---|---|---|
| Oracle failure | No update >1 hour | Pause affected markets |
| Smart contract anomaly | Unexpected behavior | Emergency pause all |
| Chain congestion | >100 gwei | Display warning |
Circuit Breaker Levels
Section titled “Circuit Breaker Levels”Level 1: Warning
Section titled “Level 1: Warning”Level 1 - WARNING├── Trigger: Unusual but not critical├── Actions:│ ├── Display warning banner│ ├── Require trade confirmation│ └── Log for monitoring├── Auto-resolution: When condition clears└── Example: 25% price move in 24 hoursLevel 2: Restricted
Section titled “Level 2: Restricted”Level 2 - RESTRICTED├── Trigger: Elevated risk├── Actions:│ ├── Increase trading fees 2x│ ├── Reduce position limits 50%│ ├── Require enhanced confirmation│ └── Alert operations team├── Auto-resolution: 1 hour after condition clears└── Example: 40% price move, >100% daily volumeLevel 3: Pause
Section titled “Level 3: Pause”Level 3 - PAUSE├── Trigger: Critical condition├── Actions:│ ├── Halt all trading (affected market)│ ├── Disable new positions│ ├── Allow exits only (if safe)│ └── War room activation├── Resolution: Manual review required└── Example: >50% oracle deviation, suspected exploitLevel 4: Emergency
Section titled “Level 4: Emergency”Level 4 - EMERGENCY├── Trigger: Platform-wide threat├── Actions:│ ├── Pause ALL contracts│ ├── Freeze withdrawals (review)│ ├── Enable emergency admin│ └── Full incident response├── Resolution: Board approval required└── Example: Confirmed exploit, regulatory actionImplementation
Section titled “Implementation”Automated Detection
Section titled “Automated Detection”// Circuit breaker check on every trademodifier circuitBreakerCheck(address warrant) { CircuitBreakerLevel level = checkCircuitBreaker(warrant);
require(level != CircuitBreakerLevel.PAUSE, "Trading paused"); require(level != CircuitBreakerLevel.EMERGENCY, "Emergency mode");
if (level == CircuitBreakerLevel.RESTRICTED) { applyRestrictedMode(warrant); }
_;}
function checkCircuitBreaker(address warrant) internal view returns (CircuitBreakerLevel) { uint256 oraclePrice = getOraclePrice(warrant); uint256 ammPrice = getAMMPrice(warrant); uint256 deviation = calculateDeviation(oraclePrice, ammPrice);
// Check deviation if (deviation > 50) return CircuitBreakerLevel.EMERGENCY; if (deviation > 30) return CircuitBreakerLevel.PAUSE; if (deviation > 20) return CircuitBreakerLevel.RESTRICTED; if (deviation > 10) return CircuitBreakerLevel.WARNING;
// Check price movement uint256 priceChange24h = getPriceChange24h(warrant); if (priceChange24h > 80) return CircuitBreakerLevel.PAUSE; if (priceChange24h > 50) return CircuitBreakerLevel.WARNING;
return CircuitBreakerLevel.NORMAL;}Manual Override
Section titled “Manual Override”// Emergency pause by authorized teamfunction emergencyPause(address warrant) external onlyPauseRole { require(hasRole(PAUSE_ROLE, msg.sender), "Not authorized");
paused[warrant] = true; emit EmergencyPause(warrant, msg.sender, block.timestamp);}
// Resume with timelockfunction requestResume(address warrant) external onlyPauseRole { require(paused[warrant], "Not paused");
resumeRequests[warrant] = block.timestamp + RESUME_DELAY; emit ResumeRequested(warrant, resumeRequests[warrant]);}
function executeResume(address warrant) external { require(block.timestamp >= resumeRequests[warrant], "Timelock active");
paused[warrant] = false; emit Resumed(warrant);}User Interface
Section titled “User Interface”Circuit Breaker Status
Section titled “Circuit Breaker Status”┌─────────────────────────────────────────────────────────────────┐│ ⚠️ TRADING RESTRICTED │├─────────────────────────────────────────────────────────────────┤│ ││ Circuit breaker activated for SPACEX-CALL-200B-Q42025 ││ ││ Status: LEVEL 2 - RESTRICTED ││ ││ Reason: ││ ├── AMM-Oracle deviation: 22% (threshold: 20%) ││ └── Triggered at: 2025-10-15 14:30:00 UTC ││ ││ Current Restrictions: ││ ├── Trading fee: 0.60% (2x normal) ││ ├── Position limits: 50% of normal ││ └── Enhanced confirmation required ││ ││ Trading is still available with restrictions. ││ ││ Expected Resolution: Auto-clear when deviation < 15% ││ ││ [View Market Status] [Set Alert] [Continue Trading] ││ │└─────────────────────────────────────────────────────────────────┘During Full Pause
Section titled “During Full Pause”┌─────────────────────────────────────────────────────────────────┐│ 🛑 TRADING PAUSED │├─────────────────────────────────────────────────────────────────┤│ ││ Trading is temporarily paused for SPACEX-CALL-200B-Q42025 ││ ││ Status: LEVEL 3 - PAUSE ││ ││ Reason: Oracle-AMM deviation exceeds safety threshold ││ Triggered: 2025-10-15 14:30:00 UTC ││ ││ Your Options: ││ ├── Existing positions are safe and protected ││ ├── No new trades can be executed ││ └── Withdrawals may be delayed ││ ││ We are investigating. Updates will be posted to: ││ ├── Status page: status.pipo.finance ││ ├── Twitter: @PIPOfinance ││ └── Discord: #announcements ││ ││ [View Status Page] [Contact Support] ││ │└─────────────────────────────────────────────────────────────────┘Recovery Process
Section titled “Recovery Process”Resume Checklist
Section titled “Resume Checklist”Circuit Breaker Resume Process:
Pre-Resume Checks:├── [ ] Root cause identified├── [ ] Trigger condition resolved├── [ ] Oracle functioning normally├── [ ] No ongoing manipulation detected├── [ ] Smart contract integrity verified└── [ ] Team sign-off (2+ members)
Resume Sequence:├── 1. Announce planned resume (15 min notice)├── 2. Enable warning mode first├── 3. Monitor for 30 minutes├── 4. If stable, reduce to normal├── 5. Post-incident report within 24 hoursHistorical Triggers
Section titled “Historical Triggers”Dashboard View
Section titled “Dashboard View”┌─────────────────────────────────────────────────────────────────┐│ CIRCUIT BREAKER HISTORY │├─────────────────────────────────────────────────────────────────┤│ ││ Last 30 Days: ││ ││ Date Time Market Level Duration Reason ││ ───────────────────────────────────────────────────────────── ││ 2025-10-10 14:30 SPACEX L2 45 min High volume ││ 2025-10-05 09:15 OPENAI L1 2 hours Price spike ││ 2025-09-28 16:00 ALL L3 3 hours Oracle down ││ ││ Statistics: ││ ├── Total triggers: 12 ││ ├── Level 3+ events: 1 ││ ├── Average duration: 1.2 hours ││ └── User impact: Minimal (all resolved) ││ ││ [Download Full Report] [Configure Alerts] ││ │└─────────────────────────────────────────────────────────────────┘API Reference
Section titled “API Reference”Get Circuit Breaker Status
Section titled “Get Circuit Breaker Status”const status = await pipo.getCircuitBreakerStatus('SPACEX-CALL-200B-Q42025');
// Response{ warrant: 'SPACEX-CALL-200B-Q42025', level: 'RESTRICTED', triggers: [ { type: 'ORACLE_DEVIATION', value: 22, threshold: 20, triggeredAt: '2025-10-15T14:30:00Z' } ], restrictions: { tradingEnabled: true, feeMultiplier: 2.0, positionLimitMultiplier: 0.5 }, estimatedResolution: '2025-10-15T16:00:00Z'}