Skip to main content

Crate evm_amm_search

Crate evm_amm_search 

Source
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§

AdaptiveEdgeShortlistConfig
Controls for adaptive same-pair parallel-edge search.
AffectedPools
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 AmmGraph and AdapterRegistry.
BatchSearchReport
Results and quote-cache diagnostics from a batch search.
CycleQuote
Quote result for a cycle path.
CycleRequest
Request for bounded cycle search starting and ending at base_token.
DemoRouterConfig
EdgeData
Data carried by each directed AMM edge.
FastLaneConfig
Fast initial heuristic route search before broad frontier expansion.
GenericExecution
GraphBuildOptions
Options for building an AmmGraph from an adapter registry.
GraphBuildReport
Result of building an AmmGraph.
GraphBuildSummary
Result of rebuilding an existing AmmGraph in place.
GraphDelta
Canonical delta emitted after applying one AMM state commit.
GraphPoolDelta
Before/after search representation for one logical pool.
GraphVersion
Monotonic identity of one token-graph topology.
HeuristicSearchConfig
Controls for SearchMode::Heuristic.
Hop
One directed pool hop.
HopQuote
Quote result for a single hop.
IncrementalRouteUpdateReport
Report from a route-session incremental refresh.
IndexedPool
One active pool represented in the live search universe.
LiquidityPruneStats
Counters for balance-aware heuristic pruning.
LiquidityPruningConfig
Controls for balance-aware ordering and pruning in heuristic search.
LiveAmmGraph
Incrementally maintained search universe backed by immutable AMM commits.
LiveRouteObserver
Lossy typed route-event observer with explicit lag reporting.
LiveRouteRuntime
Marker namespace for spawning the search-owned live route actor.
LiveRouteRuntimeConfig
Live route-runtime controls.
LiveRouteRuntimeEvent
Sequenced event assigned only by the route coordinator.
LiveRouteRuntimeFailure
Terminal coordinator failure while consuming/applying reliable AMM state.
LiveRouteRuntimeHandle
Cheap cloneable control and event handle for the live route actor.
LiveRouteSubscription
Logical route subscription with recoverable state and cooperative cancellation.
LiveSearchView
Immutable, O(1)-clone search input shared by live route workers.
ParallelSearchConfig
Worker controls for overlay-backed parallel candidate evaluation.
PathFailure
One failed candidate-path evaluation.
PoolLiquidityBuildReport
Summary from constructing a liquidity index.
PoolLiquidityIndex
Mutable liquidity sidecar for pool-held token balances.
PoolLiquidityMutationReport
Summary from incrementally reconciling liquidity targets for selected pools.
PoolLiquidityRefreshFailure
One failed liquidity refresh group.
PoolLiquidityRefreshReport
Summary from a balance refresh.
QuoteCacheStats
Counters for the exact-hop quote cache used by DAG evaluation.
RouteCancellationToken
Cloneable cooperative cancellation shared with the active route job.
RouteJobStamp
Complete fence carried by one worker search and every progressive result.
RoutePath
Candidate route path.
RouteProvenance
Complete AMM/search provenance represented by a route result.
RouteQuote
Quote result for a full route path.
RouteRequest
Request for best-route search from one token to another.
RouteSearchFailure
Failure isolated to one route search attempt.
RouteSearchJobId
Monotonic identity of one search attempt within a subscription.
RouteSearchProgress
Current progress through the configured streaming route-search universe.
RouteSearchSession
Stateful route search that can be refreshed after live AMM events.
RouteSubscriptionId
Stable identity of one logical live route subscription.
RouteSubscriptionSnapshot
Recoverable latest-value publication for one route subscription.
RouteSubscriptionSpec
Request and search controls retained by a live route subscription.
SearchConfig
Search controls shared by route and cycle requests.
SkippedPool
A skipped pool and its skip reason.
StreamingPhaseStats
Cumulative stats at a streaming phase boundary.
StreamingSearchConfig
Controls for heuristic-first route streaming.
StreamingSearchReport
Final report from a streaming route search.
StreamingThresholdPolicy
Thresholds used to stop search or gate initial quote-bearing events.
SwapGasEstimate
TransferApplyReport
Result of applying a transfer log to the liquidity index.
TransferEventSource
One token/holder pair callers should subscribe to for ERC-20 Transfer freshness.
UpperBoundPruningConfig
Controls for conservative optimistic pruning after an incumbent route exists.
VersionedRouteQuote
Route quote paired with the exact state and graph that produced it.

Enums§

BalanceState
Latest known liquidity state for a tracked pool/token balance.
DemoRouterHop
GraphPoolMutation
Observable result of applying one pool registration to an existing graph.
GraphTopologyImpact
Search-universe consequence of one AMM state commit.
IncrementalRouteUpdateStatus
Final status of an incremental route-session refresh.
LiquidityIndexScope
Pool-token balance tracking scope used when constructing a liquidity index.
LiveGraphError
Rejected live graph transition.
LiveRouteObserverError
Observer receive error. Event lag never affects recoverable route state.
LiveRouteRuntimeError
Stage 8 live route-runtime failure.
LiveRouteRuntimeEventKind
Typed lifecycle and pipeline events emitted by the route runtime.
PoolLiquidityError
Errors returned by direct liquidity-index mutation helpers.
RecomputeReason
Why an incremental route session declined to update in place.
RouteInvalidationReason
Why a previously accepted/provisional quote became historical.
RouteSearchEvent
Event emitted during a heuristic-first streaming route search.
RouteSearchPhase
Phase that produced a streamed route event.
RouteSearchTrigger
Trigger for a fresh route search.
RouteSubscriptionState
Recoverable current state of one route subscription.
RouteUpdateEvent
Event emitted while refreshing a route-search session.
SearchControl
Callback return value for streaming search events.
SearchError
Search and quote errors.
SearchFinality
Why a streaming search stopped.
SearchMode
Candidate generation strategy.
SkippedPoolReason
Reason a pool was not indexed into the graph.
StreamedRouteStatus
Whether a streamed route is still provisional.
StreamingCompletion
When a streaming search is considered complete.
StreamingThresholdMode
How multiple streaming threshold conditions are combined.

Constants§

DEMO_ROUTER

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§

PoolLiquidityTracker
Alias kept for callers that prefer a stateful “tracker” name for the same sidecar.
StableAmmDiGraph
Stable directed graph used by the search layer.