All Case Studies

03 / CASE STUDY · SOMNIA · DREAMDEX CLOB · ERC-6909 · ATOMIC ROUTING

Divergence Router

Human-centric divergence detection & atomic multi-leg execution on Somnia.

Divergence Router product interface
≤ 0.50%SAFE DIVERGENCE FLOOR (τ_safe)

When D_t ≤ 0.005, the router enforces passive PostOnly maker placement on DreamDEX to capture fee rebates and avoid taker penalties.

≥ 3.00%CIRCUIT BREAKER CEILING (τ_max)

When D_t ≥ 0.030, the autonomous circuit breaker halts execution to shield the trader’s balance sheet from flash crashes or manipulated books.

< 380msSOMNIA TELEMETRY CADENCE

Continuous JSON-RPC WebSocket stream ingesting newHeads and pool logs with off-chain pre-flight simulation before transactions touch the mempool.

100% AtomicZERO LEGGING-IN EXPOSURE

Both legs of a BTC/ETH or 15m/1h Divergence Split mint sequentially in a single EVM transaction or revert completely with 100% tUSDC refund.

ClientSomnia × DreamDEX Ecosystem
RuntimeSomnia Shannon Testnet (Chain ID 50312 · Sub-380ms)
ReleaseLive on Somnia Shannon · DreamDEX Integrated
On-Chain ArtifactDivergen....55b9)
02 / EXECUTIVE THESIS

Designing for the real constraint.

Every architectural decision begins by isolating the structural failure modes of existing solutions and engineering directly against them.

01 / THE PROBLEM

Vulnerability & Friction Surface

Sub-second on-chain Central Limit Order Books (CLOBs) on high-throughput L1s like Somnia have widened the structural gulf between automated latency bots and human traders. Manual participants on DreamDEX face four compounding failure modes: toxic slippage during order-book dislocations, abrupt PostOnlyWouldCross reverts that burn gas without filling intent, fatal "legging-in" exposure when pairing multi-asset (BTC/ETH) or cross-cadence (15m/1h) binary contracts, and acute cognitive overload from flashing tick matrices.

02 / OUR APPROACH

Protocol & Product Strategy

Engineered by blockchain architect Rythme Nagrani (rythmern02), Divergence Router inserts a non-custodial computational buffer and atomic proxy between human intent and DreamDEX on Somnia. The engine continuously evaluates real-time price divergence (D_t) across three defensive regimes (≤0.50% Equilibrium, 0.50%–3.00% Dislocation, >3.00% Halt), wraps passive PostOnly maker orders in an automatic Immediate-Or-Cancel (IOC) failover state machine, and executes dual-leg splits inside a single atomic EVM transaction.

03 / DELIVERED

Shipped Production System

A stateless 1-click execution router (DivergenceRouter.sol at 0xdAf7...875F) integrated with DreamDEX’s BinaryMarketsModule, OutcomeToken6909 (ERC-6909), and BinarySettlement contracts on Somnia Shannon (Chain ID 50312), paired with a calm execution terminal featuring <380ms WebSocket block streaming, a 2D Strategy Matrix, a mandatory 4-Quadrant Payoff Matrix, and a Chaos Starved-Book Simulator.

SYSTEM ARCHITECTURE

Sub-second divergence detection & atomic routing.

Hover any node for technical detail
01Somnia Stream<380ms Block Feed
02Divergence Engine3-Tier Classifier
03Crossing FailoverPostOnly → IOC
04DivergenceRouterAtomic Split Proxy
05DreamDEX CLOBERC-6909 Settlement
VERIFICATION LOOP

All-or-nothing EVM rollback guarantees 100% tUSDC refund if either binary leg breaches minFillAmount.

TECHNICAL ARCHITECTURE & PROOF

Architecture & verification.

Explore the defense-in-depth matrix, formal cryptographic equations, end-to-end execution trace, and systems engineering trade-offs.

03 / DIVERGENCE DETECTION & EXECUTION REGIMES

Absorbing microstructure volatility at the routing layer.

Divergence Router continuously evaluates the scalar dislocation D_t = |P_local − P_benchmark| / P_benchmark prior to dispatch, dynamically routing orders across three protective regimes and an atomic multi-leg settlement guard.

LAYER 01

Equilibrium Regime: Passive Maker Rebate Capture (D_t ≤ 0.50%)

PostOnly Maker Placement · DreamDEX CLOB
THREAT ELIMINATED (AUTOMATED ROUTER DEFENSE)

Routes the trade as a passive PostOnly maker order, capturing exchange fee rebates and securing price improvement without adverse selection.

IF OMITTED (MARKET FAILURE VECTOR)

Naive market orders pay unnecessary taker fees and suffer spread-crossing costs despite tight order-book equilibrium.

LAYER 02

Dislocation Regime: Adaptive IOC Failover (0.50% < D_t ≤ 3.00%)

PostOnly → Immediate-Or-Cancel (IOC) State Machine
THREAT ELIMINATED (AUTOMATED ROUTER DEFENSE)

Client-side middleware intercepts spread-crossing conditions and seamlessly transitions to a bounded IOC crossing order strictly within pre-authorized slippage limits.

IF OMITTED (MARKET FAILURE VECTOR)

A passive order that crosses a shifting spread reverts with PostOnlyWouldCross, burning gas and leaving trader intent unfulfilled.

LAYER 03

Anomalous Regime: Autonomous Circuit Breaker (D_t > 3.00%)

Pre-Flight Simulation Guard · Hard Execution Halt
THREAT ELIMINATED (AUTOMATED ROUTER DEFENSE)

Engages an immediate pre-flight circuit breaker that blocks transaction broadcast and surfaces a clear visual dislocation rationale in the terminal.

IF OMITTED (MARKET FAILURE VECTOR)

Acute liquidity vacuums, oracle lag, or predatory book sweeping during breaking news expose manual traders to catastrophic slippage.

LAYER 04

Multi-Leg Atomic Regime: Sequential Split Enforcer

DivergenceRouter.sol (0xdAf785...875F) · openSplit()
THREAT ELIMINATED (AUTOMATED ROUTER DEFENSE)

Executes Leg A and Leg B complete-set mints atomically in one transaction; if either leg breaches minFillAmount, EVM rollback refunds 100% of tUSDC.

IF OMITTED (MARKET FAILURE VECTOR)

Executing multi-asset (BTC/ETH) or cross-cadence (15m/1h) hedges in separate transactions strands traders with naked 1-leg exposure if Leg B slips.

HAVE A RELATED CHALLENGE?

Let's make
it ship.

Whether you are architecting zero-knowledge circuits, formally verified DeFi primitives, or a 250-builder ecosystem hackathon, you work directly with our founders and senior engineers.