# 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-trade-only-minute-bar-adjusted
name: AlgoSeek US Equities Industry Standard Trade Only Minute Bar Adjusted
version: 0.1.0
status: draft
domain: market-data
tags:
- algoseek
- licensed-data
- equity
- us
- bar
description:
  purpose: One row is a one-minute industry-standard trade-only bar for one US-listed equity, carrying
    both as-traded OHLC/VWAP/volume/trade count and parallel backward-adjusted prices and volume that
    account for splits, dividends and other corporate actions.
  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. Backward
    adjustment: *Adjusted columns are rebuilt whenever a new corporate event is published for the SecId,
    so earlier adjusted values are restated and the SecId history must be re-downloaded (guide Daily Updates).
    Treat the dataset as restating, not append-only. Raw columns are as-traded and stay fixed; only the
    *Adjusted columns move with new events. Verified in the sample (AAPL 2023-08-02, SecId 33449): every
    adjusted/raw price ratio is about 0.998651 (the same value as PriceAdjFactor in the ex-FINRA adjusted
    sample) and VolumeAdjusted = Volume in all 100 rows (no volume-affecting event after that date). Events
    that change price vs volume are listed under enums_and_codes (guide Corporate Events table).'
  authoritativeDefinitions:
  - type: businessDefinition
    url: https://algoseek.com/dataset/us-equities-industry-standard-trade-only-minute-bar-adjusted/
  - type: implementation
    url: https://algoseek.com/data-docs/equity-market-data/algoseek.US.Equity.Trades.Only.Adjusted.Industry.Standard.Minute.Bar.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_TRADES_1MIN_IND_STD_ADJ}/
  format: csv
  encoding: UTF-8
  customProperties:
  - property: layout
    value: 'CSV with a fixed header row, gzip-compressed (uncompressed about 7x larger). Two aggregation
      options with identical fields: ''tradedate'' = one file per symbol per trading day (by date then
      ticker); ''SecId'' = one file per SecId covering all trading days (guide example: AAPL, SecId 33449,
      one year per file). S3 buckets named in the guide: us-equity-bbg-1min-trades-adjusted-secid-all,
      us-equity-bbg-1min-trades-adjusted-secid-yyyy, us-equity-bbg-1min-trades-adjusted-yyyy (trade-date
      files per year). Lists of rebuilt SecIds: s3://<bucket>/daily-changes/yyyymmdd.csv. Header-only
      file when a ticker h…'
  - 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/trades-1min/:identifier?aggregation_logic=industry_std&adjusted=true
  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_trade_only_minute_bar_adjusted
  physicalName: eq_trades_1min_ind_std_adj
  physicalType: file
  logicalType: object
  businessName: US Equities Industry Standard Trade Only Minute Bar Adjusted
  description: One row is a one-minute industry-standard trade-only bar for one US-listed equity, carrying
    both as-traded OHLC/VWAP/volume/trade count and parallel backward-adjusted prices and volume that
    account for splits, dividends and other corporate actions.
  dataGranularityDescription: one SecId (ticker) x one trading day x one minute that had at least one
    qualifying trade
  properties:
  - name: SecId
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: AlgoSeek unique security identifier; survives ticker changes but can change on restructurings
      such as reclassification.
    primaryKey: true
    primaryKeyPosition: 1
    required: true
    partitioned: true
    partitionKeyPosition: 2
    customProperties:
    - property: evidence
      value: guide+sample
  - name: Date
    logicalType: date
    logicalTypeOptions:
      format: yyyymmdd
    physicalType: string (yyyymmdd) (csv text)
    description: Trading date of the bar, in yyyymmdd form.
    primaryKey: true
    primaryKeyPosition: 2
    required: true
    partitioned: true
    partitionKeyPosition: 1
    customProperties:
    - property: evidence
      value: guide+sample
  - name: Ticker
    logicalType: string
    physicalType: string (csv text)
    description: Symbol name (ticker) of the security the bar belongs to.
    customProperties:
    - property: evidence
      value: guide+sample
  - name: TimeBarStart
    logicalType: time
    logicalTypeOptions:
      format: HH:MM
    physicalType: string (time) (csv text)
    description: Start time of the bar (US Eastern); HH:MM for minute bars. Bars with no qualifying trade
      are omitted.
    primaryKey: true
    primaryKeyPosition: 3
    required: true
    customProperties:
    - property: evidence
      value: guide+sample
  - name: FirstTradePrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Price of the first qualifying trade in the bar (bar open).
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: HighTradePrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Highest trade price in the bar.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: LowTradePrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Lowest trade price in the bar.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: LastTradePrice
    logicalType: number
    physicalType: decimal (csv text)
    description: Price of the last qualifying trade in the bar (bar close).
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: VolumeWeightPrice
    logicalType: number
    physicalType: decimal (csv text)
    description: 'Volume-weighted average trade price: sum(price x shares)/sum(shares). The guide''s printed
      formula wrongly subtracts an NBBO midpoint term.'
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: Volume
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Total number of shares traded in the bar.
    customProperties:
    - property: unit
      value: shares
    - property: evidence
      value: guide+sample
  - name: TotalTrades
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Total number of trades in the bar.
    customProperties:
    - property: unit
      value: count
    - property: evidence
      value: guide+sample
  - name: FirstTradePriceAdjusted
    logicalType: number
    physicalType: decimal (csv text)
    description: Backward-adjusted price of the first trade in the bar.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: HighTradePriceAdjusted
    logicalType: number
    physicalType: decimal (csv text)
    description: Backward-adjusted highest trade price in the bar.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: LowTradePriceAdjusted
    logicalType: number
    physicalType: decimal (csv text)
    description: Backward-adjusted lowest trade price in the bar.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: LastTradePriceAdjusted
    logicalType: number
    physicalType: decimal (csv text)
    description: Backward-adjusted price of the last trade in the bar.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: VolumeWeightPriceAdjusted
    logicalType: number
    physicalType: decimal (csv text)
    description: Backward-adjusted volume-weighted average price of the bar.
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: VolumeAdjusted
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Backward-adjusted total number of shares traded in the bar.
    customProperties:
    - property: unit
      value: shares
    - 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:
      - SecId
      - Date
      - TimeBarStart
    dimension: uniqueness
    severity: error
    description: The declared primary key is unique within each delivered partition (one file or table
      snapshot).
  - id: trade_high_ge_low
    type: sql
    description: HighTradePrice is never below LowTradePrice in the same row.
    query: SELECT COUNT(*) FROM {object} WHERE HighTradePrice IS NOT NULL AND LowTradePrice IS NOT NULL
      AND HighTradePrice < LowTradePrice
    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 FirstTradePrice > HighTradePrice OR FirstTradePrice < LowTradePrice
      OR LastTradePrice > HighTradePrice OR LastTradePrice < LowTradePrice
    mustBe: 0
    dimension: accuracy
    severity: warning
  - id: vwap_within_range
    type: sql
    description: VWAP (sum(price*shares)/sum(shares)) lies within the bar's trade range.
    query: SELECT COUNT(*) FROM {object} WHERE VolumeWeightPrice > HighTradePrice OR VolumeWeightPrice
      < LowTradePrice
    mustBe: 0
    dimension: accuracy
    severity: warning
  - id: TotalTrades_non_negative
    type: sql
    description: TotalTrades is never negative.
    query: SELECT COUNT(*) FROM {object} WHERE TotalTrades < 0
    mustBe: 0
    dimension: accuracy
    severity: error
  - id: Volume_non_negative
    type: sql
    description: Volume is never negative.
    query: SELECT COUNT(*) FROM {object} WHERE Volume < 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: 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_trades_1min_ind_std_adj
