This content originally appeared on DEV Community and was authored by Pocket Portfolio
Real-time quotes fail in the wild. We designed a tiny edge-cached fallback layer so P/L stays fresh.
Problem
Free APIs rate-limit or go down. Users see zeros. Bad.
Approach
-
Client: requests
/prices
with a compact symbol list - Edge function: tries Provider A → B → C with timeouts
-
Envelope: we always return
{price, ts, source, fallbackUsed}
- Cache: hot-ticker TTL on the edge; cold paths bypass
- DX: dev overlay shows which source resolved
ts
type Quote = { s: string; p: number; ts: number; src: string; fb?: boolean }
## Trade-offs
**Slightly higher p99 latency, vastly better success rate**
**Deterministic error surfaces → easier bug reports**
## Help wanted (good first issues)
**Add provider health telemetry**
**Better batching for thin symbols**
**Unit tests for error envelopes**
## Repo → https://github.com/PocketPortfolio/Financialprofilenetwork
## Discord → link on the site (Office Hours: Wednesdays)
What would you improve in this design? PRs welcome.
This content originally appeared on DEV Community and was authored by Pocket Portfolio

Pocket Portfolio | Sciencx (2025-09-20T17:53:54+00:00) How our price fallbacks work (equities, FX, crypto) — resilient client edge design. Retrieved from https://www.scien.cx/2025/09/20/how-our-price-fallbacks-work-equities-fx-crypto-resilient-client-edge-design/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.