Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/cotdata/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ Energies:
cftc_code: "022651"
NG:
cftc_code: "023651"
# Added 2026-08-04 for crowdmon's contract-spec backlog. NOT a duplicate of CL: open
# interest tracks it (0.771) but Managed Money net is negative and flow correlation is
# near zero, so it is a different holder base (crowdmon
# docs/design/amendments-2026-08-03.md §C15). Norgate carries it as &WBS.
WBS: # WTI Crude Oil (ICE Futures Europe)
cftc_code: "067411"
databento: null # ICE product — not on GLBX.MDP3

Grains:
ZC:
Expand All @@ -62,6 +69,12 @@ Grains:
cftc_code: "007601"
ZW:
cftc_code: "001602"
# Added 2026-08-04 for crowdmon's contract-spec backlog: the smallest market of the ten
# candidates and the strongest on the criterion that decides, Managed Money share 0.433
# against a covered median of 0.137 (crowdmon docs/design/amendments-2026-08-03.md §C17,
# decision in docs/handoffs/2026-08-03-spec-backlog-producer.md §9).
ZR: # Rough Rice (CBOT)
cftc_code: "039601"
# Held-out generalization grains (new symbols, never in the deploy selection).
ZO: # Oats (CBOT)
cftc_code: "004603"
Expand Down
10 changes: 7 additions & 3 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# ── loading & basic shape ────────────────────────────────────────────────────
def test_registry_loads_all_symbols():
symbols = all_symbols()
assert len(symbols) == 49, f"Expected 49 symbols, got {len(symbols)}"
assert len(symbols) == 51, f"Expected 51 symbols, got {len(symbols)}"


def test_basic_symbol_loading():
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_by_asset_class():
# ── hashability (frozen dataclass must stay hashable, incl. scaled hist_codes) ─
def test_symbols_are_hashable():
# Would raise TypeError: unhashable type 'list' if hist_codes held a list.
assert len(set(all_symbols())) == 49
assert len(set(all_symbols())) == 51
assert symbol("LBR") in {symbol("LBR")}
hash(symbol("LBR")) # scaled hist_codes — the tricky one

Expand Down Expand Up @@ -247,5 +247,9 @@ def test_golden_identity_checksum():
(registry.yaml carries FIXED identity only; unintended drift is a bug)."""
ident = sorted((s.internal, s.cftc_code, s.asset_class) for s in all_symbols())
digest = hashlib.md5(repr(ident).encode()).hexdigest()
assert digest == "e6b0b92caa0f25f68dea62024bddf899", (
# Updated 2026-08-04 for a deliberate addition: ZR (rough rice, 039601) and WBS
# (ICE Europe WTI, 067411), the two codes of crowdmon's contract-spec backlog that
# Norgate actually carries. Previous value e6b0b92caa0f25f68dea62024bddf899, over 49
# symbols.
assert digest == "3dd3df8eb26d850654107e16568cddb6", (
"registry identity facts changed; update the expected checksum if intended")
Loading