Skip to content

feat: add Flare protocols and a stream timeout override - #440

Open
tuddman wants to merge 3 commits into
propeller-heads:mainfrom
aspensprotocol:main
Open

feat: add Flare protocols and a stream timeout override#440
tuddman wants to merge 3 commits into
propeller-heads:mainfrom
aspensprotocol:main

Conversation

@tuddman

@tuddman tuddman commented Aug 19, 2026

Copy link
Copy Markdown

What

Adds three match arms to fynd-core/src/feed/protocol_registry.rs so Fynd can
serve quotes on Flare (chain id 14) against a self-hosted Tycho indexer:

  • blazeswap_v2UniswapV2State
  • sparkdex_v3UniswapV3State
  • enosys_v3UniswapV3State

All three are Uniswap V2/V3 forks. They index on Flare with the existing
ethereum-uniswap-v2 and ethereum-uniswap-v3-logs-only substreams packages
(logs-only, since Flare has no Firehose-instrumented client and runs on the
RPC-poller block model). Factory addresses, verified on-chain:

protocol factory deploy block
BlazeSwap V2 0x440602f4…e2A6 9921148
SparkDEX V3 0x8A2578d2…E652 30717263
Enosys V3 0x17AA157A…f0de 29925441

Why

We run the self-hosted setup from the docs
(for-solvers/self-hosted-evm-chain) with Flare as a registry-defined custom
chain via --chains-config. Indexing works with per-chain manifests of the
existing packages, but register_exchanges warn-skips protocol names it does
not know, so the streamed components never reach the stream builder without
these arms.

Notes

  • Additive only: three new arms in the existing match, same shape as
    quickswap_v2. No behavior change for any existing chain or protocol; the
    unknown-protocol fallback is untouched.
  • No chain-specific code — the chain itself resolves through the custom-chain
    registry; these arms only map protocol names to existing simulation states.
  • Validated against a self-hosted Flare tycho-indexer streaming these three
    protocols; check.sh passes on the touched crate.

BlazeSwap V2 pools simulate as UniswapV2State; SparkDEX V3 and Enosys V3
as UniswapV3State (logs-only indexing). Without these arms the stream
builder warn-skips the protocols a self-hosted Flare Tycho indexes.
tycho-client derives the stream timeout from the chain's block time
(3x block time for custom-registry chains), which is too tight for
indexers that pause during catch-up bursts: flare's 2s blocks derive a
6s timeout that trips missed-block stream errors while the self-hosted
indexer backfills. The flag (FYND_STREAM_TIMEOUT_SECS) threads through
FyndRPCBuilder/FyndBuilder/TychoFeedConfig to the stream builder's
latency_buffer and leaves the derived default in place when unset.
feat: add Flare protocols and a stream timeout override
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant