Market Data Operations Runbook
Prepared: 2026-07-02 UTC
Standard PMData Extension Flow
- Download new PMData dates.
python3 scripts/download_pmdata.py \
--start-date 2026-04-01 \
--end-date 2026-04-07 \
--series btc-5m \
--data-type poly_l2 \
--data-type polygon_trades \
--manifest reports/pmdata_btc_5m_20260401_20260407_download_manifest.json
- Audit the new range.
python3 scripts/audit_pmdata_range.py \
--start-date 2026-04-01 \
--end-date 2026-04-07 \
--series btc-5m \
--out reports/pmdata_btc_5m_20260401_20260407_audit.json
- Rebuild the global catalog.
python3 scripts/build_dataset_catalog.py
- Upload to Hugging Face.
python3 scripts/upload_market_data_to_hf.py \
--repo-id <owner>/<dataset-name> \
--start-date 2026-04-01 \
--end-date 2026-04-07 \
--token-stdin
- Verify the remote by downloading only one day into
/tmp.
python3 scripts/download_hf_pmdata_range.py \
--repo-id <owner>/<dataset-name> \
--start-date 2026-04-01 \
--end-date 2026-04-01 \
--data-type poly_l2 \
--out-dir /tmp/pmdata_hf_verify \
--include-metadata
Quality Rules
- Every downloaded range gets a manifest and audit JSON.
- Every upload must include refreshed catalog files.
- Short archives are allowed only if they are documented in
pmdata_missing_windows.csv. - Backtests must use the missing-window mask; do not silently forward-fill missing L2 windows.
- Keep Hugging Face datasets private unless redistribution rights are confirmed.
- Never write PMData or Hugging Face API keys into scripts, docs, manifests, or shell history.
Local Space Management
The local PMData folder is a cache, not the permanent source of truth after upload:
data/pmdata/btc-5m/YYYY-MM-DD/
After a successful upload and remote spot-check, old local date ranges can be removed if space is needed. Keep the catalogs and reports.
Backtester Integration Rule
For execution-quality strategy runs:
- PMData
poly_l2: primary source. - PMData
polygon_trades: audit/reconciliation source. - DOME: baseline and fallback source.
Every run should record whether a window was:
pmdata_completepmdata_missing_excludeddome_fallbackmixed_or_patched
This prevents mixed data quality from being hidden inside a single PnL result.