Expand description
Graph-based route and cycle search for evm-amm-state.
This crate does not discover, cold-start, or synchronize pools. Those jobs
remain with evm-amm-state. evm-amm-search takes an already-populated
AdapterRegistry, builds a token
graph from its ready pool metadata, and evaluates candidate routes by calling
each pool adapter’s canonical simulate_swap.
Structs§
- Adaptive
Edge Shortlist Config - Controls for adaptive same-pair parallel-edge search.
- Affected
Pools - Pools whose state may have changed after a live-sync batch.
- AmmGraph
- Stable token graph over AMM pool edges.
- AmmSearcher
- Route and cycle searcher over an
AmmGraphandAdapterRegistry. - Batch
Search Report - Results and quote-cache diagnostics from a batch search.
- Cycle
Quote - Quote result for a cycle path.
- Cycle
Request - Request for bounded cycle search starting and ending at
base_token. - Demo
Router Config - Edge
Data - Data carried by each directed AMM edge.
- Fast
Lane Config - Fast initial heuristic route search before broad frontier expansion.
- Generic
Execution - Graph
Build Options - Options for building an
AmmGraphfrom an adapter registry. - Graph
Build Report - Result of building an
AmmGraph. - Graph
Build Summary - Result of rebuilding an existing
AmmGraphin place. - Graph
Delta - Canonical delta emitted after applying one AMM state commit.
- Graph
Pool Delta - Before/after search representation for one logical pool.
- Graph
Version - Monotonic identity of one token-graph topology.
- Heuristic
Search Config - Controls for
SearchMode::Heuristic. - Hop
- One directed pool hop.
- HopQuote
- Quote result for a single hop.
- Incremental
Route Update Report - Report from a route-session incremental refresh.
- Indexed
Pool - One active pool represented in the live search universe.
- Liquidity
Prune Stats - Counters for balance-aware heuristic pruning.
- Liquidity
Pruning Config - Controls for balance-aware ordering and pruning in heuristic search.
- Live
AmmGraph - Incrementally maintained search universe backed by immutable AMM commits.
- Live
Route Observer - Lossy typed route-event observer with explicit lag reporting.
- Live
Route Runtime - Marker namespace for spawning the search-owned live route actor.
- Live
Route Runtime Config - Live route-runtime controls.
- Live
Route Runtime Event - Sequenced event assigned only by the route coordinator.
- Live
Route Runtime Failure - Terminal coordinator failure while consuming/applying reliable AMM state.
- Live
Route Runtime Handle - Cheap cloneable control and event handle for the live route actor.
- Live
Route Subscription - Logical route subscription with recoverable state and cooperative cancellation.
- Live
Search View - Immutable, O(1)-clone search input shared by live route workers.
- Parallel
Search Config - Worker controls for overlay-backed parallel candidate evaluation.
- Path
Failure - One failed candidate-path evaluation.
- Pool
Liquidity Build Report - Summary from constructing a liquidity index.
- Pool
Liquidity Index - Mutable liquidity sidecar for pool-held token balances.
- Pool
Liquidity Mutation Report - Summary from incrementally reconciling liquidity targets for selected pools.
- Pool
Liquidity Refresh Failure - One failed liquidity refresh group.
- Pool
Liquidity Refresh Report - Summary from a balance refresh.
- Quote
Cache Stats - Counters for the exact-hop quote cache used by DAG evaluation.
- Route
Cancellation Token - Cloneable cooperative cancellation shared with the active route job.
- Route
JobStamp - Complete fence carried by one worker search and every progressive result.
- Route
Path - Candidate route path.
- Route
Provenance - Complete AMM/search provenance represented by a route result.
- Route
Quote - Quote result for a full route path.
- Route
Request - Request for best-route search from one token to another.
- Route
Search Failure - Failure isolated to one route search attempt.
- Route
Search JobId - Monotonic identity of one search attempt within a subscription.
- Route
Search Progress - Current progress through the configured streaming route-search universe.
- Route
Search Session - Stateful route search that can be refreshed after live AMM events.
- Route
Subscription Id - Stable identity of one logical live route subscription.
- Route
Subscription Snapshot - Recoverable latest-value publication for one route subscription.
- Route
Subscription Spec - Request and search controls retained by a live route subscription.
- Search
Config - Search controls shared by route and cycle requests.
- Skipped
Pool - A skipped pool and its skip reason.
- Streaming
Phase Stats - Cumulative stats at a streaming phase boundary.
- Streaming
Search Config - Controls for heuristic-first route streaming.
- Streaming
Search Report - Final report from a streaming route search.
- Streaming
Threshold Policy - Thresholds used to stop search or gate initial quote-bearing events.
- Swap
GasEstimate - Transfer
Apply Report - Result of applying a transfer log to the liquidity index.
- Transfer
Event Source - One token/holder pair callers should subscribe to for ERC-20
Transferfreshness. - Upper
Bound Pruning Config - Controls for conservative optimistic pruning after an incumbent route exists.
- Versioned
Route Quote - Route quote paired with the exact state and graph that produced it.
Enums§
- Balance
State - Latest known liquidity state for a tracked pool/token balance.
- Demo
Router Hop - Graph
Pool Mutation - Observable result of applying one pool registration to an existing graph.
- Graph
Topology Impact - Search-universe consequence of one AMM state commit.
- Incremental
Route Update Status - Final status of an incremental route-session refresh.
- Liquidity
Index Scope - Pool-token balance tracking scope used when constructing a liquidity index.
- Live
Graph Error - Rejected live graph transition.
- Live
Route Observer Error - Observer receive error. Event lag never affects recoverable route state.
- Live
Route Runtime Error - Stage 8 live route-runtime failure.
- Live
Route Runtime Event Kind - Typed lifecycle and pipeline events emitted by the route runtime.
- Pool
Liquidity Error - Errors returned by direct liquidity-index mutation helpers.
- Recompute
Reason - Why an incremental route session declined to update in place.
- Route
Invalidation Reason - Why a previously accepted/provisional quote became historical.
- Route
Search Event - Event emitted during a heuristic-first streaming route search.
- Route
Search Phase - Phase that produced a streamed route event.
- Route
Search Trigger - Trigger for a fresh route search.
- Route
Subscription State - Recoverable current state of one route subscription.
- Route
Update Event - Event emitted while refreshing a route-search session.
- Search
Control - Callback return value for streaming search events.
- Search
Error - Search and quote errors.
- Search
Finality - Why a streaming search stopped.
- Search
Mode - Candidate generation strategy.
- Skipped
Pool Reason - Reason a pool was not indexed into the graph.
- Streamed
Route Status - Whether a streamed route is still provisional.
- Streaming
Completion - When a streaming search is considered complete.
- Streaming
Threshold Mode - How multiple streaming threshold conditions are combined.
Constants§
Functions§
- demo_
router_ hops_ for_ quote - demo_
router_ runtime - encode_
demo_ router_ execute_ calldata - encode_
demo_ router_ execute_ from_ calldata - install_
demo_ router - prewarm_
demo_ router_ token_ transfer - Warm the storage/code path an ERC-20 transfer from the demo router needs.
- simulate_
gas_ hops - simulate_
route_ gas - simulate_
route_ prefix_ gas - simulate_
versioned_ route_ gas - Simulate a versioned route against the exact immutable view that produced it.
- simulate_
versioned_ route_ gas_ with_ balance_ mappings - Simulate a versioned route with pre-discovered ERC-20 balance layouts.
Type Aliases§
- Pool
Liquidity Tracker - Alias kept for callers that prefer a stateful “tracker” name for the same sidecar.
- Stable
AmmDi Graph - Stable directed graph used by the search layer.