Platform

Overview

How It Works

Beneficiary Identity

Policy Corridors

Deterministic Finality

Architecture

Security Model

Governance

Integration

Solutions

Corridors Overview

Institutional Overview

Pricing

All Scenarios

Humanitarian Impact Fund

Assurance

Technical Assurance

Verify Receipt

Receipt Example

Developers

Documentation

APIs & Bridges

Architecture Docs

Glossary

BID API

Company

About

Team

Partners

Roadmap

Investors

Contact

Blog

All Documentation

Schedule Consultation
Thesis

Liquidity Risk Engine

Coordinated risk controls for institutional DeFi liquidity. Real-time pool health monitoring, concentration risk detection, impermanent loss mitigation, and adaptive circuit breakers for AMM v5 operations.

14/20 Validator Consensus
13 Jurisdictions
13 Compliance Zones
1.5s Block Time
Problem Statement

Liquidity is discontinuous, reflexive, and frequently adversarial. Every trading platform without a dedicated risk engine is one flash crash away from catastrophic failure.

Traditional DEX designs assume liquidity is always available and rational. Reality is harsher: liquidity is discontinuous, reflexive, and frequently adversarial. The 2022-2023 DeFi crises demonstrated that liquidity can evaporate within minutes, cascading across protocols and causing billions in losses. Without a dedicated risk engine, every trading platform is one flash crash away from catastrophic failure.

Risk Category Description Real-World Impact
Concentration RiskSmall number of LP positions or wallets dominate pool depthSingle LP exit can cause 80%+ slippage spike in seconds
Liquidity FlightLPs withdraw when volatility rises, causing sudden slippage cliffsReflexive: volatility causes withdrawals, which cause more volatility
Toxic FlowMEV bots, arbitrage dominance, and informed flow extract value from uninformed tradersEstimated $1.2B+ extracted annually from DEX users via sandwich attacks
Route FragilitySingle-venue execution fails when pools are stressed or fragmentedUsers face reverts, partial fills, and excessive slippage during stress events
Oracle ManipulationPrice feed attacks distort risk calculations and enable extractionManipulated oracles caused $200M+ in DeFi exploits in 2023 alone
Governance CaptureSingle entity or jurisdiction controls risk parametersCentralized admin keys exploited in multiple protocol compromises
The Fundamental Insight:

Liquidity risk is adversarial as often as it is natural. A risk engine must defend against intentional exploitation (MEV, oracle gaming, pool drain attacks) and natural market dynamics (volatility-driven LP flight, correlated stress events) simultaneously. JIL's engine addresses both through policy-bound controls and distributed governance.

Architecture

Explicitly modular. No single component has unilateral authority over execution decisions.

JIL's trading stack delivers liquidity risk as coordinated services and contracts, with each component serving a distinct role in the risk control chain.

Component Port Role in Liquidity Risk Control
liquidity-risk8898Concentration assessment, pool health scoring, threshold alerts
liquidity-analytics8903Real-time depth calculation, utilization rates, regime classification
settlement-router8081Multi-venue routing and execution orchestration
rfq-service8091Institutional OTC quotes when DEX execution is unsafe
ammv5-core(crate)AMM V5 execution features: batch auctions, TWAMM, slippage tolerance
oracle(contracts)Chainlink/Pyth price normalization for risk measures and USD conversions
corridor-governance(policy)Defines allowed venues, throttles, and fees per corridor

Data Flow Architecture

┌─────────────────────────────────────────────────────────────────┘ │ LIQUIDITY RISK ENGINE │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ ┌───────────┘ ┌───────────┘ ┌───────────┘ │ │ │ Oracles │ │Pool State │ │ LP Data │ │ │ │(Chainlink)│ │ (AMM V5) │ │(Positions)│ │ │ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │ │ └────────────────┴────────────────┘ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────┘ │ │ │ liquidity-analytics (8903) │ │ │ │ Depth calculation | Concentration | Regime class. │ │ │ └─────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌─────────────────────────────────────────────────────────┘ │ │ │ liquidity-risk (8898) │ │ │ │ Risk scoring | Threshold alerts | Policy recs │ │ │ └─────────────────────────────────────────────────────────┘ │ │ │ │ │ ┌────────────────┴────────────────┘ │ │ ▼ ▼ ▼ │ │ ┌───────────┘ ┌────────────┘ ┌────────────┘ │ │ │Settlement │ │RFQ Service │ │ Corridor │ │ │ │ Router │ │ (8091) │ │ Governance │ │ │ │ (8081) │ │ │ │ │ │ │ └───────────┘ └────────────┘ └────────────┘ │ │ │ ├─────────────────────────────────────────────────────────────────┤ │ VALIDATOR GOVERNANCE (14-of-20 across 13 jurisdictions) │ └─────────────────────────────────────────────────────────────────┘

Circuit Breaker Design

The engine implements a four-state machine that governs the entire trading stack. Transitions are triggered by measurable on-chain conditions, not human judgment. Each state progressively restricts execution to protect users during stress.

State AMM RFQ Batches Withdrawals Trigger
NORMALFullFullStandardInstantBaseline operations
ELEVATEDWider spreadsFullReduced capsInstantVolatility above 2-sigma
STRESSEDThrottledFirst priorityMinimalQueuedDepth below 30% of normal
HALTEDDisabledDisabledNoneGovernance required14-of-20 validator consensus
State Transition Flow:

NORMAL -> ELEVATED -> STRESSED -> HALTED. Resume follows the reverse path with graduated controls. The HALTED state can only be entered or exited via multi-sig governance action from the 14-of-20 validator set.

Risk Metrics & Measurements

Liquidity risk is not a single number. The engine maintains a real-time scorecard combining pool structure, market regime, and flow quality.

Each metric feeds into the regime classification system and determines whether the current execution environment is safe.

Metric Description Update Frequency
Depth and SlopeEffective liquidity at multiple price bands (+/- 1%, 2%, 5%, 10%)Per block (1.5s)
Concentration ScoreShare of liquidity controlled by top LP positions; the "exit risk" metricPer block (1.5s)
Utilization RateSwap volume vs available depth; how rapidly liquidity is being consumedRolling 5-minute window
Slippage AnalyticsObserved vs expected slippage per trade; symptom of poor depth and toxic flowPer transaction
Volatility RegimeNormal vs stressed classification using realized volatility bandsRolling 1-hour window
Withdrawal VelocityRate of LP position removal; early warning signal for liquidity flightRolling 15-minute window
Risk EnvelopesConservative bounds under tail moves used for gates and throttlesRecalculated hourly

Concentration Scoring

Concentration risk explains most sudden liquidity collapses. When a small number of LPs can withdraw, the pool's slippage surface changes abruptly and nonlinearly. The engine treats this as a measurable hazard and routes or throttles flow before the hazard expresses itself as user harm.

Herfindahl-Hirschman Index (HHI)

Sum of squared LP share percentages. HHI above 2500 triggers ELEVATED state and alerts for concentrated pools.

Top-N Exit Impact

Simulates the slippage impact if the top 3 or top 5 LPs withdraw simultaneously. Exceeding 15% impact triggers RFQ-first routing.

LP Tenure Weighting

Recently added liquidity is weighted higher in risk scoring since new LPs are statistically more likely to withdraw during stress.

Cross-Pool Correlation

Detects when the same LP addresses dominate multiple pools, indicating correlated withdrawal risk across the protocol.

Depth Profiling

The engine calculates effective depth at multiple price bands rather than relying on total value locked (TVL), which masks the distribution of liquidity across the price curve. A pool with $100M TVL concentrated in a narrow range is far more fragile than one with $50M distributed evenly.

Control Framework

Three authority levels. Increasing human involvement, decreasing response speed.

