Files
fxhnt/tests/integration
jgrusewski b5301a0fff feat(carry): 1m worst_basis ingest (binance.vision) + intraday-liquidation charge in carry accounting (Parquet side-store)
Charges the carry book's INTRADAY basis-squeeze / liquidation tail that the
daily-close basis accounting was blind to (probed: LUNAUSDT 2022-05-12 intraday
worst_basis ≈ −163% vs daily-close −0.7%).

- application/worst_basis.py — PURE cumulative-MAE: {epoch_day: worst_basis} =
  min over the day's aligned minutes of Σ(spot_1m_ret − perp_1m_ret).
- adapters/data/binance_vision_klines.py — resumable/cached 1m monthly-kline
  fetch+parse → {epoch_ms: close}; µs→ms, missing month = empty (no crash),
  injectable fetch (no network in tests).
- adapters/persistence/worst_basis_store.py — Parquet SIDE-STORE (duckdb I/O,
  NOT the warehouse → no single-writer contention) with load/write round-trip.
- paper_book.carry_return_by_symbol — optional worst_basis_by_symbol overrides
  the daily-close basis with max(worst_basis, −1.0) (capped at total leg loss);
  absent → daily-close basis, bit-identical. Threaded through paper_backfill
  (worst_basis_by_date) + paper_snapshot (worst_basis) + assets, live==replay.
- CLI: fxhnt ingest-worst-basis --symbols <list|@file> --from --to (resumable).
- TDD: LUNA-pattern fixture, parquet round-trip, charge+cap+fallback, absent=
  bit-identical backfill curve. Full suite 812 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 13:38:51 +02:00
..