0xklen-estimate-searcher-latency-budget
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md358 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Estimate a searcher latency budget
A searcher wins by arriving before the profit is gone; the budget is the wall-clock window from seeing a pending opportunity to the winning relay accepting your bundle, and every millisecond of it is spent somewhere you can measure.
Procedure
-
Fix the reference point: the timestamp of the first event you could have acted on — a new pending swap via a transaction feed, or the new head via a block feed. Log it in epoch milliseconds.
-
Instrument each stage to the millisecond:
- feed receipt -> decode (usually 1–5 ms)
- decode -> simulation (10–100 ms depending on the simulator)
- simulation -> bundle signing (2–20 ms)
- signing -> relay
eth_sendBundleresponse (10–200 ms across regions)
curl -w "%{time_total}s\n" -o /dev/null -s https://relay.flashbots.net -X POST -d @bundle.json -
Sum the stages and compare to the block time. On Ethereum at 12 s you have room; on a 2 s L2 or with a 250 ms builder cutoff you do not, and the decode stage alone can decide the race.
-
Prefer a low-latency feed over a general RPC. A push feed (bloXroute, a geyser-style gRPC stream) delivers pending transactions in milliseconds, while polling a public RPC's
txpooladds 100 s of ms of jitter. -
Co-locate with the relay you submit to, not the node you read from. A 40 ms RTT difference between AWS regions is often more than the entire profit window on a competitive pair.
-
Cut simulation time with state overrides and a local fork of the pool instead of a full
eth_callBundleround-trip when the deadline is tight; reserve the relay simulator for final validation. -
Set a deadline: if the bundle cannot be signed and sent within
budget * 0.8, drop the attempt. A late submission risks landing in a worse position than not competing. -
Re-measure weekly. Latency budgets drift as competitors colocate and builders tighten cutoffs; yesterday's winning budget is today's losing one.
Pitfalls
- Measuring from your own log line rather than from feed receipt; the transport skew is exactly what you are trying to shrink.
- Ignoring clock skew between your host and the relay; use NTP or chrony and verify drift, or all your stage timings are fictional.
- Optimizing decode while the relay RTT dominates. Profile before choosing a target.
- Assuming a local node is low latency because it is local: disk-backed pools and mempool reconstruction can be slower than a hosted feed.
- Forgetting that bundle ordering at the relay is per block; arriving first means nothing if your bid loses.
- Benchmarking against a quiet chain; volatile blocks compress the window because searchers react faster to bigger value.
Verification
curl -w "%{time_total}s\n" -o /dev/null -s https://relay.flashbots.net -X POST -d @bundle.json
Log epoch-ms at feed receipt and at relay response for 100 opportunities; median end-to-end under budget * 0.8 and p95 under the budget means the searcher is competitive. Report each stage and the p50/p95 totals.
04 同仓库更多 Skills
troves
Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.
trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
send
Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
portfolio
View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".
multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.