This layered model ensures that common conditions are handled instantly while extraordinary situations receive appropriate governance scrutiny.

Autonomous Controls (On-Ledger)

These controls execute automatically based on on-chain conditions. No human action is required and no human can prevent them from executing when conditions are met.

Oracle Band Enforcement

Trades are rejected if the execution price deviates beyond configurable bands from oracle-reported prices. Prevents stale oracle exploitation.

Batch Cap Limits

Maximum trade size per batch is automatically reduced as depth decreases. Prevents any single trade from consuming disproportionate depth.

Slippage Protection

Per-swap slippage tolerance enforced at the contract level. Users cannot be impacted beyond their stated tolerance regardless of market conditions.

State Transitions

Automatic escalation from NORMAL to ELEVATED to STRESSED based on real-time metric thresholds. No admin intervention needed.

Risk Engine Adaptive Controls

Signed, time-limited decisions from the risk engine that adapt to changing conditions. These controls have bounded authority and produce auditable decision records.

Control Authority Duration Audit Trail
Spread WideningRisk engine auto-signMax 4 hoursOn-chain epoch record
Venue ThrottlingRisk engine auto-signMax 2 hoursOn-chain epoch record
RFQ-First RoutingRisk engine auto-signMax 8 hoursOn-chain epoch record
Batch Size ReductionRisk engine auto-signMax 1 hourOn-chain epoch record

Human Governance Controls (Emergency)

Multi-signature actions requiring validator consensus. Used for extraordinary situations that cannot be handled by autonomous or adaptive controls.

🛑

HALT / Resume

14-of-20 multi-sig

🔓

Key Rotation

Guardian ceremony

Parameter Update

24-hour timelock

📈

Corridor Change

Validator consensus

Guardrails:

Controls MUST NOT confiscate user funds, retroactively reprice settled trades, censor transactions without producing auditable receipts, or exercise unbounded discretion. All emergency actions are time-bounded and require multi-jurisdictional validator approval.

Threat Model

Four categories of threats: extraction, griefing, Sybil attacks, and natural stress scenarios.

Liquidity risk is adversarial as often as it is natural. The engine must defend against intentional exploitation and natural market dynamics simultaneously.

Extraction Attacks

Attack Technique JIL Mitigation Result
Batch StuffingFill batch auction slots to exclude legitimate tradesVRF-randomized ordering within batches; priority fee auction for slot accessMITIGATED
Oracle GamingManipulate price feeds to distort risk calculationsMulti-oracle aggregation (Chainlink + Pyth); confidence weighting; staleness rejectionMITIGATED
Toxic FlowMEV extraction via sandwich attacks and frontrunningBatch auctions eliminate ordering advantage; commit-reveal for transaction privacyMITIGATED
Inventory SkewForce AMM into extreme price ranges to exploit rebalancingConcentration detection triggers TWAMM routing; maximum position limits per addressMITIGATED

Griefing Attacks

Attack Technique JIL Mitigation
RFQ SprayingSend thousands of quote requests with no intent to executeRate limiting per BPoH identity; reputation scoring for market makers
Order/Cancel StormsRapidly place and cancel orders to consume system resourcesMinimum order TTL; cancellation fee above threshold frequency
Settlement FailuresIntentionally fail settlement to disrupt counterpartiesEscrow-first execution; settlement bonds; failure penalty escalation
Circuit Breaker AbuseDeliberately trigger STRESSED state to halt tradingMulti-metric triggers (no single vector can force state change); hysteresis on transitions

Sybil and Stress Scenarios

Sybil Cluster Detection

Related wallets identified through on-chain graph analysis are treated as a single entity for concentration scoring. Prevents LP fragmentation from gaming the HHI metric.

Withdrawal Stampedes

When withdrawal velocity exceeds 3-sigma of normal, the engine activates queued withdrawals with proportional allocation to prevent first-mover advantage.

Pool Drain Dynamics

Concentration assessment detects when a small LP set can remove most depth quickly. Automatic corridor containment activates before the drain completes.

