docs: record the measured reach of the rate lookup

Ran the real lookup against both live APIs rather than the stubs. Three
findings worth being written down instead of rediscovered:

- Kraken returns ~721 daily candles, so ~2 years for any pair it quotes.
  EUR and GBP both resolve from it directly; the fallback never fires for
  them.
- CoinGecko's free tier answers within 365 days and returns 401
  Unauthorized beyond it — a plan limit wearing an auth error's clothes,
  not a transient failure. The practical ceiling is therefore ~2 years for
  major pairs and 1 year for anything else, which matters given the ask was
  "historical data for up to even a year".
- The two sources disagree by ~2.5% on the same date (2026-05-15: Kraken
  68,047.50 EUR/BTC, CoinGecko 69,743.26) — one exchange's daily close
  versus a cross-exchange average. Neither is wrong, which is the reason
  the ledger records rate_source beside rate rather than presenting a bare
  figure as canonical.

Refusal behaviour confirmed live: an unknown pair and a 2019 date both come
back None rather than falling through to some other number.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jy52j9GRZ6XKa1Zt21LLj
This commit is contained in:
Padreug 2026-08-31 21:44:21 +02:00
commit 2e6009b612
2 changed files with 31 additions and 0 deletions

View file

@ -67,6 +67,23 @@ exchange providers: those are spot tickers with no date parameter, and the
rate history behind the admin chart is RAM-only, single-currency and wiped
on restart.
How far back this actually reaches, measured against both live APIs:
| payday age | major pair (EUR, GBP, USD…) | currency Kraken doesn't quote |
|---|---|---|
| under 1 year | Kraken | CoinGecko |
| 1–2 years | Kraken | **unavailable** |
| over 2 years | **unavailable** | **unavailable** |
CoinGecko's free tier returns `401 Unauthorized` past 365 days — a plan
limit wearing an auth error's clothes. Unavailable means the period fails
and says so; it never guesses.
The two sources disagree by a couple of percent on the same date (for
2026-05-15: Kraken 68,047.50 EUR/BTC, CoinGecko 69,743.26 — one exchange's
close versus a cross-exchange average). That is why the ledger records
`rate_source` beside `rate` instead of presenting a bare figure as canonical.
Where payroll converts, it hands `create_invoice` a **sat** amount, because
`create_invoice` always prices fiat itself and cannot be told a rate. The
rate used and its source are recorded on the payout row either way — in