Home
Learn

How It Works

Tokenomics

Roadmap

Humanitarian Impact Fund

FAQ

Products

Wallet

DEX

LaunchPad

Token Factory

Vaults

Company

About

Contact

Buy JIL
← Back to Patent Claims
Patent Claim 36 All Patents →

State-Aware Trade Routing

Multi-Factor Lane Selection with Fee Differentiation

Patent Claim JIL Sovereign February 2026 Claim 36 of 36

01Executive Summary

JIL Sovereign's execution router evaluates every trade intent against a seven-rule precedence chain that considers the current market state, entity toxicity score, order size, and entity-specific routing preferences to determine whether the intent should be executed via the retail batch auction lane or the request-for-quote (RFQ) lane. Each lane has distinct fee structures, execution mechanics, and risk profiles.

The routing decision is deterministic and transparent: the same inputs always produce the same routing decision, and the specific rule that determined the routing is logged with every intent. The router fetches the current market state from the market-state service with a 2-second timeout and fails open to NORMAL, ensuring that routing continues even if the state service is temporarily unavailable.

Core Innovation: A deterministic seven-rule precedence chain that integrates market state awareness, entity-level toxicity scoring, and order characteristics into a single routing decision. Unlike traditional exchanges where routing is static or manual, JIL's router adapts in real-time to changing market conditions while providing transparent, auditable routing decisions for every trade.

02Problem Statement

Decentralized exchanges typically offer a single execution venue - a constant-product AMM pool - with no ability to route orders to different execution mechanisms based on market conditions, order characteristics, or entity risk profiles. This one-size-fits-all approach means that large institutional orders, small retail trades, and toxic flow all execute through the same mechanism, leading to suboptimal outcomes for all participants.

2.1 Routing Challenges

  • Size Mismatch: Large orders create excessive slippage in AMM pools designed for retail-sized trades, while RFQ mechanisms are too heavyweight for small orders.
  • Market Conditions: During stressed market conditions, AMM pools may have insufficient liquidity, and routing all flow through them amplifies price impact. RFQ provides better execution during stress.
  • Toxic Flow: Routing informed traders through the same pool as retail traders causes systematic LP losses. Toxic flow should be segregated to venues where market makers can price it appropriately.
  • Fee Transparency: Different execution venues have different cost structures, but users often cannot see or compare fees before execution.

2.2 Why Existing Approaches Fail

ApproachRouting LogicState AwarenessLimitation
Uniswap (Single Pool)None - all flow to poolNoneNo routing at all
1inch AggregatorBest price across venuesNonePrice-only, no state/toxicity factors
CoW ProtocolSolver competitionLimitedSolver chooses, not protocol
Hashflow RFQAll flow to market makersNoneNo retail lane option
The Gap: No production DEX implements a multi-factor routing engine that considers market state, entity toxicity, order size, and entity preferences in a deterministic precedence chain with differentiated fee structures per execution lane. JIL's execution router is the first to provide intelligent, state-aware trade routing as a protocol-level service.

03Technical Architecture

The execution router processes each trade intent through a seven-rule precedence chain. Rules are evaluated in strict order, and the first matching rule determines the routing decision. This precedence ensures that safety rules (HALTED, BLOCKED) always take priority over economic rules (size, preferences).

3.1 Seven-Rule Precedence Chain

PriorityRuleConditionActionRationale
1HALTEDMarket state = HALTEDREJECTNo trading during market halt
2BLOCKEDEntity toxicity = CRITICALREJECTBlocked entities cannot trade
3SIZEOrder size >= RFQ minimumRFQLarge orders get better execution via RFQ
4STRESSEDMarket state = STRESSEDRFQRFQ-first during market stress
5HEAVYEntity toxicity = HIGHRFQ + depositToxic flow segregated with collateral
6RFQ_PRIORITYEntity prefers RFQRFQRespect institutional routing preference
7DEFAULTNo prior rule matchedRETAILStandard retail batch auction

3.2 Fee Structure by Lane

Fee ComponentRetail LaneRFQ LaneDescription
DEX Fee (Buyer)1.00%1.00%Standard buyer-side trading fee
DEX Fee (Seller)1.00%1.00%Standard seller-side trading fee
Settlement Fee4 bps4 bpsSettlement processing cost
RFQ Routing FeeN/A10 bpsAdditional fee for RFQ lane access
Total (Buyer)1.04%1.14%All-in buyer cost
Total (Seller)1.04%1.14%All-in seller cost

3.3 Fail-Open Market State Fetch

The router fetches the current market state via HTTP with a strict 2-second timeout. If the market-state service is unreachable or does not respond within 2 seconds, the router defaults to NORMAL state and continues routing. This fail-open design ensures that a market-state outage never halts trading. The fallback is logged for monitoring, and the AI Fleet Inspector tracks market-state availability separately.

04Implementation

4.1 Preview vs Execute

The router exposes two endpoints: POST /v1/router/preview and POST /v1/router/execute. The preview endpoint evaluates the routing rules and returns the routing decision, fees, and the specific rule that determined the routing without recording anything to the database. This allows users to see their routing and fees before committing. The execute endpoint performs the same evaluation and additionally records the intent in the router_intents table.

4.2 Routing Decision Record

