01Executive Summary
JIL Sovereign's execution router evaluates every trading entity across five dimensions of toxicity to detect and mitigate adverse selection in real-time. The scoring model measures trader edge relative to mid-market price, historical win rate, directional flow bias, inventory skew impact, and LP spread capture rate. Each dimension contributes to a composite toxicity score that determines the entity's enforcement tier.
Graduated enforcement ensures proportional response: low-toxicity entities experience wider spreads, medium-toxicity entities face reduced position sizes, high-toxicity entities are restricted to RFQ-only with deposit requirements, and critical-toxicity entities are blocked entirely. Critically, the system includes Sybil cluster detection that identifies correlated wallets and treats them as a single entity for scoring purposes, preventing adversaries from fragmenting toxic flow across multiple addresses.
02Problem Statement
Liquidity providers on decentralized exchanges face systematic losses from informed traders who exploit information asymmetry. These traders consistently trade ahead of price movements, extracting value from LPs through adverse selection. The problem is compounded by Sybil attacks where a single entity operates dozens of wallets to circumvent per-wallet protections.
2.1 Adverse Selection Attack Patterns
- Informed Trading: Entities with access to faster information sources (CEX prices, mempool data, oracle updates) consistently trade before price movements, causing LPs to fill at stale prices.
- One-Way Flow: Toxic entities exhibit strong directional bias - they predominantly buy before upward moves and sell before downward moves, extracting maximum LP value.
- Sybil Fragmentation: To avoid detection thresholds, toxic entities split their activity across multiple wallets, each appearing benign individually but collectively generating significant toxic flow.
- Inventory Manipulation: Coordinated trading across multiple pairs to skew LP inventory in unfavorable directions, amplifying LP losses across the portfolio.
2.2 Why Existing Approaches Fail
| Approach | Detection Method | Sybil Resistance | Limitation |
|---|---|---|---|
| Uniswap v3 Fees | None - uniform fees | None | No toxic flow detection at all |
| Volume-Based Tiers | High volume = suspicious | None | Penalizes legitimate large traders |
| IP/KYC Blocking | Identity-based | Partial | VPN/multi-identity easily bypasses |
| Time-Decay Scoring | Recent trade performance | None | Wallet rotation resets scores |
03Technical Architecture
The toxicity scoring system operates in three layers: per-wallet metric collection, Sybil cluster aggregation, and entity-level enforcement. All five scoring dimensions are computed at the entity level after cluster aggregation.
3.1 Five Scoring Dimensions
| Dimension | Metric | Measurement | Weight |
|---|---|---|---|
| Edge vs Mid-Market | Average profit per trade relative to mid-market price at fill time | bps of consistent edge above random | 30% |
| Win Rate | Percentage of trades that are profitable within a short evaluation window | % above 50% baseline | 20% |
| One-Way Flow Ratio | Ratio of directional (single-side) volume to total volume | 0 to 1 (1 = entirely one-directional) | 20% |
| Inventory Skew Trend | Cumulative impact on LP inventory across all trades | Net directional imbalance caused | 15% |
| LP Spread Capture | Frequency of filling at the edge of LP spreads | % of trades at spread boundary | 15% |
3.2 Enforcement Tiers
| Tier | Score Range | Action | Impact on Entity |
|---|---|---|---|
| Low | 0 - 25 | Spread widening | Wider quoted spreads for this entity |
| Medium | 26 - 50 | Size reduction | Maximum order size capped |
| High | 51 - 75 | RFQ-only with deposit | Must post collateral, no retail lane |
| Critical | 76 - 100 | Blocking | All orders rejected |
3.3 Sybil Cluster Detection
The cluster detection algorithm identifies correlated wallets using four signals: temporal correlation (wallets that submit orders within narrow time windows), directional correlation (wallets that consistently trade in the same direction), funding chain analysis (wallets funded from common sources), and behavioral fingerprinting (wallets exhibiting identical order size patterns). Wallets identified as belonging to the same cluster are merged into a single entity, and their aggregate activity is scored as one.
04Implementation
4.1 Scoring Pipeline
- Trade ingestion: Every completed fill is recorded with the entity ID (post-cluster aggregation), direction, size, fill price, mid-market price at fill time, and timestamp.
- Window calculation: Scoring metrics are computed over a rolling window (default 7 days) using exponential decay weighting so that recent activity has more influence than older trades.
- Dimension scoring: Each of the five dimensions is scored independently on a 0 to 100 scale based on how far the entity's behavior deviates from the baseline (random trading) distribution.
- Composite score: The weighted sum of all five dimension scores produces the composite toxicity score (0 to 100).
- Tier assignment: The composite score determines the enforcement tier, which is cached and applied to all subsequent orders from any wallet in the entity's cluster.
4.2 Cluster Aggregation
When a new wallet is detected as part of an existing cluster, its historical trades are retroactively attributed to the cluster entity. The entity's toxicity score is recalculated with the merged data, which may cause an immediate tier change. This retroactive attribution prevents the "clean wallet" evasion where an adversary creates a new wallet to reset their score while continuing the same toxic strategy.
4.3 Appeal Mechanism
Entities flagged at HIGH or CRITICAL tiers can submit an appeal through the dispute resolution service. Appeals are reviewed against the scoring evidence, and if the entity can demonstrate that the scoring was based on legitimate market-making activity rather than adverse selection, the score can be adjusted manually by governance.
05Integration with JIL Ecosystem
5.1 Execution Router
The execution router checks the entity's toxicity tier before routing any trade intent. HIGH toxicity entities are forced to the RFQ lane with deposit requirements. CRITICAL entities are rejected outright. The toxicity check is one of the seven-rule precedence chain evaluated for every trade.
5.2 Market State Interaction
During STRESSED market state, toxicity enforcement is tightened: the threshold for HIGH tier drops from 51 to 40, and the threshold for CRITICAL drops from 76 to 60. This provides additional protection during volatile conditions when toxic flow is most damaging to LPs.
5.3 Compliance Integration
Toxicity scores are available to the compliance-api for regulatory reporting. Entities flagged as CRITICAL may trigger enhanced KYC reviews under the compliance zone's AML policies. The scoring data provides regulators with quantitative evidence of market manipulation patterns.
5.4 LP Protection Metrics
Liquidity providers can view aggregate toxicity statistics for the pools they participate in, including the distribution of flow by toxicity tier, the estimated adverse selection cost per period, and the effectiveness of enforcement actions in reducing toxic flow.
06Prior Art Differentiation
| System | Scoring Model | Sybil Detection | Enforcement | JIL Advantage |
|---|---|---|---|---|
| Uniswap v3 | None | None | None | JIL scores all entities across 5 dimensions |
| dYdX Liquidation | Position-based risk | None | Liquidation only | JIL detects adverse selection patterns, not just risk |
| CowSwap Solver | Solver reputation | None | Solver exclusion | JIL scores traders, not just solvers |
| TradFi Market Maker | Counterparty scoring | KYC-based | Spread widening | JIL adds on-chain cluster detection without KYC |
| Chainlink CCIP | N/A (messaging) | N/A | N/A | JIL applies toxicity to trading, not messaging |
07Implementation Roadmap
Core Scoring Engine
Deploy five-dimension scoring model with rolling window calculation. Implement composite score computation and tier assignment. Build enforcement hooks in execution router. Create scoring dashboard for LP visibility.
Sybil Cluster Detection
Deploy temporal and directional correlation analysis. Implement funding chain graph analysis. Build behavioral fingerprinting for order pattern matching. Retroactive cluster attribution with score recalculation.
Adaptive Scoring
Machine learning calibration of dimension weights based on LP loss data. Market-state-dependent threshold adjustment. Cross-pair toxicity correlation. Appeal workflow integration with governance.
Advanced Detection
Cross-chain entity tracking for multi-chain Sybil clusters. Predictive toxicity scoring using order intent analysis. Real-time cluster expansion detection. Research into privacy-preserving scoring with ZK proofs.