One on-chain call for a thousand clients: quote coalescing at the edge

BlazePhoenix Engineering · updated 2026-07-17 · 6 min · written from the deployed bytecode

Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص

EnglishIdentical concurrent quote requests share ONE on-chain call (singleflight), previews are edge-cached for one block, and meta.cache discloses miss/coalesced/hit — efficiency that is transparent, never magical.

PortuguêsPedidos de cotação idênticos e simultâneos partilham UMA chamada on-chain (singleflight), previews ficam em cache na edge por um bloco, e meta.cache revela miss/coalesced/hit — eficiência transparente, nunca mágica.

EspañolLas solicitudes de cotización idénticas y simultáneas comparten UNA llamada en cadena (singleflight), las vistas previas se cachean en el borde durante un bloque, y meta.cache revela miss/coalesced/hit — eficiencia transparente, nunca mágica.

FrançaisLes requêtes de cotation identiques et simultanées partagent UN appel on-chain (singleflight), les aperçus sont mis en cache en périphérie pendant un bloc, et meta.cache révèle miss/coalesced/hit — une efficacité transparente, jamais magique.

DeutschIdentische gleichzeitige Kursanfragen teilen sich EINEN On-Chain-Call (Singleflight), Previews werden einen Block lang am Edge gecacht, und meta.cache legt miss/coalesced/hit offen — Effizienz, die transparent ist, nie magisch.

РусскийОдинаковые одновременные запросы котировок делят ОДИН он-чейн вызов (singleflight), превью кэшируются на границе на один блок, а meta.cache раскрывает miss/coalesced/hit — эффективность прозрачная, а не волшебная.

TürkçeAynı anda gelen özdeş fiyat istekleri TEK zincir üstü çağrıyı paylaşır (singleflight), önizlemeler bir blok boyunca uçta önbelleğe alınır ve meta.cache miss/coalesced/hit'i açıklar — şeffaf verimlilik, asla sihir değil.

العربيةطلبات الأسعار المتطابقة المتزامنة تتشارك نداءً واحداً على السلسلة (singleflight)، وتُخزَّن المعاينات على الحافة لمدة كتلة واحدة، ويكشف meta.cache عن miss/coalesced/hit — كفاءة شفافة لا سحرية أبداً.

हिन्दीएक जैसे समवर्ती कोट अनुरोध एक ही ऑन-चेन कॉल साझा करते हैं (singleflight), पूर्वावलोकन एक ब्लॉक तक एज पर कैश रहते हैं, और meta.cache miss/coalesced/hit बताता है — दक्षता पारदर्शी है, जादुई कभी नहीं।

日本語同一の同時見積もりリクエストはオンチェーン呼び出しを1回だけ共有し(singleflight)、プレビューは1ブロック分エッジにキャッシュされ、meta.cacheがmiss/coalesced/hitを開示します。効率は透明であり、決して魔法ではありません。

中文相同的并发报价请求共享一次链上调用(singleflight),预览在边缘缓存一个区块时长,meta.cache 披露 miss/coalesced/hit——效率是透明的,而非魔术。

한국어동일한 동시 견적 요청은 온체인 호출 하나를 공유하고(singleflight), 프리뷰는 한 블록 동안 엣지에 캐시되며, meta.cache가 miss/coalesced/hit을 공개합니다. 효율은 투명하지, 결코 마법이 아닙니다.

Bahasa IndonesiaPermintaan kuotasi identik yang bersamaan berbagi SATU panggilan on-chain (singleflight), pratinjau di-cache di edge selama satu blok, dan meta.cache mengungkap miss/coalesced/hit — efisiensi yang transparan, tak pernah ajaib.

বাংলাঅভিন্ন সমবর্তী কোট অনুরোধগুলি একটিই অন-চেইন কল ভাগ করে (singleflight), প্রিভিউ এক ব্লক ধরে এজে ক্যাশ থাকে, এবং meta.cache miss/coalesced/hit প্রকাশ করে — দক্ষতা স্বচ্ছ, কখনো জাদুকরি নয়।

FilipinoAng magkakaparehong sabay-sabay na quote request ay nagbabahagi ng IISANG on-chain call (singleflight), naka-cache sa edge ang previews nang isang block, at isinisiwalat ng meta.cache ang miss/coalesced/hit — episyenteng transparente, hindi kailanman mahika.

A public quote API has a scaling paradox: the data is expensive to produce (an eth_call per quote) but identical for everyone asking the same question in the same block. A thousand bots polling WETH→USDC on Base within two seconds need ONE on-chain answer, not a thousand.

The edge worker treats identical in-flight requests as one: the first arrival becomes the leader and performs the real on-chain call; every concurrent duplicate becomes a follower that waits on the same promise and receives a clone of the leader's result. This is the singleflight pattern, applied per quote-key (chain, tokens, amount, mode).

Cache for exactly one block, never for execution

Completed previews are edge-cached for roughly one block time (2s on the L2s, 10s on Ethereum) — long enough to absorb a poll storm, short enough that no client acts on stale state. Two request classes are NEVER cached: exact-mode requotes and requests carrying a recipient (which return signable calldata). Anything that could be executed must be computed fresh.

Every response discloses its provenance in meta.cache: miss (you caused the on-chain call), coalesced (you shared a concurrent leader's call), or hit (served from the one-block edge cache). Integrators can poll freely and audit exactly what the API did — the efficiency layer is transparent instead of magical.

Do not trust this page — reproduce it

Every claim above is checkable against the chain. Start here:

fire 10 parallel identical GETs at /api/quote and read meta.cache across the responses — one miss, the rest coalesced/hit

Contracts are verified on every chain we deploy to — addresses in the protocol manifest. Deeper formal treatment: the whitepaper (PDF).

Related engineering