# 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-trade-only-minute-bar-excluding-finra-trf-trades
name: AlgoSeek US Equities Trade Only Minute Bar Excluding FINRA/TRF Trades
version: 0.1.0
status: draft
domain: market-data
tags:
- algoseek
- licensed-data
- equity
- us
- bar
description:
  purpose: One row summarizes qualifying on-exchange trades of one US-listed equity in one minute (OHLC,
    volume-weighted price, share volume, trade count). FINRA TRF reports and odd lots are excluded, giving
    a lit-exchange-only view for trading and backtesting.
  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. Bars
    are sparse: a row exists only if at least one qualifying trade occurred in the interval, so skipped
    timestamps mean no trades, not zero-volume rows (guide Table 3 shows GDP bars at 10:42, 10:43, 10:45,
    10:54, 11:05). A ticker with no trades for the whole day still gets a file containing only the header
    row; the guide says this happens for low-liquidity tickers that had bid/ask quotes but no trades.
    A single-trade bar has First = High = Low = Last, and VolumeWeightPrice equals that price (guide example),
    which confirms VolumeWeightPrice = sum(price x shares)/sum(shares) with no NBBO-midpoint term. Exclusion
    scope is both FINRA/TRF reports and odd lots. Consistent with this, no bar in the ex-FINRA samples
    has fewer than 100 shares, whereas the standard adjusted sample (2020 pre-market AAPL) contains bars
    of 2-99 shares.'
  authoritativeDefinitions:
  - type: businessDefinition
    url: https://algoseek.com/dataset/us-equities-trade-only-minute-bar-excluding-finra-trf-trades/
  - type: implementation
    url: https://algoseek.com/data-docs/equity-market-data/algoseek.US.EquityTrades.Only.Minute.Bars.pdf
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_NOFINRA}/
  format: csv
  encoding: UTF-8
  customProperties:
  - property: layout
    value: 'Same as the standard Trade Only Minute Bar: CSV with a fixed header row, gzip-compressed (.csv.gz,
      about 8:1), one file per ticker per trading day arranged by date then ticker; header-only file when
      the ticker had no qualifying trades. The guide gives no bucket or path names for this variant.'
  - property: compression
    value: gzip
  - property: header
    value: true
  - property: entitlement
    value: Bucket access is granted per subscription; bucket names arrive with license provisioning.
schema:
- name: us_equities_trade_only_minute_bar_excluding_finra_trf_trades
  physicalName: eq_trades_1min_nofinra
  physicalType: file
  logicalType: object
  businessName: US Equities Trade Only Minute Bar Excluding FINRA/TRF Trades
  description: One row summarizes qualifying on-exchange trades of one US-listed equity in one minute
    (OHLC, volume-weighted price, share volume, trade count). FINRA TRF reports and odd lots are excluded,
    giving a lit-exchange-only view for trading and backtesting.
  dataGranularityDescription: one ticker x one trading day x one minute that had at least one qualifying
    on-exchange trade
  properties:
  - name: Date
    logicalType: date
    logicalTypeOptions:
      format: yyyymmdd
    physicalType: string (yyyymmdd) (csv text)
    description: Trading date of the bar, in yyyymmdd form.
    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 (ticker) of the security the bar belongs to.
    primaryKey: true
    primaryKeyPosition: 2
    required: true
    partitioned: true
    partitionKeyPosition: 2
    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
  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:
      - Date
      - Ticker
      - 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: 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_trades_1min_nofinra
- property: vendorSampleUrl
  value: https://as-metadata-services-assets.s3.amazonaws.com/sample_data/cloud_storage/eq_trades_1min_nofinra.csv
- property: assetClass
  value: equity
- property: venues
  value:
  - NASDAQ
  - BATS
  - NYSE
  - ARCA
- property: coverage
  value: 'Same universe and SIP source as the standard Trade Only Minute Bar, restricted to trades executed
    on public exchanges: all FINRA/TRF reports and odd lots (<100 shares) are excluded. The guide names
    NASDAQ, BATS, NYSE and ARCA only as examples. History length is not stated (''full historical archive''
    on the product page).'
- property: timezone
  value: America/New_York
- property: timestampFormat
  value: Date yyyymmdd; TimeBarStart HH:MM (bar start only, minute resolution, no seconds or offset)
- 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; the base guide adds that bars occasionally extend several minutes past
    20:00
- property: priceAdjustment
  value: unadjusted
- 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 is identical to the standard variant and to guide Table 2 (10 columns,
    same order); 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: Product page says only that off-exchange FINRA/TRF trades are excluded; the guide''s
    variant name and Appendix B also exclude odd lots (<100 shares) via the tOddLot flag. The page does
    not mention the odd-lot exclusion.'
  - 'Doc discrepancy: Appendix B heading and Table 6 caption for the no-FINRA/TRF logic say ''Trade and
    Quote Minute Bar'' / ''Trade and Quote Events'' although this is a trade-only dataset (apparent copy
    from the TAQ guide).'
  - 'Doc discrepancy: Guide Table 6 (excluded flags) and Table 7 (included flags) span a page break and
    print out of order in the text extraction; reassembled here from the raw PDF text.'
  - 'Doc discrepancy: Guide''s Bar Notes word the bar interval as strictly ''greater than'' the start
    time and ''less than'' the next boundary (minute bar 11:04 = >11:04 to <11:05; second bar 13:03:01
    = >13:03:01 to <13:03:02). Read literally this excludes a trade stamped exactly on the start; whether
    the start is actually inclusive is not stated.'
  - 'Doc discrepancy: Guide text introducing Table 2 promises ''base event'' and ''default value'' columns
    that the table does not have.'
contractCreatedTs: '2026-11-02T00:00:00Z'
