FX: USD Pivot, Two-Layer Cache, Stale-While-Revalidate

Part of the Sanchayam series. Why FX Matters Sanchayam tracks assets in their native currency. An Indian equity is priced in INR. A US stock is priced in USD. Crypto may be in USD or USDT. A bank account might be in AED. The portfolio view needs to aggregate everything into one base currency (the user’s choice - INR by default). Every portfolio snapshot, every holdings page, every P&L calculation requires converting across currencies. FX rates are fetched from the same Twelve Data API used for price feeds. A naive approach - one API call per currency per request - would be both slow and expensive. ...

April 20, 2026 · 4 min · 771 words · Sagar Nayak