oil029_sample / README.md
wangdx25's picture
Add TsFile (converted from xpertsystems/oil029-sample)
c1ff53d verified
|
Raw History Blame Contribute Delete
9.64 kB
metadata
license: cc-by-nc-4.0
task_categories:
  - tabular-classification
  - tabular-regression
  - time-series-forecasting
language:
  - en
tags:
  - tsfile
  - timeseries
  - time-series
  - synthetic
  - oil-and-gas
  - commodities
  - crude-oil
  - wti
  - brent
  - futures
  - volatility-surface
  - garch
  - quantitative-finance
  - xpertsystems
  - format:tsfile
pretty_name: OIL-029 — Synthetic Crude Oil Price Dataset (Sample) (TsFile)
size_categories:
  - 100K<n<1M
configs:
  - config_name: default
    data_files:
      - split: calendar_spreads
        path: calendar_spreads.tsfile
      - split: crude_spot_prices
        path: crude_spot_prices.tsfile
      - split: futures_curves
        path: futures_curves.tsfile
      - split: intraday_trading
        path: intraday_trading.tsfile
      - split: inventory_levels
        path: inventory_levels.tsfile
      - split: macro_factors
        path: macro_factors.tsfile
      - split: opec_events
        path: opec_events.tsfile
      - split: rare_events
        path: rare_events.tsfile
      - split: refinery_demand
        path: refinery_demand.tsfile
      - split: tanker_disruptions
        path: tanker_disruptions.tsfile
      - split: trading_labels
        path: trading_labels.tsfile
      - split: volatility_surfaces
        path: volatility_surfaces.tsfile

OIL-029 — Synthetic Crude Oil Price Dataset (Sample) (TsFile)

Apache TsFile version of xpertsystems/oil029-sample.

Overview

A free, schema-identical preview of XpertSystems.ai's enterprise crude oil price dataset for quantitative trading, futures curve analytics, options volatility surface ML, regime classification, commodity risk management, trading signal generation, and macro-coupled price forecasting. The sample covers 2,200 business days (~8.5 years) of WTI + Brent + futures + options + macro data, with 195,842 rows linked across 12 tables.

  • Tables: 12 TsFile table(s), 195,842 rows in total.
    • calendar_spreads: 2,200 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00 (UTC)
    • crude_spot_prices: 2,200 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00 (UTC)
    • futures_curves: 26,400 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00.011000 (UTC)
    • intraday_trading: 17,600 rows, 2015-01-02 00:00:00 → 2023-06-08 05:41:00 (UTC)
    • inventory_levels: 2,200 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00 (UTC)
    • macro_factors: 2,200 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00 (UTC)
    • opec_events: 24 rows, 2015-04-30 00:00:00 → 2023-05-23 00:00:00 (UTC)
    • rare_events: 11 rows, 2015-03-09 00:00:00 → 2022-11-22 00:00:00 (UTC)
    • refinery_demand: 2,200 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00 (UTC)
    • tanker_disruptions: 7 rows, 2016-12-29 00:00:00 → 2022-10-24 00:00:00 (UTC)
    • trading_labels: 2,200 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00 (UTC)
    • volatility_surfaces: 138,600 rows, 2015-01-02 00:00:00 → 2023-06-08 00:00:00.062000 (UTC)

Schema (TsFile structure)

calendar_spreads.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (5): front_second_spread (double), front_sixth_spread (double), front_twelfth_spread (double), curve_slope (double), curve_state (string)

crude_spot_prices.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (7): regime (string), wti_price (double), brent_price (double), wti_brent_spread (double), log_return_wti (double), log_return_brent (double), realized_vol_annualized (double)

futures_curves.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (9): benchmark (string), contract_month (int64), time_to_expiry_years (double), spot_price (double), futures_price (double), storage_cost (double), convenience_yield (double), risk_free_rate (double), curve_state_score (double)

intraday_trading.tsfile

  • Time (INT64, milliseconds) — the source timestamp column.
  • TAG: none — the table is stored as a single device.
  • FIELD (9): market_date (string), bar_index (int64), benchmark (string), mid_price (double), bid (double), ask (double), bid_ask_spread (double), trade_volume (int64), liquidity_state (string)

inventory_levels.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (3): inventory_bbl (int64), regime (string), rare_event_flag (int64)

macro_factors.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (5): dxy (double), fed_rate (double), inflation_rate (double), us_rig_count (int64), regime (string)

opec_events.tsfile

  • Time (INT64, milliseconds) — the source event_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (4): event_type (string), production_change_bpd (int64), market_surprise_score (double), expected_price_impact_pct (double)

rare_events.tsfile

  • Time (INT64, milliseconds) — the source event_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (6): event_type (string), severity_score (double), wti_price (double), brent_price (double), realized_vol_annualized (double), regime (string)

refinery_demand.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (6): refinery_run_rate_pct (double), gasoline_crack_spread (double), diesel_crack_spread (double), jet_crack_spread (double), seasonality_index (double), outage_flag (int64)

tanker_disruptions.tsfile

  • Time (INT64, milliseconds) — the source event_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (5): region (string), disruption_type (string), duration_hours (int64), affected_volume_bpd (int64), freight_rate_impact_pct (double)

trading_labels.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (6): regime_label (string), curve_state (string), volatility_state (string), crisis_label (string), target_5d_direction (string), trading_signal_label (string)

volatility_surfaces.tsfile

  • Time (INT64, milliseconds) — the source market_date column.
  • TAG: none — the table is stored as a single device.
  • FIELD (9): benchmark (string), expiry_days (int64), strike_moneyness (double), spot_price (double), strike (double), implied_vol (double), vol_skew_component (double), vol_smile_component (double), regime (string)

Conversion notes

  • One TsFile per source CSV (12 tables); each table is stored as a single device, so the rig / well / tank / equipment / sensor identifiers stay ordinary FIELDs.
  • Time = the table's own clock column as INT64 milliseconds (event timestamps, sample or inspection dates, and daily record dates). The clock columns used here are event_date, market_date, timestamp.
  • No column is dropped. Rows that share a timestamp are ordered by a 1 ms step in stable source order, so daily tables keep their exact calendar day.

Usage

Read this dataset with the Java SDK. It is written with the zstd compressor. The Apache TsFile Java SDK reads every compressor, but the Python SDK (pip install tsfile) implements only UNCOMPRESSED, SNAPPY, GZIP and LZ4; opening this file with it yields no rows.

Read a converted file with the Apache TsFile Java SDK (org.apache.tsfile:tsfile):

import org.apache.tsfile.file.metadata.IDeviceID;
import org.apache.tsfile.read.TsFileReader;
import org.apache.tsfile.read.TsFileSequenceReader;
import org.apache.tsfile.read.common.Path;
import org.apache.tsfile.read.expression.QueryExpression;
import org.apache.tsfile.read.query.dataset.QueryDataSet;
import org.apache.tsfile.write.schema.MeasurementSchema;

import java.util.ArrayList;
import java.util.List;

String path = "calendar_spreads.tsfile";
try (TsFileSequenceReader sequenceReader = new TsFileSequenceReader(path);
     TsFileReader reader = new TsFileReader(sequenceReader)) {
    // Devices are enumerated as IDeviceID objects. Tables with TAG columns
    // have multi-segment device ids that cannot be rebuilt from their string
    // form, so always use getAllDevices() rather than getAllDeviceIds().
    for (IDeviceID device : sequenceReader.getAllDevices()) {
        List<Path> paths = new ArrayList<>();
        for (MeasurementSchema schema : reader.getMeasurement(device)) {
            String name = schema.getMeasurementName();
            if (name != null && !name.isEmpty() && !name.equalsIgnoreCase("Time")) {
                paths.add(new Path(device, name, true));
            }
        }
        QueryDataSet dataSet = reader.query(QueryExpression.create(paths, null));
        while (dataSet.hasNext()) {
            System.out.println(dataSet.next());
        }
    }
}

Source & license

  • Original dataset: xpertsystems/oil029-sample
  • Source card title: OIL-029 — Synthetic Crude Oil Price Dataset (Sample)
  • License: cc-by-nc-4.0 (as declared by the original dataset).