- property: vendorSampleUrl
  value: https://as-metadata-services-assets.s3.amazonaws.com/sample_data/cloud_storage/eq_trades_1min_ind_std_adj.csv
- property: assetClass
  value: equity
- property: venues
  value:
  - NASDAQ
  - BATS
  - NYSE
  - ARCA
  - FINRA Trade Reporting Facilities (TRF)
- property: coverage
  value: Trades for all listed US stocks, ETNs, ETFs, ADRs and funds (page adds preferred stocks, warrants
    and units) from 16+ US exchanges and marketplaces via the SIP, with industry-standard exclusions (odd
    lots, cancelled trades, various conditions), including pre/post-market hours. History length is not
    stated.
- property: timezone
  value: America/New_York
- property: timestampFormat
  value: Date yyyymmdd; TimeBarStart HH:MM (bar start, minute resolution). Industry-standard bars are
    shifted by 1 second from 09:31 per guide Appendix B
- property: sessionHours
  value: 04:00-20:00 ET (pre-market 04:00-09:30, regular 09:30-16:00, post-market 16:00-20:00); early-close
    days end trading at 13:00
- property: priceAdjustment
  value: adjusted - backward adjustment for corporate events (columns suffixed Adjusted); raw as-traded
    values delivered alongside; whole SecId history restated on each new event
- property: licensedData
  value: true
- property: evidenceGrade
  value: vendor-doc
- property: knownIssues
  value:
  - Primary key is inferred; AlgoSeek's guide does not name one.
  - 'Doc discrepancy: Sample header matches guide Table 2 field-for-field and in order (17 columns); no
    column differences.'
  - 'Doc discrepancy: Guide''s VolumeWeightPrice formula reads sum(Trade_Shares x (Trade_Price - NBBOMidpoint))
    / sum(Trade_Shares), which subtracts a quote-based term that a trade-only dataset cannot have; the
    same sentence and the guide''s own single-trade examples (VWAP equals the trade price) show the intended
    value is sum(price x shares)/sum(shares).'
  - 'Doc discrepancy: Guide Table 1 and Table 3 sample values are identical to the standard Adjusted Minute
    Bar guide''s examples (AAPL 20200825 09:30, 1,059,318 shares / 8,387 trades), so they illustrate layout
    only and not industry-standard output (the real 2023 sample''s first bar is 761,329 / 1,450).'
  - 'Doc discrepancy: Bar Notes (carried over from sibling guides) say minute bar 11:04 spans >11:04 to
    <11:05, while Appendix B says data are shifted by 1 second from 09:31: 09:30 = 09:30:00.000-09:31:00.999,
    09:31 = 09:31:01.000-09:32:00.999. The two statements conflict; Appendix B is the industry-standard-specific
    one.'
  - 'Doc discrepancy: Guide says the dataset covers 04:00-20:00 ET including pre- and post-market, but
    Appendix B excludes events flagged tExtendedHours (bit 13), tCash and tNextDay; the sample covers
    only 09:30-11:09, so extended-hours content is unverified.'
  - 'Doc discrepancy: Guide''s Table 1 example (AAPL 20200825) shows an adjusted/raw price ratio of exactly
    0.25 and VolumeAdjusted = 4 x Volume (split only), whereas the sample (AAPL 20230802) has a ratio
    of about 0.998651 and VolumeAdjusted = Volume; the examples are older snapshots and the exact adjustment
    method is not spelled out.'
  - 'Doc discrepancy: About 15 sample VolumeWeightPrice values carry floating-point noise (14 fractional
    digits, e.g. 194.78498000000002); adjusted columns use fixed 4-decimal prices and 5-decimal VWAP.'
contractCreatedTs: '2026-11-02T00:00:00Z'
