How our price fallbacks work (equities, FX, crypto) — resilient client edge design

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


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » How our price fallbacks work (equities, FX, crypto) — resilient client edge design." Pocket Portfolio | Sciencx - Saturday September 20, 2025, https://www.scien.cx/2025/09/20/how-our-price-fallbacks-work-equities-fx-crypto-resilient-client-edge-design/
HARVARD
Pocket Portfolio | Sciencx Saturday September 20, 2025 » How our price fallbacks work (equities, FX, crypto) — resilient client edge design., viewed ,<https://www.scien.cx/2025/09/20/how-our-price-fallbacks-work-equities-fx-crypto-resilient-client-edge-design/>
VANCOUVER
Pocket Portfolio | Sciencx - » How our price fallbacks work (equities, FX, crypto) — resilient client edge design. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/20/how-our-price-fallbacks-work-equities-fx-crypto-resilient-client-edge-design/
CHICAGO
" » How our price fallbacks work (equities, FX, crypto) — resilient client edge design." Pocket Portfolio | Sciencx - Accessed . https://www.scien.cx/2025/09/20/how-our-price-fallbacks-work-equities-fx-crypto-resilient-client-edge-design/
IEEE
" » How our price fallbacks work (equities, FX, crypto) — resilient client edge design." Pocket Portfolio | Sciencx [Online]. Available: https://www.scien.cx/2025/09/20/how-our-price-fallbacks-work-equities-fx-crypto-resilient-client-edge-design/. [Accessed: ]
rf:citation
» How our price fallbacks work (equities, FX, crypto) — resilient client edge design | Pocket Portfolio | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.