cftc-cot-weekly / data_dictionary.md
dragon-architect's picture
add LICENSE.txt and data dictionary, correct card links and attribution
de717ac verified
|
Raw
History Blame Contribute Delete
21.3 kB

Data dictionary

Every column of every shipped file, the canonical category definitions, the cadence-by-year table, the dropped columns appendix, and the leakage note. Positioning data only; no prices ship in any file.

Files

  • cot_panel_long (parquet primary; CSV split by family, gzipped): the tidy long panel.
  • cot_features_weekly (parquet; CSV split by family, gzipped): the model-ready wide features.
  • markets_reference (parquet and CSV): one row per code and family.
  • release_anomaly_calendar (parquet and CSV): documented publication and methodology events.

Parquet is the reference schema. The parquet files hold every column. The per-family gzipped CSVs DROP any column that is entirely null within that family, so a family's CSV and the unified parquet do NOT have the same columns. In the features table this removes the other families' category columns (a legacy CSV has no managed_money columns, and so on); in the long panel every column is populated, so its per-family CSVs keep the full column set. Read the parquet if you need one fixed schema across families.

Canonical trader categories

legacy

  • noncommercial: Large traders whose reported positions are not used for commercial hedging (speculators: managed funds, other large speculators).
  • commercial: Large traders who use futures to hedge a commercial business in the underlying commodity.
  • nonreportable: Small traders below the CFTC reporting threshold; a derived residual (open interest minus reportable positions). No trader counts exist for this category.

disaggregated

  • producer_merchant_processor_user: An entity that predominantly engages in the production, processing, packing, or handling of a physical commodity and uses futures to hedge it.
  • swap_dealers: An entity that deals primarily in swaps for a commodity and uses futures to manage or hedge the risk of those swap transactions.
  • managed_money: Registered commodity trading advisors, commodity pool operators, and hedge funds trading on behalf of clients.
  • other_reportables: Reportable traders not placed in the first three disaggregated categories.
  • nonreportable: Small traders below the reporting threshold; a derived residual. No trader counts.

tff

  • dealer_intermediary: Sell-side intermediaries (large banks and dealers) that earn commissions on client flow.
  • asset_manager_institutional: Institutional investors: pension funds, endowments, insurance companies, mutual funds, and portfolio managers.
  • leveraged_funds: Hedge funds and money managers, including CTAs and CPOs, typically engaged in speculative and arbitrage strategies.
  • other_reportables: Reportable traders not placed in the first three TFF categories.
  • nonreportable: Small traders below the reporting threshold; a derived residual. No trader counts.

cot_panel_long

Grain: one row per (report_date, cftc_contract_market_code, report_family, report_basis, trader_category).

