Fetch and cache a coin price without hammering the API
One request per interval for the whole site, an atomic cache write, and a stale copy served rather than nothing when the feed is down.
Fetching, caching and sanity-checking coin prices before you pay anyone with them.
4 entries
One request per interval for the whole site, an atomic cache write, and a stale copy served rather than nothing when the feed is down.
One API returning a wrong number should not decide what you pay. Three sources and a median makes a single bad quote irrelevant.
The guard that turns a dead price feed into a delayed payout instead of a wrong one. Fail closed, log loudly, retry later.
Store the reward in USD, convert at claim time, and clamp the movement so a price spike cannot empty the faucet in an afternoon.