feat(market): add selectable chart ranges (24h/7d/30d/1y/all) with range-aware API caching and downsampling

This commit is contained in:
2026-03-10 19:25:23 +01:00
parent 54fe876a8c
commit 6cb038688f
8 changed files with 178 additions and 47 deletions

View File

@@ -161,9 +161,10 @@ If empty, the app uses the local default (`/api/rates`).
- `GET /api/convert?from=USD&to=BTC&amount=100`
- Converts between any supported fiat/crypto pair using current normalized rates.
- Example response fields: `amount`, `convertedAmount`, `rate`, `inverseRate`, `updatedAt`, `sources`.
- `GET /api/market?code=BTC`
- `GET /api/market?code=BTC&range=24h`
- Returns CoinGecko-based market snapshot for a crypto asset.
- Example response fields: `priceUsd`, `change24hPct`, `marketCapUsd`, `volume24hUsd`, `priceHistory24h`, `updatedAt`.
- Supported ranges: `24h`, `7d`, `30d`, `1y`, `all`.
- Example response fields: `priceUsd`, `change24hPct`, `marketCapUsd`, `volume24hUsd`, `priceHistoryRange`, `priceHistory`, `updatedAt`.
## Architecture Notes