The problem
When a DeFi exploit starts, humans react in minutes. The capital is gone in blocks.
What it is
Invariant-Bounded Escalation Architecture: a multi-tier defence system on Somnia that watches protocol TVL, validates threats with M-of-N consensus, and, when the threshold is crossed, moves funds cross-chain to pre-approved safe harbours, guarded by on-chain invariant checks.
How it flows
- 01DefiLlama TVL
- 02Reflex engine
- 03M-of-N gate
- 04ODIGGuard (5 invariants)
- 05LI.FI evacuation
What I built
Reflex engine
Node/Hono service polls DefiLlama TVL every 60 s and publishes over Redis pub/sub.
Consensus gate
M-of-N threat validation and tier classification before anything escalates.
ODIGGuard
Five invariant checks, atomically, right before execution; only SafeHarborRegistry destinations allowed.
Evacuation
A custom relayer routes funds cross-chain through LI.FI, streamed live to an SRO dashboard.
Stack
- Solidity
- Foundry
- Next.js 15
- Hono
- Redis
- PostgreSQL
- WebSockets
- LI.FI
- viem / wagmi
Limits
Runs on the Somnia Shannon testnet.