column type definition
report_date date The as-of date published by the CFTC, usually a Tuesday. 163 of the 1,926 distinct dates are not Tuesdays: 139 in the early non weekly history (see the cadence table) and 24 holiday shifts since 1993, for example 2025-11-10, a Monday. No time, no timezone. Not the release date; see the release anomaly calendar.
cftc_contract_market_code string CFTC six-character contract market code. The join key. Codes can be reused over time; see market_key in the features table and is_spliced in the markets reference.
market_and_exchange_name string Market and exchange name as CFTC published it for that report.
report_family category legacy, disaggregated, or tff.
report_basis category futures_only or combined (futures plus options in futures-equivalents).
trader_category category Canonical trader category for the family (definitions above).
positions_long int (nullable) Long positions for the category.
positions_short int (nullable) Short positions for the category.
positions_spreading int (nullable) Spreading (offsetting long/short) positions; null where the family/category has no spreading concept (legacy commercial and nonreportable).
traders_long int (nullable) Number of traders long; null for nonreportable and where CFTC does not report it.
traders_short int (nullable) Number of traders short; null as above.
traders_spreading int (nullable) Number of traders spreading; null as above. (Beyond the guide's minimum columns, carried where the raw data provides it.)
pct_of_oi_long float Category long positions as a percent of open interest, as CFTC published it.
pct_of_oi_short float Category short positions as a percent of open interest.
pct_of_oi_spreading float Category spreading as a percent of open interest; null where no spreading concept.
report_weekday category Weekday of report_date, lowercase. Usually tuesday.
is_standard_tuesday bool True when report_date falls on a Tuesday; False for the 163 non Tuesday as-of dates. Derived from report_date only; says nothing about release timing.

cot_features_weekly

Grain: one row per (report_date, cftc_contract_market_code, report_family, report_basis). A wide table: the report-level columns below, then, for each trader category, six per-category feature columns.

Report-level columns

column type definition
cftc_contract_market_code string CFTC code (join key).
market_key string Splice-aware surrogate: the code, or {code}__s{n} for the n-th coherent contract segment of a reused code. Every window feature is partitioned on this, so no window crosses a contract boundary. Join external data on cftc_contract_market_code; use market_key to understand window continuity.
report_family category legacy, disaggregated, or tff.
report_basis category futures_only or combined.
report_date date The as-of date published by the CFTC, usually a Tuesday (see cot_panel_long).
report_weekday category Weekday of report_date, lowercase.
is_standard_tuesday bool True when report_date falls on a Tuesday.
open_interest int (nullable) Total open interest for the report.
oi_wow_change float Open interest change from the prior report within the market_key; null at the first report of a segment.
concentration_gross_4_long / _short float Percent of open interest held gross by the largest 4 traders, long and short (report-level, CFTC methodology).
concentration_gross_8_long / _short float Same for the largest 8 traders.
concentration_net_4_long / _short float Percent held net by the largest 4 traders.
concentration_net_8_long / _short float Percent held net by the largest 8 traders.
concentration_source_anomaly bool True where any of the eight concentration fields is outside 0 to 100 as CFTC published it (41 reports, all 1986 to 2003, largest 7,065.9 on 1987-05-15 code 039781 rough rice; verified identical in the PRE API and the bulk files). Raw values are carried unclipped; the flag separates unusual source records from pipeline defects.

Per-category columns (suffix is the category name; a family's row only populates its own categories, so cross-family category columns are null by design). For each category <cat>:

column type definition
net_<cat> float Net position: positions_long minus positions_short.
net_share_oi_<cat> float Net divided by open interest.
net_wow_change_<cat> float Net change from the prior report within the market_key; null at a segment's first report.
cot_index_52w_<cat> float COT index: 100 * (net - min) / (max - min) over the trailing 52 reports within the market_key. Null until 52 trailing reports exist, and null on a flat window (range zero).
cot_index_156w_<cat> float Same over the trailing 156 reports.
net_zscore_156w_<cat> float (net - mean) / std over the trailing 156 reports within the market_key. Null until 156 reports exist and null when std is zero.

Categories present as column suffixes: legacy noncommercial, commercial, nonreportable; disaggregated producer_merchant_processor_user, swap_dealers, managed_money, other_reportables, nonreportable; tff dealer_intermediary, asset_manager_institutional, leveraged_funds, other_reportables, nonreportable. nonreportable and other_reportables are shared column names populated by more than one family.

Leakage note

All window features (cot_index_*, net_zscore_156w_*, *_wow_change_*) are TRAILING windows ordered by report_date within market_key and describe the CURRENT report, which is standard COT index practice. They are not shifted. A forecasting user must apply their own lags and shift the target forward, exactly as the baseline notebook does (it builds its own lagged features, predicts the next report's change, and splits on the target's own report date). Windows are counted in reports, not calendar weeks; in the biweekly early era a 52-report window spans about two years.

Naming aliases (v2 rename plan)

Several feature names read as calendar time; their semantics are counted in published reports. wow means change from the prior published report within the market_key, whatever the calendar gap: one week at modern cadence, two weeks to a month in the early history, longer across a segment's documented interruptions. 52w and 156w mean 52 and 156 trailing reports, which span roughly two and six years in the early biweekly era. Rather than widening the schema with duplicate columns for a cosmetic issue, v1 documents the precise aliases here and v2 will rename the columns:

v1 column reads as precise meaning (v2 name)
oi_wow_change week over week oi_change_from_prior_report
net_wow_change_<cat> week over week net_change_from_prior_report_<cat>
cot_index_52w_<cat> 52 weeks cot_index_52_reports_<cat>
cot_index_156w_<cat> 156 weeks cot_index_156_reports_<cat>
net_zscore_156w_<cat> 156 weeks net_zscore_156_reports_<cat>

markets_reference

Grain: one row per (cftc_contract_market_code, report_family).

column type definition
cftc_contract_market_code string CFTC contract market code.
report_family category legacy, disaggregated, or tff.
last_name string Most recently observed market and exchange name.
first_name string Earliest observed market and exchange name.
n_distinct_names int Count of distinct names seen over the code's history for this family.
exchange string Exchange, parsed from the trailing segment of the last name.
commodity_name string CFTC commodity name (last observed).
cftc_commodity_code string CFTC commodity code (last observed).
cftc_market_code string CFTC market/exchange code in initials (last observed).
cftc_subgroup_code string CFTC subgroup code; provided for disaggregated and tff, null for legacy (legacy has no subgroup field).
first_report_date date First report_date for this code and family.
last_report_date date Last report_date for this code and family.
n_reports int Number of distinct report_dates.
active bool True if last_report_date is within about five weeks of the newest report in the dataset.
recent_open_interest int (nullable) Most recent open interest (futures_only preferred, else combined). Used for the top-market ranking.
is_consolidated bool True if the code ends in '+', a CFTC consolidated market (an aggregate of related contracts; see caveats and the release anomaly calendar).
is_spliced bool True if the code splices two different underlying contracts over time (see docs/contract_coherence.md); its history spans more than one market_key.
n_market_key_segments int Number of coherent contract segments (market_key values) for this code and family.
best_effort_ticker_root string Curated exchange root symbol for recognizable liquid markets; null otherwise. Best effort and many-to-one (see notes).
names_history string All distinct names with their first- and last-seen dates, in order.

best_effort_ticker_root notes

  • Best effort, not authoritative. A rough pointer to the exchange root symbol for recognizable liquid contracts. Roots also vary by data vendor (for example KE vs KW for KC wheat, MW vs MWE for Minneapolis wheat), which is why the column is labeled best effort.
  • Many-to-one, not a unique join key. Consolidated, e-mini, full-size, and micro codes can share a root (ES, NQ, YM). Joining external price data on the root alone will double count. Join on cftc_contract_market_code.
  • Scope. The map covers recognizable liquid contracts rather than strictly the top 50 by open interest: classic COT-followed markets (silver, platinum, the FX majors, coffee, cocoa) are included for recognition even where their current open interest ranks lower.
  • Deliberately unmapped (no standard single-symbol root): ICE natural gas basis swaps, RECs and carbon allowances, power hub contracts (PJM, ERCOT, nodal), ERIS SOFR swaps, and Coinbase nano crypto contracts.

release_anomaly_calendar

column type definition
window_start date Start of the affected window.
window_end date End of the affected window (approximate for some events; see source_note).
event string Short event name.
effect string What happened to COT publication or methodology, and the effect on the panel.
source_url string CFTC source page.
source_note string Provenance and any data-derived verification.

Cadence by year (legacy futures-only backbone)

Early history is not weekly; sparse early years are cadence, not gaps.

years cadence reports/year
1986–1992 biweekly 24–31
1993–2026 weekly 27–53 (2026 partial)

Dropped columns appendix

Every raw PRE field not carried into the panel, with the reason. The panel carries harmonized positions, trader counts, and percent-of-OI; the dropped fields are crop-year (old/other) splits, week-over-week changes recomputed in the features table, total-reportable aggregates recoverable from the categories, and PRE bookkeeping.

legacy (91 raw fields dropped)

reason count example raw fields
old/other crop year split, out of v1 scope 71 open_interest_old, noncomm_positions_long_old, noncomm_positions_short_old, comm_positions_long_old, comm_positions_short_old, tot_rept_positions_long_old
week over week change, derivable; features table computes oi_wow_change and net_wow_change 10 change_in_open_interest_all, change_in_noncomm_long_all, change_in_noncomm_short_all, change_in_noncomm_spead_all, change_in_comm_long_all, change_in_comm_short_all
total reportable, derivable as the sum of reportable categories; QA checks the identity (on consolidated markets CFTC rounding can put the published total a contract or two off the category sum; QA quantifies) 6 tot_rept_positions_long_all, tot_rept_positions_short, pct_of_oi_tot_rept_long_all, pct_of_oi_tot_rept_short, traders_tot_rept_long_all, traders_tot_rept_short_all
PRE row bookkeeping id, no analytical content 1 id
report week label, derivable from report_date 1 yyyy_report_week_ww
old/other crop year split, out of v1 scope (unsuffixed name; All block uses noncomm_postions_spread_all) 1 noncomm_positions_spread
percent of open interest represented by the All block, constant 100 1 pct_of_open_interest_all

disaggregated (133 raw fields dropped)

reason count example raw fields
old/other crop year split, out of v1 scope 108 open_interest_old, prod_merc_positions_long_1, prod_merc_positions_short_1, swap_positions_long_old, swap__positions_short_old, swap__positions_spread_old
week over week change, derivable; features table computes oi_wow_change and net_wow_change 16 change_in_open_interest_all, change_in_prod_merc_long, change_in_prod_merc_short, change_in_swap_long_all, change_in_swap_short_all, change_in_swap_spread_all
total reportable, derivable as the sum of reportable categories; QA checks the identity (on consolidated markets CFTC rounding can put the published total a contract or two off the category sum; QA quantifies) 6 tot_rept_positions_long_all, tot_rept_positions_short, pct_of_oi_tot_rept_long_all, pct_of_oi_tot_rept_short, traders_tot_rept_long_all, traders_tot_rept_short_all
PRE row bookkeeping id, no analytical content 1 id
report week label, derivable from report_date 1 yyyy_report_week_ww
percent of open interest represented by the All block, constant 100 1 pct_of_open_interest_all

tff (26 raw fields dropped)

reason count example raw fields
week over week change, derivable; features table computes oi_wow_change and net_wow_change 17 change_in_open_interest_all, change_in_dealer_long_all, change_in_dealer_short_all, change_in_dealer_spread_all, change_in_asset_mgr_long, change_in_asset_mgr_short
total reportable, derivable as the sum of reportable categories; QA checks the identity (on consolidated markets CFTC rounding can put the published total a contract or two off the category sum; QA quantifies) 6 tot_rept_positions_long_all, tot_rept_positions_short, pct_of_oi_tot_rept_long_all, pct_of_oi_tot_rept_short, traders_tot_rept_long_all, traders_tot_rept_short_all
PRE row bookkeeping id, no analytical content 1 id
report week label, derivable from report_date 1 yyyy_report_week_ww
percent of open interest represented by the All block, constant 100 1 pct_of_open_interest_all

Caveats

  • Positioning data only. No prices. The market reference map provides join keys; users bring their own price data under their own licenses.
  • Trader classification is self-reported business purpose on CFTC Form 40, subject to CFTC reclassification. Categories are regulatory classifications, not strategy labels.
  • report_date is the as of date published by the CFTC, usually Tuesday close; 163 dates are not Tuesdays (the early non weekly history plus holiday shifts like the Monday 2025-11-10). The report_weekday and is_standard_tuesday columns make the exceptions filterable. Releases are usually Friday 3:30 pm ET, shift around holidays, and are irregular during documented events. Use the release anomaly calendar; never assume report_date plus three days.
  • The October to December 2025 window: report_dates are complete after the chronological backfill, but original release timing was interrupted by the appropriations lapse. Documented, not hidden.
  • Early history cadence is not weekly; see the cadence by year table.
  • Combined basis converts options to futures equivalents using exchange supplied deltas (CFTC methodology).
  • Nonreportable is a derived residual (open interest minus reportable positions); trader counts do not exist for it, and in thin early markets it can be negative or its percent can fall outside 0 to 100. These are values CFTC published and are carried unchanged.
  • Contract consolidation methodology has changed over time per CFTC announcements; the panel reports what the CFTC published for each date. A consolidated code (is_consolidated, code ends in '+') aggregates several contracts and its composition can shift over time, so a window feature on a consolidated code can span a changing basket. See the release anomaly calendar.
  • CFTC reuses contract market codes. Where a code splices two different underlying contracts, the features table separates them with market_key so window features never blend them; is_spliced flags these in the markets reference.
  • Grain recoding on 1998-01-06: the bushel grains moved to new contract codes (corn 002601 to 002602, Chicago wheat 001601 to 001602, soybeans 005601 to 005602). Do not chain the pre 1998 and post 1998 series; they are different codes. Open interest scale falls about five fold at the boundary (corn 4.9x, wheat 4.8x, soybeans 5.2x) while soybean oil and meal, which are not bushel denominated, are unaffected. The roughly five fold change is consistent with a shift from a thousand bushel unit to standard 5,000 bushel contracts; the exact prior unit is not documented on the CFTC pages checked, so the calendar reports only what is observed. See the release anomaly calendar.
  • Open interest identities hold to within about one contract because CFTC rounds each published figure independently; category component sums can differ from open interest by a few contracts.