Published on Sat Oct 18 2025 00:00:00 GMT+0000 (Coordinated Universal Time) by Orkid Labs
TL;DR
- Traditional scoring: Routes ranked by EV alone miss critical timing and microstructure factors
- Complex microstructure factor: $Q_C = A_C e^{i\phi_C}$ captures bandwidth, depth, and phase alignment
- Time-normalized metrics: Profit per millisecond reveals true opportunity quality
- Phase conjugation: Aligning action to oppose market skew maximizes extraction
- Practical framework: Simulate EV, estimate latency, construct $Q_C$, rank by composite score
Introduction: The Limits of Simple EV
Most DeFi routing algorithms rank paths by a single metric: expected value (EV)—the simulated profit after gas and slippage.
Problem: EV alone is insufficient for high-frequency MEV extraction.
Why?
- Timing matters: A $10 profit in 1ms is better than $10 in 1000ms
- Microstructure matters: Bandwidth, book depth, and fill probability affect execution
- Phase matters: Orderflow timing relative to peers determines who captures value
Solution: We introduce a complex microstructure framework that combines:
- Negative EV pockets (from our previous post)
- Time normalization (profit per unit time)
- Complex phase factors (alignment with market dynamics)
Definitions
For a candidate route $C$, define:
1. Expected Value
$$\text{EV}_C = \text{expected net outcome in USD (after gas & slippage)}$$
Standard calculation: Simulate the route on current pool states, subtract gas costs.
2. Latency
$$\Delta t_C^{(\text{ms})} = \text{latency from intent to inclusion (milliseconds)}$$
Components:
- Mempool propagation time
- Builder selection time
- Block inclusion time
- Network latency
Interpretation: Latency varies by chain and network conditions. Faster latency means opportunities can be captured before market conditions change.
3. Negative EV Pocket
$$I_C = \max{0, -\text{EV}_C}$$
Interpretation: If $\text{EV}_C < 0$, the route has a “debit mass” $I_C = |\text{EV}_C|$ that can be exploited.
Key insight: Routes with $I_C > 0$ are opportunities, not losses. They represent inefficiency that can be converted into profit by executing the opposite trade.
4. Complex Microstructure Factor
$$Q_C = A_C e^{i\phi_C}$$
where:
Amplitude $A_C$: $$A_C \propto (\text{effective bandwidth}) \times (\text{book depth}) \times (\text{fill probability})$$
Phase $\phi_C$: $$\phi_C = \text{phase from latency skew / orderflow timing vs. peers}$$
Interpretation:
- $A_C$ measures capacity: How much value can this route handle?
- $\phi_C$ measures timing: Are we ahead or behind the market?
Core Scoring Framework
Time-Normalized Score
The fundamental metric is profit per unit time:
$$S_C = \frac{I_C \cdot \Re{Q_C^*}}{\Delta t_C^{(\text{ms})}}$$
where $Q_C^* = A_C e^{-i\phi_C}$ is the complex conjugate of $Q_C$.
Interpretation:
- $I_C$: Isolates targetable negative EV (opportunity size)
- $Q_C^*$: Phase-aligns action to oppose observed skew
- $\Re{Q_C^*}$: Rewards routes aligned to collapse the inefficiency pocket
- $\Delta t_C$: Normalizes by execution time (faster = better)
Units: USD per millisecond
Example:
- Route A: $I_C = 5$ USD, $\Re{Q_C^*} = 0.8$, $\Delta t_C = 100$ ms → $S_C = 0.04$ USD/ms
- Route B: $I_C = 3$ USD, $\Re{Q_C^*} = 0.9$, $\Delta t_C = 50$ ms → $S_C = 0.054$ USD/ms
Result: Route B scores higher despite lower absolute profit because it’s faster and better aligned.
Why Phase Conjugation?
The Physics Intuition
In signal processing and quantum mechanics, phase conjugation is used to reverse wave propagation and cancel interference.
Analogy to DeFi:
- Market skew = phase offset $\phi_C$ (orderflow timing relative to peers)
- Optimal action = conjugate phase $-\phi_C$ (execute opposite to skew)
- Constructive interference = $\Re{Q_C^*}$ (alignment maximizes extraction)
Mathematical Justification
Let $Q_C = A_C e^{i\phi_C}$ represent the market’s current microstructure.
Naive approach: Execute in phase with $Q_C$ → $\Re{Q_C} = A_C \cos(\phi_C)$
Conjugate approach: Execute with $Q_C^$ → $\Re{Q_C^} = A_C \cos(-\phi_C) = A_C \cos(\phi_C)$
Wait, they’re the same? Not quite. The key is what we multiply by:
$$S_C = \frac{I_C \cdot \Re{Q_C^*}}{\Delta t_C}$$
Here, $I_C$ is the inefficiency (negative EV pocket). By using $Q_C^*$, we’re asking:
“How well does this route align with the action needed to collapse the inefficiency?”
If the market is skewed in direction $\phi_C$, the optimal arbitrage is in direction $-\phi_C$ (opposite). Thus $Q_C^*$ rewards routes that oppose the skew.
Practical Example
Scenario: Uniswap V3 WETH/USDC pool is skewed:
- Current price: 1 WETH = 2000 USDC
- Binance price: 1 WETH = 2005 USDC
- Skew: $\phi_C = +0.25%$ (Uniswap underpriced)
Optimal action: Buy WETH on Uniswap, sell on Binance (direction $-\phi_C$)
Microstructure factor:
- $A_C = 0.9$ (high liquidity, good fill probability)
- $\phi_C = +0.0025$ radians (small skew)
- $Q_C^* = 0.9 e^{-i \cdot 0.0025}$
- $\Re{Q_C^*} = 0.9 \cos(-0.0025) \approx 0.9$
Score:
- $I_C = 5$ USD (negative EV pocket from price difference)
- $\Delta t_C = 100$ ms
- $S_C = \frac{5 \times 0.9}{100} = 0.045$ USD/ms
Constructing the Microstructure Factor
Amplitude $A_C$
$$A_C = w_1 \cdot B_C + w_2 \cdot D_C + w_3 \cdot F_C$$
where:
Bandwidth $B_C$:
- Effective throughput of the route
- Measured in USD/second
- Higher for direct swaps, lower for multi-hop
Book Depth $D_C$:
- Liquidity available at current price
- Measured in USD
- Higher for concentrated liquidity pools (Uniswap V3)
Fill Probability $F_C$:
- Likelihood of successful execution
- Measured as probability (0-1)
- Depends on gas price, mempool congestion, reorg risk
Weights $w_1, w_2, w_3$:
- Calibrated to historical data
- Typically $w_1 = 0.4$, $w_2 = 0.3$, $w_3 = 0.3$
Phase $\phi_C$
$$\phi_C = \arctan\left(\frac{\text{latency skew}}{\text{expected latency}}\right)$$
where:
Latency skew:
- Difference between our latency and peer latency
- Positive if we’re slower, negative if we’re faster
Expected latency:
- Baseline latency for this route type
- Calibrated from historical fills
Example:
- Our latency: 120ms
- Peer average: 100ms
- Skew: +20ms
- Expected: 100ms
- $\phi_C = \arctan(20/100) = \arctan(0.2) \approx 0.197$ radians
Interpretation: We’re 20ms behind peers, so $\phi_C > 0$. To compete, we need to execute faster or find routes peers miss.
Execute or Skip?
Decision Rule
Execute if:
- $S_C > \tau$ (score exceeds threshold)
- Feasibility constraints hold:
- Gas cost < gas ceiling
- Bundle size < max bundle size
- Reorg risk < max acceptable risk
Threshold $\tau$: $$\tau = \frac{\text{min profit per ms to cover costs}}{\text{expected success rate}}$$
Example:
- Min profit: $0.50 per execution
- Expected latency: 100ms
- Success rate: 20%
- $\tau = \frac{0.50 / 100}{0.20} = 0.025$ USD/ms
Tie-Breakers
If multiple routes have $S_C > \tau$, prioritize by:
- Larger $\Re{Q_C^*}$ (better phase alignment)
- Lower $\text{Var}[\Delta t]$ (more predictable latency)
- Higher inclusion probability (less reorg risk)
Practical Implementation
Step 1: Simulate EV
For each candidate route $C$:
- Query current pool states (reserves, prices, fees)
- Simulate swap execution (account for slippage)
- Subtract gas costs (estimate from historical data)
- Compute $\text{EV}_C$
Step 2: Estimate Latency
Model the execution pipeline:
- Mempool propagation: 10-50ms (depends on node connectivity)
- Builder selection: 20-100ms (depends on MEV-Boost latency)
- Block inclusion: 50-500ms (depends on block time)
- Network latency: 5-20ms (depends on geography)
Total: $\Delta t_C = t_{\text{mempool}} + t_{\text{builder}} + t_{\text{block}} + t_{\text{network}}$
Step 3: Construct $Q_C$
Amplitude:
- Bandwidth: Query pool throughput (TVL / avg block time)
- Depth: Query pool liquidity at current price
- Fill probability: Estimate from historical success rate
Phase:
- Latency skew: Compare our latency to peer average
- Expected latency: Use historical median for this route type
Step 4: Rank by Score
Compute $S_C$ for all routes, sort descending.
Step 5: Bundle and Execute
- Select top $k$ disjoint routes (no overlapping pools)
- Re-simulate joint gas and slippage
- Submit bundle via Flashbots/MEV-Share
- Monitor inclusion and update $\phi_C$ estimates
Risk-Adjusted Scoring
For risk-averse strategies, penalize variance:
$$S_C^\lambda = \frac{I_C \cdot \Re{Q_C^*}}{\Delta t_C^{(\text{ms})} \cdot (1 + \lambda \cdot \text{Var}[\text{EV}_C])}$$
where $\lambda > 0$ is the risk aversion parameter.
Interpretation: Routes with high variance are penalized, even if they have high expected profit.
Example:
- Route A: $\text{EV}_C = 5$ USD, $\text{Var}[\text{EV}_C] = 1$ USD²
- Route B: $\text{EV}_C = 4$ USD, $\text{Var}[\text{EV}_C] = 0.1$ USD²
- $\lambda = 0.5$
Scores:
- $S_A^\lambda = \frac{5 \times 0.9}{100 \times (1 + 0.5 \times 1)} = 0.030$ USD/ms
- $S_B^\lambda = \frac{4 \times 0.9}{100 \times (1 + 0.5 \times 0.1)} = 0.034$ USD/ms
Result: Route B scores higher despite lower EV because it’s less risky.
Online Learning
Adaptive Phase Estimation
Update $\phi_C$ from realized fills using exponential moving average (EMA):
$$\phi_C^{(n+1)} = \alpha \cdot \phi_C^{(\text{observed})} + (1 - \alpha) \cdot \phi_C^{(n)}$$
where:
- $\alpha \in (0, 1)$ is the learning rate (typically 0.1-0.3)
- $\phi_C^{(\text{observed})}$ is the phase inferred from the last fill
Kalman filter can also be used for more sophisticated tracking.
Threshold Calibration
Adjust $\tau$ based on recent performance:
$$\tau^{(n+1)} = \tau^{(n)} \cdot \left(1 + \beta \cdot \frac{\text{target profit} - \text{actual profit}}{\text{target profit}}\right)$$
where $\beta > 0$ is the adaptation rate.
Interpretation: If we’re underperforming, raise $\tau$ (be more selective). If we’re overperforming, lower $\tau$ (be more aggressive).
Conclusion
We’ve introduced a sophisticated framework for route scoring in DeFi that goes beyond simple EV:
- Negative EV pockets ($I_C$) identify opportunities
- Time normalization ($\Delta t_C$) reveals true quality
- Complex microstructure ($Q_C$) captures bandwidth, depth, and timing
- Phase conjugation ($Q_C^*$) aligns action to collapse inefficiency
- Composite score ($S_C$) combines all factors into USD/ms
Key insight: The best routes aren’t always the highest EV—they’re the ones that extract the most value per unit time while aligning with market microstructure.
Practical takeaway: Implement this framework by:
- Simulating EV for all routes
- Estimating latency from mempool to inclusion
- Constructing $Q_C$ from bandwidth, depth, and fill probability
- Ranking by $S_C$ and executing top routes
Next steps: Extend this framework with:
- Multi-route bundling (joint optimization)
- Cross-chain arbitrage (bridge latency modeling)
- Adaptive learning (online $\phi_C$ updates)
Further Reading
- Flashbots Research: MEV-Share and private orderflow - docs.flashbots.net
- Uniswap V3: Concentrated liquidity and tick math - uniswap.org/whitepaper-v3.pdf
- Curve Finance: StableSwap invariant and bonding curves - curve.readthedocs.io
- Our previous post: “Negative EV Rate as Blockchain Inefficiency” - [Link]
Built by Cadence System · “Research and infrastructure for MEV strategy and execution.”
Written by Orkid Labs
← Back to blog