feat: add fynd-benchmark generate-requests subcommand - #314
Conversation
Generate a per-chain synthetic swap-request dataset for capacity load testing, covering chains the Ethereum-only download-trades set does not. Adds fynd_rpc::protocols::fetch_token_pool_stats, which reuses the Tycho pool-count query behind derive-connector-tokens to return per-token pool counts and decimals. The new subcommand samples token pairs weighted by pool count (seeded StdRng, no self-pairs), log-spaces amounts around one whole token, and writes a --requests-file-compatible JSON array. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
No API Breaking Changes DetectedThe PR title signals breaking changes, but |
Add a client-side per-fetch timeout (--fetch-timeout-secs, default 300s) so a degraded Tycho indexer fails fast with an error naming the stalled protocol system, instead of hanging indefinitely (observed 18-minute byte-flat stalls). Add --min-tvl, passed to the component query as tvl_gt, which the dedicated tycho-fynd-* indexer endpoints require. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Two robustness fixes from production use on 2026-07-15 (commit e782f59): Client-side fetch timeout. Against a degraded indexer (tycho-base-beta), the per-protocol-system component fetches hung indefinitely (18+ min byte-flat stalls). Each Tycho component fetch and the token-metadata fetch now run under a client-side deadline. New
Both new knobs are carried on a new Verification (nightly-2026-06-28): |
Adds a
generate-requestssubcommand tofynd-benchmarkthat produces a per-chain synthetic swap-request dataset (JSON) for capacity load testing. The existingdownload-tradesdataset is Ethereum-only; this covers other chains.What it does
fynd_rpc::protocols::fetch_token_pool_stats, which reuses the pool-count query behindderive-connector-tokens(counts pools per token, joins Tycho token metadata for symbols and decimals).StdRngso output is deterministic for a given--seedand token set.--requests-fileloaders (load_request_templates/load_requests_from_file).CLI
Accepted
--chainvalues:ethereum,base,unichain,bsc,arbitrum,polygon(case-insensitive).zksyncparses but has no default Tycho URL, so pass--tycho-url. The Tycho URL defaults to the chain's Fynd endpoint; auth usesTYCHO_API_KEY.Tests and validation
Sampling and serialization are covered with fixture token data (no network): amount scaling, weighted pair sampling with no self-pairs, seed determinism, minimum-token guard, and a round-trip that loads the generated dataset back through
load_request_templates.The Tycho fetch is a thin network layer. Against a hosted endpoint it was exercised only up to the authentication boundary (the RPC call is made and auth is enforced). Live end-to-end generation against ethereum and base is validated in-cluster, where a one-off Job in the
staging-fyndnamespace runs the command withTYCHO_API_KEYmounted from the existing secret, so the key never leaves the cluster.🤖 Generated with Claude Code