Every executed routing decision is recorded with: the intent ID, entity ID, market state at decision time, toxicity tier, order size, the matching rule number and name, the resulting lane (RETAIL/RFQ/REJECT), calculated fees, and timestamp. This comprehensive audit trail enables post-hoc analysis of routing quality and fairness.

4.3 Per-Pair Configuration

Routing parameters are configurable per trading pair via the router_config table. Each pair can have different RFQ minimum size thresholds, different fee rates, and different toxicity-dependent routing rules. Pre-seeded configurations cover JIL/USDC, JIL/ETH, jBTC/jUSDC, and jETH/jUSDC.

4.4 Intent Lifecycle

After routing, intents follow the lifecycle: PENDING (recorded by router) to ROUTED (sent to the target lane) to FILLED, PARTIALLY_FILLED, or REJECTED (by the clearing engine). The router tracks the intent through its lifecycle via status callbacks from the retail lane engine or RFQ service.

05Integration with JIL Ecosystem

5.1 Market State Service (Claim 30)

The router depends on the hysteresis market state machine for real-time state information. HALTED and STRESSED states directly affect routing decisions through rules 1 and 4 of the precedence chain. The fail-open fallback to NORMAL ensures that market-state outages do not cascade to routing failures.

5.2 Entity Toxicity Scoring (Claim 33)

The router fetches the entity's toxicity tier from the scoring engine. CRITICAL toxicity triggers rule 2 (BLOCKED), HIGH toxicity triggers rule 5 (HEAVY - RFQ with deposit). Toxicity scoring and routing work together as a graduated defense system: the scoring engine classifies entities, and the router enforces the classification.

5.3 Retail Lane Engine (Claim 31/32)

Intents routed to the RETAIL lane are submitted to the retail lane engine's batch auction queue. They participate in VRF-shuffled batch clearing with iterative price discovery. The retail lane is the default for most retail-sized orders from non-toxic entities.

5.4 RFQ Service

Intents routed to the RFQ lane are forwarded to registered market makers for competitive quoting. Market makers return firm quotes that the entity can accept or reject. The 10 bps additional routing fee compensates for the operational overhead of the RFQ matching process.

Transparent Routing: Every routing decision is deterministic and logged. Users can preview their routing before execution, see exactly which rule determined their lane, and compare fees across lanes. This transparency is a fundamental requirement for institutional adoption - fund managers need to demonstrate best execution to their stakeholders, and the routing audit trail provides the evidence.

06Prior Art Differentiation

SystemRouting ModelState AwarenessToxicity IntegrationJIL Advantage
Uniswap v3No routing - single poolNoneNoneJIL routes to optimal lane per intent
1inchBest-price aggregationNoneNoneJIL considers state + toxicity, not just price
ParaswapMulti-DEX splittingNoneNoneJIL routes to distinct execution mechanisms
CoW ProtocolSolver decides routingIndirectNoneJIL uses deterministic protocol-level rules
Wintermute RFQAll flow to market makerNoneNoneJIL offers both retail and RFQ with smart routing
Key Differentiator: JIL Sovereign is the first DEX to implement a deterministic, multi-factor routing engine with a strict precedence chain that integrates real-time market state, entity-level toxicity scoring, order size thresholds, and entity preferences into a single routing decision with differentiated fee structures per execution lane. Every routing decision is auditable, previewable, and reproducible.

07Implementation Roadmap

Phase 1
Months 1 - 3

Core Router

Deploy seven-rule precedence chain with market state integration. Implement preview and execute endpoints. Build per-pair configuration with pre-seeded trading pairs. Create intent lifecycle tracking with status callbacks.

Phase 2
Months 4 - 6

Toxicity Integration

Wire entity toxicity scoring into rules 2 and 5. Implement deposit requirement for HIGH toxicity RFQ routing. Build routing analytics dashboard showing lane distribution by toxicity tier. Calibrate toxicity thresholds for routing decisions.

Phase 3
Months 7 - 9

Advanced Lane Selection

Dynamic RFQ minimum size based on market conditions. Multi-lane splitting for very large orders (partial retail + partial RFQ). Cross-pair routing optimization for multi-leg trades. Latency optimization for routing decision path.

Phase 4
Months 10 - 12

Best Execution Proof

On-chain routing decision proofs for regulatory compliance. Post-trade analysis comparing actual vs. alternative lane outcomes. Best execution reports for institutional clients. Third-party audit of routing fairness and determinism.

08Patent Claim

Claim 36: A system for routing trade intents to differentiated execution lanes on a decentralized exchange, comprising: a deterministic seven-rule precedence chain evaluated in strict order for each trade intent, wherein the first matching rule determines the routing decision; rules incorporating the current market operating state from a hysteresis state machine, the entity's toxicity score from a multi-dimensional scoring model, the order size relative to a configurable minimum threshold, and entity-specific routing preferences; two distinct execution lanes comprising a retail batch auction lane with VRF-shuffled clearing and a request-for-quote lane with competitive market maker quoting; differentiated fee structures per lane wherein the retail lane charges a base trading fee plus settlement fee and the RFQ lane charges the same plus an additional routing fee; a fail-open market state fetch with a configurable timeout that defaults to the least restrictive state if the market state service is unavailable; preview functionality enabling users to see the routing decision and applicable fees before committing to execution; and comprehensive audit logging recording the matching rule, lane decision, fees, and market conditions for every routed intent.