When JIT Routing Is Used
JIT routing engages automatically when the router determines it is optimal.Execution Flow
- Quote time (offchain)
- DFlow computes an optimal route using current market data.
- The route may include prop AMMs and fallback venues.
- Transaction construction
- The transaction embeds conditional instructions.
- These instructions allow branching between liquidity sources.
- Execution time (onchain)
- Before executing, the program checks the current onchain price.
- If the price is within acceptable bounds, the original leg is executed.
- If the price has moved beyond a threshold, the router switches to an alternative venue.
- All decisions occur within the same transaction.
Key Properties
- Onchain decision making Routing decisions are made by the program during execution, not by offchain infrastructure.
- Single transaction Rerouting does not require resubmission or multiple transactions.
- Deterministic constraints All possible branches are known and encoded at transaction construction time.
- No user interaction changes Users still request a quote and sign a transaction as usual.
Benefits for Builders
- Lower realized slippage Execution reflects current prices instead of stale quotes.
- Higher success rates Fewer transactions fail due to price movement exceeding slippage tolerance.
- Reduced need for wide slippage limits Less exposure to adverse execution caused by conservative slippage settings.
Comparison to Static Routing
| Aspect | Static Routing | JIT Routing |
|---|---|---|
| Route selection | Offchain, fixed | Onchain, conditional |
| Reaction to price changes | None | Immediate |
| Failure risk in fast markets | High | Lower |