Orkid Labs
← Back to blog

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?

  1. Timing matters: A $10 profit in 1ms is better than $10 in 1000ms
  2. Microstructure matters: Bandwidth, book depth, and fill probability affect execution
  3. 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:

  1. $I_C$: Isolates targetable negative EV (opportunity size)
  2. $Q_C^*$: Phase-aligns action to oppose observed skew
  3. $\Re{Q_C^*}$: Rewards routes aligned to collapse the inefficiency pocket
  4. $\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:

  1. $S_C > \tau$ (score exceeds threshold)
  2. 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:

  1. Larger $\Re{Q_C^*}$ (better phase alignment)
  2. Lower $\text{Var}[\Delta t]$ (more predictable latency)
  3. Higher inclusion probability (less reorg risk)

Practical Implementation

Step 1: Simulate EV

For each candidate route $C$:

  1. Query current pool states (reserves, prices, fees)
  2. Simulate swap execution (account for slippage)
  3. Subtract gas costs (estimate from historical data)
  4. Compute $\text{EV}_C$

Step 2: Estimate Latency

Model the execution pipeline:

  1. Mempool propagation: 10-50ms (depends on node connectivity)
  2. Builder selection: 20-100ms (depends on MEV-Boost latency)
  3. Block inclusion: 50-500ms (depends on block time)
  4. 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

  1. Select top $k$ disjoint routes (no overlapping pools)
  2. Re-simulate joint gas and slippage
  3. Submit bundle via Flashbots/MEV-Share
  4. 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:

  1. Negative EV pockets ($I_C$) identify opportunities
  2. Time normalization ($\Delta t_C$) reveals true quality
  3. Complex microstructure ($Q_C$) captures bandwidth, depth, and timing
  4. Phase conjugation ($Q_C^*$) aligns action to collapse inefficiency
  5. 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

  1. Flashbots Research: MEV-Share and private orderflow - docs.flashbots.net
  2. Uniswap V3: Concentrated liquidity and tick math - uniswap.org/whitepaper-v3.pdf
  3. Curve Finance: StableSwap invariant and bonding curves - curve.readthedocs.io
  4. 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

Research to next step

Turn this research into a usable next move

Reading the post is only step one. The stronger move is to route it into the asset or commercial lane that matches what your team needs next.

Launch overview

Read the launch brief

Start with the launch brief when the team needs the fastest summary of fit, trust, and the right next route through the site.

Read launch brief →

Technical packet

Review the Protocol Packet

If the post raised technical questions, move into the packet for the forwardable version of the core framework.

Review packet →

Shortlist and fit

Use comparisons or alternatives

When the question is no longer category education but shortlist fit, use the comparison surfaces to support an honest vendor evaluation.

See comparisons →
  • Use Your Mathematics, Son: A Dedication to Jesus Y Cavazos

    Use Your Mathematics, Son: A Dedication to Jesus Y Cavazos

    A personal dedication to my father, Jesus Y Cavazos (1944-2017), and how his wisdom—'use your mathematics, son'—became the foundation of ORKID's philosophy: the choice to serve the ecosystem rather than extract from it.

  • Two Months Building ORKID: A Physics-Based MEV Engine

    Two Months Building ORKID: A Physics-Based MEV Engine

    Celebrating 2 months of building ORKID—a production-ready MEV physics engine. From TypeScript to Rust, from single-chain to multi-chain, from theory to execution. Here's what we built, what we learned, and what's next.

  • Three Weeks In: Shipping Real‑Time MEV Signals With Production Discipline

    Three Weeks In: Shipping Real‑Time MEV Signals With Production Discipline

    A build‑in‑public week focused on signal quality and operational discipline: /pulse live telemetry, version visibility across domains, and mempool physics that mirror on‑chain reality. Tip P90 and sandwich intensity now move with activity.

  • The Thermodynamic Balance of Global Networks: How Information Creation is Paid for by Energy Dissipation

    The Thermodynamic Balance of Global Networks: How Information Creation is Paid for by Energy Dissipation

    A comprehensive exploration of how global networks balance information creation with energy dissipation as nodes proliferate and bandwidth increases. We derive the fundamental relationship between negentropy and information from first principles, examine the thermodynamic constraints that govern network growth, and explore the implications for blockchain systems and distributed computing.

  • The Rust Rail for Settling GovCon Contracts to Cash in Stablecoin

    The Rust Rail for Settling GovCon Contracts to Cash in Stablecoin

    Designing a Rust-based settlement rail to convert Government Contract payouts into stablecoins—architecture, compliance, and security.

  • The Nobel Lineage: How Physics Became ORKID

    The Nobel Lineage: How Physics Became ORKID

    The intellectual lineage from Lord Rayleigh through Ernest Rutherford, Erwin Schrödinger, Linus Pauling, and Martin Karplus to ORKID. How 150 years of physics research became the foundation of modern routing infrastructure.