# 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-daily-ohlc
name: AlgoSeek US Equities 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 algoseek-logic open, high, low, close, regular-hours
    and whole-day volume, FINRA/TRF volume and VWAPs from SIP trades; opens and closes follow the primary
    exchange's official auctions. Delivered as an ArdaDB table keyed by ASID.
  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.csv, 100 rows, all 2023-08-02,
    ordered by Ticker); no S3 file sample for this unadjusted dataset (the adjusted sibling has one).
    The JSON preview is identical to the CSV. Zero means missing in this channel: 6 of 100 sample rows
    have at least one of Open/High/Low/Close = 0 and 6 have FINRA volume 0, where the S3 adjusted sample
    shows empty cells for the same securities. Contract validations should treat 0 prices as ''no qualifying
    trade'', not a real price. Open/Close come from the primary exchange by priority (official open/close
    with the largest volume, opening/closing print, regular open/close, regular first/last, then non-FINRA
    TRADE NB and TRADE fallbacks); High/Low are the extreme non-FINRA trades within market hours excluding
    odd lots, extended-hours and special-price trades. Because Open/Close and High/Low use different trade
    populations, Low <= Open,Close <= High is NOT guaranteed: among the 94 sample rows with all four prices
    > 0, 12 have High below max(Open, Close) and 13 have Low above min(Open, Close) (e.g. AAA: open 24.63,
    high 24.68, low 24.68, close 24.66).'
  authoritativeDefinitions:
  - type: businessDefinition
    url: https://algoseek.com/dataset/us-equities-daily-ohlc/
  - type: implementation
    url: https://algoseek.com/data-docs/equity-market-data/algoseek.US.Equity.algoseek.Daily.OHLC.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}/
  format: csv
  encoding: UTF-8
  customProperties:
  - property: layout
    value: 'The published sample is an ArdaDB database_table export (ardadb/database_table, eq_daily_ohlc.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
  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_daily_ohlc
  physicalName: eq_daily_ohlc
  physicalType: file
  logicalType: object
  businessName: US Equities Daily OHLC
  description: One row is one security on one trading day with algoseek-logic open, high, low, close,
    regular-hours and whole-day volume, FINRA/TRF volume and VWAPs from SIP trades; opens and closes follow
    the primary exchange's official auctions. Delivered as an ArdaDB table keyed by ASID.
  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 trade on the primary exchange by priority: official open, opening print, regular
      open, regular first; then non-FINRA TRADE NB / TRADE fallbacks.'
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: unstated; ArdaDB sample shows 0 instead of empty when no qualifying trade
    - property: evidence
      value: guide+sample
  - name: HighPrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Highest non-FINRA trade price within market hours; excludes odd lots, extended-hours
      and special-price (average, derivative, stock-option, Rule 155) trades.
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: unstated; ArdaDB sample shows 0 instead of empty when no qualifying trade
    - property: evidence
      value: guide+sample
  - name: LowPrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Lowest non-FINRA trade price within market hours; excludes odd lots, extended-hours and
      special-price (average, derivative, stock-option, Rule 155) trades.
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: unstated; ArdaDB sample shows 0 instead of empty when no qualifying trade
    - property: evidence
      value: guide+sample
  - name: ClosePrice
    logicalType: number
    physicalType: decimal (csv text)
    description: 'Closing trade on the primary exchange by priority: official close, closing print, regular
      close, regular last; then non-FINRA TRADE NB / TRADE fallbacks.'
    customProperties:
    - property: unit
      value: USD
    - property: nullMeaning
      value: unstated; ArdaDB sample shows 0 instead of empty when no qualifying trade
    - 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; ArdaDB sample shows 0 when there is no FINRA volume
    - 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; ArdaDB sample shows 0 when there is no FINRA volume
    - 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
- property: vendorSampleUrl
  value: https://as-metadata-services-assets.s3.amazonaws.com/sample_files/database_table/eq_daily_ohlc.csv
- property: assetClass
  value: equity
- property: venues
  value:
  - FINRA TRF
- property: coverage
  value: SIP (Consolidated Feed) trades for all listed US stocks, ETNs, ETFs, ADRs and funds, built with
    algoseek's Open/High/Low/Close selection logic; page says files are categorised by date and ticker.
    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: Missing-value representation differs by channel: where the S3 adjusted sample for
    the same rows is empty (e.g. AACT.U all four prices, AACT High/Low, ACABW FINRA volumes) this ArdaDB
    sample prints 0.'
  - 'Doc discrepancy: Product page says ''Files are systematically categorized by date and ticker''; the
    guide describes tradedate (all symbols per day) and secid (all days per security) aggregations.'
  - 'Doc discrepancy: The guide''s volume section and Table 3 refer to ListedMarketHoursVolume, ListedTotalVolume,
    FinraMarketHoursVolume and FinraTotalVolume, which are Daily TAQ columns and do not exist in this
    dataset; the flag name ''tOpenindPrints'' and ''tDerivativelyPrices'' are typos for tOpeningPrints
    / tDerivativelyPriced.'
  - 'Doc discrepancy: Guide says rows are ''individual events (see Table 1)''; rows are per-security daily
    bars (carried-over text).'
  - 'Doc discrepancy: No history start date is given in the guide or on the product page.'
contractCreatedTs: '2026-11-02T00:00:00Z'
