Server Configuration
Reference for all Fynd server flags, worker pool tuning, blacklisting, logging, and monitoring.
Run options
All on-chain protocols are fetched from Tycho RPC by default, so --protocols is optional. The --tycho-url also defaults to the Fynd endpoint for the selected chain.
cargo run --release -- serveTo run on a different chain:
cargo run --release -- serve --chain base--rpc-url defaults to the public endpoint https://eth.llamarpc.com. For production, use a dedicated endpoint:
cargo run --release -- serve \
--rpc-url https://your-rpc-provider.com/v1/your_keySpecify protocols explicitly:
cargo run --release -- serve \
--protocols uniswap_v2,uniswap_v3,vm:curveSee the full list of available protocols.
Including RFQ Protocols
Include RFQ (Request-for-Quote) protocols alongside on-chain protocols. Use the all_onchain keyword to combine auto-fetched on-chain protocols with specific RFQ protocols:
cargo run --release -- serve \
--protocols all_onchain,rfq:bebopOr specify both on-chain and RFQ protocols explicitly:
Limitations:
RFQ protocols cannot run alone. At least one on-chain protocol is required.
Environment variables:
RFQ protocols require API keys passed via environment variables. Check the RFQ protocol docs for the specific variables each protocol needs.
Flag reference
Run cargo run --release -- serve --help for the full list.
Required
--tycho-api-key
TYCHO_API_KEY
Tycho API key
Optional
--rpc-url
RPC_URL
https://eth.llamarpc.com
Ethereum RPC endpoint. Use a dedicated endpoint in production.
--tycho-url
TYCHO_URL
(chain-specific)
Tycho URL. Defaults to the Fynd endpoint for the selected chain (e.g. tycho-fynd-ethereum.propellerheads.xyz).
--chain
—
Ethereum
Target chain
-p, --protocols
—
(all on-chain)
Protocols to index (comma-separated). If omitted, all on-chain protocols are fetched from Tycho RPC. Use all_onchain to combine auto-fetched protocols with explicit entries (e.g. all_onchain,rfq:bebop).
--http-host
HTTP_HOST
0.0.0.0
HTTP bind address
--http-port
HTTP_PORT
3000
API port
--min-tvl
—
10.0
Minimum pool TVL in native token (ETH)
--tvl-buffer-ratio
—
1.1
Hysteresis buffer for TVL filtering. Components are added when TVL >= min_tvl and removed when TVL drops below min_tvl / tvl_buffer_ratio.
--traded-n-days-ago
—
3
Only include tokens traded within this many days.
--worker-router-timeout-ms
—
100
Default solve timeout (ms)
--worker-router-min-responses
—
0
Early return threshold (0 = wait for all pools)
-w, --worker-pools-config
WORKER_POOLS_CONFIG
worker_pools.toml
Worker pools config file path
--blacklist-config
BLACKLIST_CONFIG
blacklist.toml
Blacklist config file path
--disable-tls
—
false
Disable TLS for Tycho connection
--gas-refresh-interval-secs
—
30
Gas price refresh interval
--reconnect-delay-secs
—
5
Reconnect delay on connection failure
--gas-price-stale-threshold-secs
—
(disabled)
Health returns 503 when gas price exceeds this age. Disabled by default.
Worker pools (worker_pools.toml)
worker_pools.toml)Worker pools control solver thread count and routing strategies. The default config ships with three pools:
All pools solve every incoming order in parallel. Fynd picks the best result across pools within the timeout.
Worker pool fields
algorithm
"most_liquid"
Algorithm used for the pool
num_workers
CPU count
Number of OS threads dedicated to this pool
task_queue_capacity
1000
Maximum number of orders that can be queued simultaneously
min_hops
1
Minimum number of hops required for routing
max_hops
3
Maximum number of hops permitted for routing
timeout_ms
100
Maximum time in milliseconds allowed per order processing in this pool
max_routes
(no limit)
Maximum number of candidate routes to evaluate per order
Tuning tips
More workers = more orders can be solved concurrently. Each worker is a dedicated OS thread, so avoid exceeding your CPU core count across all pools.
Lower
max_hops= faster solves but may miss better multi-hop routes.Higher
max_hops= explores deeper routes but takes longer. Pair with a highertimeout_ms.The "fast + deep" pattern (default config) gives quick responses from the 2-hop pool while the 3-hop pool searches for better routes in the background.
To use a custom config file:
Blacklist (blacklist.toml)
blacklist.toml)Exclude specific components from routing, useful for components with known simulation issues (e.g., rebasing tokens on UniswapV3 pools):
Logging and monitoring
Logs
Control log verbosity with RUST_LOG:
Prometheus metrics
Metrics are exposed at http://localhost:9898/metrics (always on). Scrape this endpoint with Prometheus or any compatible tool. Available metrics: solve duration, response counts, failure types, and pool performance.
Last updated