Skip to main content

Module most_liquid

Module most_liquid 

Source
Expand description

Most Liquid algorithm implementation.

This algorithm finds routes by:

  1. Finding all edge paths up to max_hops using BFS (shorter paths first, all parallel edges)
  2. Scoring and sorting paths by spot price, fees, and liquidity depth
  3. Simulating paths with actual ProtocolSim to get accurate output (best paths first)
  4. Ranking by net output (output - gas cost in output token terms)
  5. Returning the best route with stats recorded to the tracing span

Structsยง

DepthAndPrice
Algorithm-specific edge data for liquidity-based routing.
MostLiquidAlgorithm
Algorithm that selects routes based on expected output after gas.