Skip to content

[E5] Mempool tap — wire MEV-Share into engine + unified candidate stream + prod filter #123

Description

@0xfandom

Follow-up to #117. The Phase 0/1 scaffold (Alchemy WS subscribe, router decoder, MEV-Share SSE monitor, V2 post-state sim) is in place on feat/mempool-tracking-scaffold. This issue tracks the remaining work to make the mempool tap a real trigger on the engine hot path — not just a monitor.

Done already (on branch)

  • public mempool subscribe (crates/ingestion/src/mempool.rs)
  • router decoder for V2 / Sushi / Curve / V3 (crates/pools/src/router_decoder.rs)
  • MEV-Share SSE monitor (cmd/monitor/mev_share.go) — monitor binary only
  • V2 analytical post-state sim (crates/grpc-server/src/mempool_pipeline.rs)
  • backpressure metering via aether_pending_pipeline_lagged_total
  • 60s reconnect on MEV-Share read silence
  • O(1) pool lookup via cached PairIndex

To do

  • route MEV-Share matched txns from cmd/monitor/mev_share.go into the engine trigger path (not just monitor — same path public mempool already uses)
  • unified candidate stream with source={"public","mev_share"} label propagated through detection → arb publish
  • production filter rules: drop pending txns whose to is not in pool_registry, drop unknown selectors before decoder is called
  • arbs.source column (migration 0003_add_source_to_arbs.sql) so DB rows carry the flow origin
  • metric aether_mempool_candidates_total{source} + aether_mempool_filtered_total{reason}

Out of scope (separate issue)

Done when

  • 30-min live shadow run shows arbs rows with both source=public and source=mev_share
  • filter drop rate matches expectation (>99% of public mempool txns rejected by to-not-in-registry filter)
  • no regression in existing aether_pending_pipeline_lagged_total (queue not bottlenecking)

Branch

feat/mempool-tracking-scaffold — currently 13 commits ahead of develop, rebased clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions