Skip to content

Phase 1: foundation — simulators, data layer, chain scraper - #1

Merged
NavyBlueCheese merged 5 commits into
mainfrom
phase-1/foundation
Jul 9, 2026
Merged

Phase 1: foundation — simulators, data layer, chain scraper#1
NavyBlueCheese merged 5 commits into
mainfrom
phase-1/foundation

Conversation

@NavyBlueCheese

Copy link
Copy Markdown
Owner

What was built

  • Scaffold: uv-managed Python 3.12 environment with committed lockfile; ruff (lint+format), mypy --strict, pytest with 85% coverage gate, CI on every push; every numeric assumption lives in configs/default.yaml.
  • Simulators first (src/fxvrp/simulate): exact GBM; Heston via full-truncation Euler recording per-path integrated variance; Merton jump diffusion with per-jump bookkeeping; additive Gaussian noise and Roll bid-ask bounce.
  • Data layer (src/fxvrp/data): resumable Dukascopy .bi5 tick ingestion to per-day parquet (ADR 0003); FRED and ECB rate loaders; CBOE delayed-quotes chain scraper for FXE/_SPX/FXY/FXB/UUP (ADR 0002); chain cleaning with fully-logged drops; per-day tick quality metrics.
  • Scripts: fetch_rates, scrape_chains (idempotent per quote date), ingest_ticks (resumable), data_quality_report.

Test results

56 passed, 0 failed; coverage 90.75% (gate 85%); mypy --strict clean on 17 source files; ruff clean. Ground-truth self-consistency includes: GBM/Merton moment and martingale checks against Monte Carlo error bounds, Heston integrated variance vs the analytic CIR mean, the naive-RV-diverges-under-noise signature (demonstrated, not assumed), Roll negative first-order autocovariance, .bi5 decode round-trips, and chain-cleaning reconciliation (input = output + logged drops).

Known limitations / uncertainties

  • Heston long-horizon mean-reversion test tolerates O(dt) Euler bias explicitly; acceptable for ground-truth use at the step sizes we simulate.
  • The scraped forward panel is irreproducible history in a gitignored directory — needs to be in the machine backup routine.
  • FRED EVZCLS is discontinued (2025-03-11); the loader will simply stop finding new data, by design.

Python 3.12 via uv with committed lockfile. All numeric assumptions
live in configs/default.yaml; CI gates on lint, format, strict types
and 85% coverage.
…ture noise

Exact log-normal GBM stepping; Heston via full-truncation Euler (Lord,
Koekkoek & van Dijk 2010) recording per-path integrated variance,
cross-checked against the analytic CIR mean; Merton (1976) with
compensated drift and per-jump bookkeeping so jump variation is known
exactly; additive noise (Zhang-Mykland-Ait-Sahalia 2005 setting) and
Roll (1984) bid-ask bounce.

Self-consistency suite: moment matching within Monte Carlo error,
martingale checks, sum-of-squared-returns vs integrated variance, the
naive-RV-diverges-under-noise signature, and Roll negative first-order
autocovariance. Property tests via hypothesis.
…uality metrics

Dukascopy .bi5 decoded directly in Python (ADR 0003): resumable
per-day parquet with retries and throttling; decoder unit-tested
against crafted payloads, empty weekend hours are valid. FRED
fredgraph parser keeps missing markers as nulls; ECB SDMX parser for
the EONIA->ESTR splice. CBOE delayed-quotes scraper for FXE/_SPX and
minor currency ETFs (ADR 0002), OCC symbology parsed from the
fixed-width tail, quote timestamps stored ET->UTC. Chain cleaning
logs every dropped row by reason and reconciles input = output +
drops as a unit test. Per-day tick quality metrics feed the report
script.
…ality report

The 2020-03-16..25 hour files (peak COVID tick volume) exceed a 30s
request timeout; 90s ingests the whole sample window with zero
failures. Quality report covers 26 days of March 2020 plus the first
five chain snapshots.
@NavyBlueCheese
NavyBlueCheese merged commit 5ef6c15 into main Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant