# Generated by tools/build_contracts.py from tools/algoseek_catalog.py -- do not edit by hand.
# Open Data Contract Standard v3.2.0 (https://bitol-io.github.io/open-data-contract-standard/).
apiVersion: v3.2.0
kind: DataContract
id: urn:alphaswarm:datacontract:algoseek:us-equities-industry-standard-daily-ohlc
name: AlgoSeek US Equities Industry Standard Daily OHLC
version: 0.1.0
status: draft
domain: market-data
tags:
- algoseek
- licensed-data
- equity
- us
- daily_bar
description:
  purpose: One row is one security on one trading day with open, high, low, close, regular-hours and whole-day
    volume, FINRA/TRF volume and VWAPs, selected with de-facto industry-standard trade rules from SIP
    trades. Delivered as an ArdaDB table keyed by ASID; used for standard daily price series and reconciliation.
  usage: Backtesting, execution and microstructure research, feature engineering for US equities.
  limitations: 'Delivered as recorded from the source feed: AlgoSeek does not remove crossed or locked
    quotes, bad prints, or out-of-sequence packets unless contracted to. Consumers own cleaning. Sample
    channel: ArdaDB (sample_channel ardadb/database_table, eq_daily_ohlc_ind_std.csv, 100 rows, all 2023-08-02,
    tickers A..ACMR, ordered by Ticker); there is no S3 file sample for this dataset, and the adjusted
    sibling is a separate dataset with an S3 sample. The JSON preview is identical to the CSV. Open/Close
    rule (Appendix B): first/last event from 09:30 with EventType TRADE NB, falling back to TRADE; empty
    if no valid trade after 09:30. Zero-quantity events still count for Open/Close. From 2026-02-23 the
    Close for NASDAQ-listed securities prefers the official NASDAQ close when it meets round-lot volume
    thresholds per price level, else the last TRADE NB; non-NASDAQ logic unchanged (a methodology break;
    the guide does not say whether history was recomputed). Filtering: exclude Price = 0 and Quantity
    = 0 trades, trade-cancel events and the original trades that were later cancelled (zero quantity still
    applies to Open/Close). High/Low: highest/lowest price from 09:30 among trades having at least one
    include-flag and none of the exclude-flags (opening/closing trades are taken into account); if none
    qualify, the extreme TRADE NB price is used. Prices can be sub-penny (e.g. 128.725).'
  authoritativeDefinitions:
  - type: businessDefinition
    url: https://algoseek.com/dataset/us-equities-industry-standard-daily-ohlc/
  - type: implementation
    url: https://algoseek.com/data-docs/equity-market-data/algoseek.US.Equity.Daily.OHLC.Industry.Standard.Adjusted.Guide.pdf
  - type: implementation
    url: https://algoseek.com/docs/rest-api/reference
context:
  instructions: Times are local US Eastern clock times (DST-aware), not UTC. Treat TRADE NB / NBBO-flagged
    rows as the backtest-grade subset. Cancellations reference earlier trades and can arrive hours later,
    so aggregate only after the session closes. Prices are unadjusted unless the dataset name says Adjusted;
    join us-equities-*-adjustment-factors on SecId for adjustment.
  verifiedStatements:
  - id: vs1
    question: What time zone are the timestamps in?
    answer: US Eastern local time with daylight saving (the guides label it EST/ET).
  - id: vs2
    question: Are prices adjusted for splits and dividends?
    answer: Only in datasets whose name contains Adjusted; all others are as traded.
  constraints:
  - id: c1
    constraint: 'Licensed vendor data: never export raw rows to a tenant-local destination or include
      them verbatim in a public artifact; serve only through entitlement-checked platform reads.'
  - id: c3
    constraint: Do not treat the vendor's `Ticker` as a stable identity across time; join on an AlgoSeek
      security key (SecId or ASID, which are distinct) or the platform symbol mapping.
servers:
- server: algoseek-s3
  type: s3
  environment: vendor
  description: AlgoSeek flat-file delivery (the layout the schema below describes).
  location: s3://${ALGOSEEK_S3_BUCKET_EQ_DAILY_OHLC_IND_STD}/
  format: csv
  encoding: UTF-8
  customProperties:
  - property: layout
    value: 'The published sample is an ArdaDB database_table export (ardadb/database_table, eq_daily_ohlc_ind_std.csv).
      The only guide is the Adjusted guide for the sibling CSV product, which describes two CSV aggregations
      with identical fields: ''tradedate'' = one file with all symbols per trading day, ''secid'' = one
      file with all trading days for one SecId (e.g. 33449 / AAPL, one year per file). No table or partition
      layout is documented for this unadjusted ArdaDB product.'
  - property: compression
    value: gzip
  - property: header
    value: true
  - property: entitlement
    value: Bucket access is granted per subscription; bucket names arrive with license provisioning.
- server: algoseek-rest-api
  type: api
  environment: vendor
  description: AlgoSeek Datasets REST API (X-API-KEY header; JSON, CSV or gzipped CSV). Returns AlgoSeek's
    normalized API layout, which differs from the flat-file columns in this contract's schema.
  location: https://api.algoseek.com/v1/data/us-equity/daily-ohlc/:identifier?aggregation_logic=industry_std
  customProperties:
  - property: auth
    value: X-API-KEY header issued by AlgoSeek
  - property: columnsEndpoint
    value: https://api.algoseek.com/v1/meta/datasets/{dataset_id}/columns
  - property: statusEndpoint
    value: https://api.algoseek.com/v1/meta/datasets/{dataset_id}/status
  - property: responseFormats
    value:
    - json
    - csv
    - csv_gzip
  - property: pagination
    value: offset + limit; tick endpoints take trade_date and identifier (Ticker or ASID) in the path
schema:
- name: us_equities_industry_standard_daily_ohlc
  physicalName: eq_daily_ohlc_ind_std
  physicalType: file
  logicalType: object
  businessName: US Equities Industry Standard Daily OHLC
  description: One row is one security on one trading day with open, high, low, close, regular-hours and
    whole-day volume, FINRA/TRF volume and VWAPs, selected with de-facto industry-standard trade rules
    from SIP trades. Delivered as an ArdaDB table keyed by ASID; used for standard daily price series
    and reconciliation.
  dataGranularityDescription: one security (ASID/Ticker) x one trading day
  properties:
  - name: TradeDate
    logicalType: date
    logicalTypeOptions:
      format: YYYY-MM-DD
    physicalType: string (yyyymmdd) (csv text)
    description: Trading date of the bar.
    primaryKey: true
    primaryKeyPosition: 1
    required: true
    partitioned: true
    partitionKeyPosition: 1
    customProperties:
    - property: evidence
      value: guide+sample
  - name: Ticker
    logicalType: string
    physicalType: string (csv text)
    description: Symbol name.
    customProperties:
    - property: evidence
      value: guide+sample
  - name: ASID
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: 'algoseek Security ID (ASID): constant over a security''s life and links its SecIds;
      replaces SecId here and is defined in the ASID Lookup guide, not in this guide.'
    primaryKey: true
    primaryKeyPosition: 2
    required: true
    partitioned: true
    partitionKeyPosition: 2
    customProperties:
    - property: evidence
      value: sample-only
  - name: OpenPrice
    logicalType: number
    physicalType: decimal (csv text)
    description: 'Opening price: first TRADE NB event from 09:30 ET, else first TRADE (Appendix B). Table
      3 text wrongly says primary-exchange open.'
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: Blank if no valid trade after 09:30 ET (Appendix B); none empty in sample
    - property: evidence
      value: guide+sample
  - name: HighPrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Highest qualifying trade price from 09:30 ET on any exchange or TRF (flag include/exclude
      lists), else highest TRADE NB; opening/closing trades count.
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: unstated; none empty in sample
    - property: evidence
      value: guide+sample
  - name: LowPrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Lowest qualifying trade price from 09:30 ET on any exchange or TRF (flag include/exclude
      lists), else lowest TRADE NB; opening/closing trades count.
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: unstated; none empty in sample
    - property: evidence
      value: guide+sample
  - name: ClosePrice
    logicalType: number
    physicalType: decimal (csv text)
    description: 'Closing price: last TRADE NB event of the day, else last TRADE; since 2026-02-23 NASDAQ-listed
      names use the official NASDAQ close when volume thresholds are met.'
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: Blank if no valid trade after 09:30 ET (Appendix B); none empty in sample
    - property: evidence
      value: guide+sample
  - name: MarketHoursVolume
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Total shares traded during regular market hours only (09:30-16:00 ET; to 13:00 on early
      closes).
    customProperties:
    - property: unit
      value: shares
    - property: evidence
      value: guide+sample
  - name: MarketHoursFinraVolume
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: FINRA/TRF (off-exchange) shares traded during regular market hours.
    customProperties:
    - property: unit
      value: shares
    - property: nullMeaning
      value: unstated; none empty in sample
    - property: evidence
      value: guide+sample
  - name: DailyVolume
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Total shares traded for the whole day (pre-, regular and post-market).
    customProperties:
    - property: unit
      value: shares
    - property: evidence
      value: guide+sample
  - name: DailyFinraVolume
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: FINRA/TRF shares traded for the whole day.
    customProperties:
    - property: unit
      value: shares
    - property: nullMeaning
      value: unstated; none empty in sample
    - property: evidence
      value: guide+sample
  - name: MarketHoursVWAP
    logicalType: number
    physicalType: decimal (csv text)
    description: Volume-weighted average trade price over regular hours plus the opening/closing cross
      (may print after 16:00 ET).
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: DailyVWAP
    logicalType: number
    physicalType: decimal (csv text)
    description: Volume-weighted average trade price for the whole day including pre- and post-market
      trades.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  quality:
  - id: row_count_positive
    metric: rowCount
    mustBeGreaterThan: 0
    dimension: completeness
    severity: error
    description: Every delivered partition (trade date, or snapshot) carries at least one row.
  - id: primary_key_unique
    metric: duplicateValues
    mustBe: 0
    arguments:
      properties:
      - TradeDate
      - ASID
    dimension: uniqueness
    severity: error
    description: The declared primary key is unique within each delivered partition (one file or table
      snapshot).
  - id: bar_high_ge_low
    type: sql
    description: HighPrice is never below LowPrice in the same row.
    query: SELECT COUNT(*) FROM {object} WHERE HighPrice IS NOT NULL AND LowPrice IS NOT NULL AND HighPrice
      < LowPrice
    mustBe: 0
    dimension: accuracy
    severity: error
  - id: open_close_within_range
    type: sql
    description: 'Open and close usually sit inside the high-low range. Only a warning: some AlgoSeek
      aggregations take open/close from a different event set than high/low (seen in the Daily OHLC sample).'
    query: SELECT COUNT(*) FROM {object} WHERE OpenPrice > HighPrice OR OpenPrice < LowPrice OR ClosePrice
      > HighPrice OR ClosePrice < LowPrice
    mustBe: 0
    dimension: accuracy
    severity: warning
  - id: DailyFinraVolume_non_negative
    type: sql
    description: DailyFinraVolume is never negative.
    query: SELECT COUNT(*) FROM {object} WHERE DailyFinraVolume < 0
    mustBe: 0
    dimension: accuracy
    severity: error
  - id: DailyVolume_non_negative
    type: sql
    description: DailyVolume is never negative.
    query: SELECT COUNT(*) FROM {object} WHERE DailyVolume < 0
    mustBe: 0
    dimension: accuracy
    severity: error
  - id: MarketHoursFinraVolume_non_negative
    type: sql
    description: MarketHoursFinraVolume is never negative.
    query: SELECT COUNT(*) FROM {object} WHERE MarketHoursFinraVolume < 0
    mustBe: 0
    dimension: accuracy
    severity: error
  - id: MarketHoursVolume_non_negative
    type: sql
    description: MarketHoursVolume is never negative.
    query: SELECT COUNT(*) FROM {object} WHERE MarketHoursVolume < 0
    mustBe: 0
    dimension: accuracy
    severity: error
support:
- channel: algoseek-support
  tool: email
  url: mailto:support@algoseek.com
  scope: issues
  description: Vendor support for data defects, missing days, and entitlement problems.
team:
  name: AlphaSwarm data engineering
slaProperties:
- id: update_frequency
  property: frequency
  value: 1
  unit: d
  driver: analytics
- id: retention
  property: retention
  value: license-term
  description: Retention of landed copies is bounded by the AlgoSeek license; purge on termination.
  driver: regulatory
customProperties:
- property: vendor
  value: AlgoSeek
- property: vendorDataGroup
  value: us-equity
- property: vendorDatasetTextId
  value: eq_daily_ohlc_ind_std
- property: vendorSampleUrl
  value: https://as-metadata-services-assets.s3.amazonaws.com/sample_files/database_table/eq_daily_ohlc_ind_std.csv
- property: assetClass
  value: equity
- property: venues
  value:
  - FINRA TRF
- property: coverage
  value: SIP (Consolidated Feed) trades for listed US stocks, ETNs, ETFs, ADRs and funds (page adds common
    and preferred stocks, warrants and units). Open/close use first/last NBBO trade rules (Appendix B).
    History start not stated.
- property: timezone
  value: America/New_York
- property: sessionHours
  value: Pre-market 04:00:00-09:30:00 (excl.), market hours 09:30:00-16:00:00 (excl.), post-market 16:00:00-20:00:00
    ET; market hours end 13:00:00 on early-close days; trades occasionally recorded several minutes after
    20:00
- property: priceAdjustment
  value: unadjusted
- property: licensedData
  value: true
- property: evidenceGrade
  value: vendor-doc+sample
- property: knownIssues
  value:
  - Primary key is inferred; AlgoSeek's guide does not name one.
  - 'Doc discrepancy: The linked guide is the ADJUSTED-product guide; this dataset is the unadjusted sibling,
    so the guide''s SecId and the ten *Adj columns (OpenAdj ... DailyVWAPAdj) have no counterpart in this
    sample.'
  - 'Doc discrepancy: Identifier: the guide uses SecId (integer); the sample carries ASID (16-digit) and
    no SecId. ASID and SecId are different values (ticker A: SecId 32952 in the S3 samples, ASID 1010000000001000
    here).'
  - 'Doc discrepancy: Price column names: guide Open/High/Low/Close, sample OpenPrice/HighPrice/LowPrice/ClosePrice.'
  - 'Doc discrepancy: TradeDate: guide says string yyyymmdd; the ArdaDB sample uses YYYY-MM-DD with hyphens.'
  - 'Doc discrepancy: Guide Table has no ''Missing'' column, so null/empty behaviour is undocumented.'
  - 'Doc discrepancy: Table 3 describes Open/Close as the ''Primary exchange opening/closing trade'' and
    points to sections ''Opening Trade Identification'' / ''Closing Trade Identification'' that do not
    exist in this guide; Appendices B and C define industry-standard Open/Close as the first/last TRADE
    NB event from 09:30 (any venue). The guide has Appendices B and C but no Appendix A.'
  - 'Doc discrepancy: Bar Notes give sum(TradeSize) = MarketHoursVolume for both MarketHoursVWAP and DailyVWAP,
    although DailyVWAP is whole-day; the intended DailyVWAP denominator (DailyVolume) is not stated.'
  - 'Doc discrepancy: Guide cites ''individual events (see Table 3)'' for rows, but rows are per-security
    daily bars (text carried over from tick guides).'
  - 'Doc discrepancy: Sample value formatting is variable-width (''122'', ''128.725'', ''24.6888''); the
    S3 industry-standard adjusted sample prints the same values at fixed width (122.0000).'
  - 'Doc discrepancy: No history start date is given in the guide or on the product page.'
contractCreatedTs: '2026-11-02T00:00:00Z'