Contagion Prevention

Failures in one venue or pool are isolated. The routing and corridor containment layers prevent cascading failures across the protocol.

AMM V5 Integration

Mechanisms specifically aligned with stress resilience and execution integrity.

Each AMM V5 feature directly reduces a class of risk that the engine monitors and controls.

Feature Mechanism Risk Reduction
Constant Product (x*y=k)Predictable base curve for depth and impact modelingEnables precise slippage prediction and risk envelope calculation
Batch AuctionsVRF-randomized ordering within auction windowsEliminates MEV extraction during congested or volatile periods
TWAMMTime-weighted average market maker for large ordersReduces instantaneous impact; spreads execution across multiple blocks
ERC-4626 VaultsStandardized LP accounting with share-based positionsCleaner analytics, attribution, and reporting for risk decisions
Per-Swap Slippage ProtectionHard revert if price impact exceeds user-specified toleranceAbsolute user protection against pathological price impact events

Batch Auction Risk Properties

Batch auctions are the primary defense against MEV extraction. By collecting trades within a time window and executing them at a uniform clearing price with VRF-randomized ordering, the engine eliminates the ordering advantage that enables sandwich attacks, frontrunning, and backrunning.

VRF Randomization:

Each batch auction uses a Verifiable Random Function to determine execution order within the batch. This means no participant, including validators, can predict or manipulate the ordering of trades within a batch. Combined with commit-reveal transaction submission, this provides strong MEV resistance.

TWAMM for Institutional Orders

Time-Weighted Average Market Maker execution splits large orders across multiple blocks, reducing the instantaneous price impact that makes large trades targets for extraction. The settlement router automatically routes institutional-size orders to TWAMM when the risk engine determines that single-block execution would create damaging impact.

ERC-4626 Vault Accounting

Standardized vault accounting enables the risk engine to monitor LP positions with precision. Share-based accounting eliminates the complexity of tracking individual LP ranges and provides clean inputs for concentration scoring, withdrawal velocity tracking, and exit impact simulation.

Corridor Governance

Execution rules for the entire trading stack. Risk posture cannot be silently weakened.

Each corridor specifies allowed venues, fee structures, throttle limits, and escalation conditions. Corridor changes follow a ceremony flow with validator consensus and a timelock.

Corridor Venues Allowed Fee Throttle Use Case
defaultDEX + RFQ2 bps6,000/minNormal operations, all users
protectedRFQ only5 bps3,000/minProtected zone accounts (KYC verified)
unprotectedDEX only2 bps6,000/minPermissionless retail
containmentLifeline only25 bps60/minEmergency mode, settlement only

Governance Ceremony Flow

Any change to corridor policies must traverse a multi-step ceremony that prevents unilateral modification of risk parameters.

START (Admin initiates corridor change) | APPROVE (Guardian multi-sig: 2-of-3) | TIMELOCK (24-hour hold) | FINALIZE (Corridor policy published) | LEDGER BINDING (Proof ledger epoch created)

Distributed Governance

Governance Aspect Value
Validator Count20
Jurisdictions13 (CH, ADGM, SG, USA, EU, UK, CA, JP, AU, LATAM, BR, HK, NL)
Consensus Threshold14-of-20 (70% BFT)
Corridor ChangesRequire validator consensus + 24-hour timelock
Emergency ActionsMulti-sig with geographic distribution
Timelock Duration24 hours for policy changes, immediate for HALT only
Anti-Capture Design:

Distributing the validator set across 13 jurisdictions means no single regulator, government, or corporate entity can compel a corridor change. The 14-of-20 threshold (70% BFT) ensures that even if 6 validators in coordinated jurisdictions are compromised or coerced, the remaining 14 maintain governance integrity.

Settlement Router

The execution interface that incorporates risk signals before committing trades.

The Settlement Router operates as the enforcement point for all risk engine decisions, corridor policies, and venue steering logic.

