Stablecoin Depeg Monitor
Monitor stablecoin pegs in real time. Detect deviations from $1.00 across major DEX and CEX venues, get alerts on depeg events, and analyze historical stability for risk decisions.
When to use
- User asks "is USDT depegged" or "monitor stablecoin prices"
- Building a DeFi treasury or risk dashboard
- Watching for stablecoin stress events (USDC March 2023 style)
- Hunting arbitrage between depegged stables and the peg
- Tracking historical peg stability for due diligence
Commands
python3 scripts/depeg_monitor.py check # Check all major stables vs $1
python3 scripts/depeg_monitor.py check USDT # Check specific stable
python3 scripts/depeg_monitor.py watch # Stream live updates (60s polling)
python3 scripts/depeg_monitor.py history USDC # Historical stability record
python3 scripts/depeg_monitor.py arb # Find active arbitrage opportunities
Output
Returns JSON with: stable, mid_price, deviation_bps, venues (per-exchange price), liquidity (USD depth at ±1% band), status (PEGGED, WOBBLE, DEPEG), and timestamp.
Environment
STABLECOIN_THRESHOLD_BPS- Alert threshold in basis points (default: 50 = 0.5%)STABLECOIN_POLL_INTERVAL- Watch mode seconds (default: 60)- Works offline with mock data; production connects to Curve subgraph, Binance, Coinbase public APIs
