Skip to main content

Crate evm_amm_state

Crate evm_amm_state 

Source
Expand description

A real-time AMM state engine built on a forked-EVM state cache (evm_fork_cache).

evm-amm-state composes a forked-EVM state cache (evm_fork_cache) with a set of protocol adapters into a pipeline that tracks a working set of AMMs, cold-starts their on-chain state into the cache, keeps exact-write protocols current straight from chain log events, and emits bounded repair requests for protocols whose events don’t carry final storage values. Once a pool’s quote read-set is warmed and current, swap simulations run fast and offline against it.

The pieces, roughly in pipeline order:

See the crate’s examples/adapter_pipeline.rs for an end-to-end demo that cold-starts a pool, subscribes to its events over a WebSocket endpoint, applies them reactively, and simulates a swap against the live-synced state.

Re-exports§

pub use alloy_primitives;
pub use evm_fork_cache;

Modules§

adapters
Protocol-neutral AMM adapter boundary.