API Surface

POST /route # Get optimal route based on risk-adjusted execution POST /execute # Execute settlement after route approval GET /quote # Get price quote with embedded risk metrics

Risk-Aware Routing Capabilities

Venue Selection

Prefer venue with best risk-adjusted execution: lowest impact per unit size, factoring in depth, concentration, and current regime state.

Order Splitting

Split orders using TWAMM or batch auctions when size would create damaging market impact. Splitting parameters are determined by real-time depth analysis.

RFQ Escalation

Route institutional-size orders to RFQ when pool depth is unsafe or concentrated. Market makers provide firm quotes with execution guarantees.

Trade Rejection

Reject or delay trades that violate corridor throttles, slippage tolerances, or would push the pool into an unsafe state. Provides clear reason codes.

Failure Modes

Failure Mode Detection Response
Venue UnreachableHealth check timeout (>500ms)Automatic failover to next venue in corridor priority list
Insufficient DepthSimulated impact exceeds toleranceRoute to RFQ or queue for TWAMM execution
Oracle StalePrice feed age exceeds 60 secondsReject new trades; allow withdrawals at last known price
Settlement TimeoutNo confirmation within 30 secondsAutomatic retry with exponential backoff; DLQ after 3 failures
Corridor ExhaustedThrottle limit reachedQueue with priority ordering; clear reason code to user

Multi-Venue Execution

The router maintains live connections to all venues authorized within the active corridor. Venue health is monitored continuously, and the routing table updates in real time based on depth availability, concentration scores, and latency measurements. This ensures that no single venue failure can disrupt execution for the entire protocol.

P2P Settlement:

Each validator node processes settlements for its authorized compliance zones via RedPanda message queues. Zone-specific topics (e.g., jil.settlement.DE_BAFIN, jil.settlement.SG_MAS) ensure that settlement messages are consumed only by validators authorized for that jurisdiction, maintaining regulatory compliance at the infrastructure level.

Implementation Roadmap

From foundation to production hardening in four phases.

Phase 1 - Foundation (Months 1-3)

Deploy liquidity-analytics and liquidity-risk services. Implement depth profiling, concentration scoring, and basic regime classification. Integrate with AMM V5 batch auctions. TestNet validation across 5 Hetzner nodes.

Phase 2 - Venue Steering (Months 4-6)

Settlement router integration with risk-aware routing. RFQ escalation logic. Corridor policy enforcement. TWAMM routing for institutional orders. Multi-oracle aggregation with confidence weighting.

Phase 3 - Governance Layer (Months 7-9)

14-of-20 validator governance for corridor changes. 24-hour timelock ceremony flow. Emergency HALT/resume with geographic distribution. Audit trail with on-chain epoch records.

Phase 4 - Production Hardening (Months 10-12)

MainNet deployment across 20 validators in 13 jurisdictions. Sybil cluster detection. Cross-pool correlation monitoring. Withdrawal stampede protection. Full P2P settlement via RedPanda zone topics.

Key Milestones

  • Complete liquidity-risk service deployment with concentration scoring, HHI calculation, and top-N exit impact simulation across all active pools.
  • Integrate settlement router with risk engine for real-time venue steering based on depth, concentration, and regime classification signals.
  • Deploy corridor governance ceremony with 14-of-20 validator consensus, 24-hour timelock, and on-chain epoch binding.
  • Validate circuit breaker state machine through chaos engineering across TestNet, including simulated flash crashes, LP withdrawal stampedes, and oracle failures.
  • Achieve MainNet readiness with 20 validators across 13 jurisdictions processing zone-authorized settlements via P2P RedPanda architecture.
Institutional DeFi Infrastructure

Coordinated risk controls for institutional-grade liquidity.

JIL Sovereign's Liquidity Risk Engine delivers real-time pool health monitoring, adaptive circuit breakers, and distributed governance across 13 jurisdictions - purpose-built for institutional AMM operations.