# 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-adjusted-trade-only
name: AlgoSeek US Equities Adjusted Trade Only
version: 0.1.0
status: draft
domain: market-data
tags:
- algoseek
- licensed-data
- equity
- us
- tick
description:
  purpose: One row is one SIP last-sale trade (or cancellation) for a US equity with prices and volumes
    adjusted for corporate actions, carrying the adjustment factors and the persistent ASID; delivered
    as an ArdaDB table. Used for tick-level backtests across splits and dividends.
  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_trades_adj.csv, 100 rows, AAPL on 2023-08-02
    12:29:37-12:29:41); there is no S3 file sample for this dataset. The JSON preview is identical to
    the CSV. Adjustment evidence (inferred, not documented): in the sample every row has PriceAdjFactor
    0.998651458110918 and VolumeAdjFactor 1; Price divided by the factor gives sub-penny raw-style prices
    (e.g. 191.6712 / 0.99865 = 191.93), so Price already includes the factor and must not be adjusted
    again. The factor is constant across all 100 sample rows (one trading date, one ASID), so it behaves
    as a per-security, per-date value repeated on each tick (inferred). Backward-adjusted history is restated
    when later corporate actions occur (per the Adjustment Factors guides: factors are rebuilt when a
    security has a new event); adjusted Price/Quantity for a past date are therefore not stable over time.
    The Trade Only guide does not state a restatement policy.'
  authoritativeDefinitions:
  - type: businessDefinition
    url: https://algoseek.com/dataset/us-equities-adjusted-trade-only/
  - type: implementation
    url: https://algoseek.com/data-docs/equity-market-data/algoseek.US.Equity.Trades.Only.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_ADJ}/
  format: csv
  encoding: UTF-8
  customProperties:
  - property: layout
    value: The published sample is an ArdaDB database_table export (sample_channel ardadb/database_table,
      eq_trades_adj.csv). The only guide for it (Trade Only) describes the raw product as one gzip CSV
      per symbol per trading day; no table or file layout is documented for the adjusted 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/trades/:trade_date/:identifier?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_adjusted_trade_only
  physicalName: eq_trades_adj
  physicalType: file
  logicalType: object
  businessName: US Equities Adjusted Trade Only
  description: One row is one SIP last-sale trade (or cancellation) for a US equity with prices and volumes
    adjusted for corporate actions, carrying the adjustment factors and the persistent ASID; delivered
    as an ArdaDB table. Used for tick-level backtests across splits and dividends.
  dataGranularityDescription: one trade or trade-cancellation event for one security (ASID) with its adjustment
    factors
  properties:
  - name: TradeDate
    logicalType: date
    logicalTypeOptions:
      format: YYYY-MM-DD
    physicalType: string (csv text)
    description: Trading date of the trade (the Trade Only guide's Date field, here ISO-formatted with
      hyphens).
    primaryKey: true
    primaryKeyPosition: 1
    required: true
    partitioned: true
    partitionKeyPosition: 1
    customProperties:
    - property: evidence
      value: sample-only
  - name: EventDateTime
    logicalType: timestamp
    logicalTypeOptions:
      timezone: true
      defaultTimezone: America/New_York
      format: YYYY-MM-DD HH:MM:SS.nnnnnnnnn (9-digit fractional seconds, no zone marker)
    physicalType: string (csv text)
    description: Trade date and time combined into one value with nanosecond fraction (replaces the guide's
      separate Date/Timestamp).
    primaryKey: true
    primaryKeyPosition: 3
    required: true
    customProperties:
    - property: evidence
      value: sample-only
  - name: EventType
    logicalType: string
    physicalType: string (csv text)
    description: 'Kind of event: trade, trade at the NBBO, or trade cancellation (Trade Only guide values).'
    primaryKey: true
    primaryKeyPosition: 4
    required: true
    enum:
    - value: TRADE
      label: trade at the exchange or reported to the market center
    - value: TRADE NB
      label: trade at national best price (NBBO)
    - value: TRADE CANCELLED
      label: cancellation of an earlier trade (reduces traded volume by its quantity); a correction is
        a cancellation followed by the corrected trade
    customProperties:
    - property: evidence
      value: guide+sample
  - name: Ticker
    logicalType: string
    physicalType: string (csv text)
    description: Symbol name of the security.
    customProperties:
    - property: evidence
      value: guide+sample
  - name: ASID
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: 'algoseek Security ID: persistent identifier constant over a security''s life; defined
      in the ASID Lookup guide, not in the Trade Only guide.'
    primaryKey: true
    primaryKeyPosition: 2
    required: true
    partitioned: true
    partitionKeyPosition: 2
    customProperties:
    - property: evidence
      value: sample-only
  - name: Price
    logicalType: number
    physicalType: decimal (csv text)
    description: 'Trade price on the adjusted basis (page: adjusted prices); sample values equal the raw
      price times PriceAdjFactor, 4 decimals.'
    customProperties:
    - property: unit
      value: USD
    - property: evidence
      value: guide+sample
  - name: Quantity
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Number of shares in the trade; presumably volume-adjusted via VolumeAdjFactor (always
      1 in the sample, so unverified).
    customProperties:
    - property: unit
      value: shares
    - property: evidence
      value: guide+sample
  - name: Exchange
    logicalType: string
    physicalType: string (csv text)
    description: Exchange or reporting venue (algoseek venue code); FINRA marks off-exchange TRF reports.
    primaryKey: true
    primaryKeyPosition: 5
    required: true
    enum:
    - value: NYSE
      label: New York Stock Exchange LLC (SIP id N)
    - value: ARCA
      label: NYSE Arca, Inc. (P)
    - value: AMEX
      label: NYSE American, LLC (A)
    - value: NSE
      label: NYSE National, Inc. (C)
    - value: CSE
      label: NYSE Chicago, Inc. (M)
    - value: Nasdaq
      label: Nasdaq, Inc. (T via CTS / Q via UTP); sample files spell it NASDAQ
    - value: Nasdaq BX
      label: Nasdaq BX, Inc. (B); sample files spell it NASDAQ BX
    - value: NASDAQ PSX
      label: Nasdaq PHLX LLC (X)
    - value: ISE
      label: Nasdaq ISE, LLC (I)
    - value: CBOE
      label: Cboe Exchange, Inc. (W)
    - value: BATS Y
      label: Cboe BYX Exchange, Inc. (Y)
    - value: BATS
      label: Cboe BZX Exchange, Inc. (Z)
    - value: EDGA
      label: Cboe EDGA Exchange, Inc. (J)
    - value: EDGX
      label: Cboe EDGX Exchange, Inc. (K)
    - value: IEX
      label: Investors' Exchange LLC (V)
    - value: LTSE
      label: Long-Term Stock Exchange (L)
    - value: MIAX
      label: MIAX Pearl, LLC (H); sample files spell it MIAX PEARL
    - value: MEMX
      label: MEMX LLC, Members Exchange (U)
    - value: FINRA
      label: Financial Industry Regulatory Authority trade reporting facilities, i.e. off-exchange trades
        (D)
    - value: NE24X
      label: 24X National Exchange (G)
    - value: TXSE
      label: Texas Stock Exchange (F)
    - value: UNKNOWN
      label: Unknown venue
    - value: INVALID
      label: Invalid venue
    customProperties:
    - property: evidence
      value: guide+sample
  - name: ConditionCode
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Trade sale-condition bitmask rendered as a decimal integer instead of the guide's hex
      string.
    customProperties:
    - property: evidence
      value: sample-only
  - name: PriceAdjFactor
    logicalType: number
    physicalType: decimal (csv text)
    description: Multiplicative corporate-action price factor applied to the row's raw price (0.998651458110918
      on every sample row).
    customProperties:
    - property: evidence
      value: sample-only
  - name: VolumeAdjFactor
    logicalType: number
    physicalType: decimal (csv text)
    description: Corporate-action volume factor for the row; 1 on every sample row, so its direction is
      unverified.
    customProperties:
    - property: evidence
      value: sample-only
  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
      - EventDateTime
      - EventType
      - Exchange
    dimension: uniqueness
    severity: warning
    description: 'Best-effort key for an event stream: same-timestamp events from one venue can repeat,
      so duplicates are reported, not rejected.'
  - id: Quantity_non_negative
    type: sql
    description: Quantity is never negative.
    query: SELECT COUNT(*) FROM {object} WHERE Quantity < 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: history_start
  property: generalAvailability
  value: '2007-01-01'
  description: First trade date of the vendor history.
- 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_adj
- property: vendorSampleUrl
  value: https://as-metadata-services-assets.s3.amazonaws.com/sample_files/database_table/eq_trades_adj.csv
- property: assetClass
  value: equity
- property: venues
  value:
  - NYSE
  - ARCA
  - AMEX
  - NSE
  - CSE
  - Nasdaq
  - Nasdaq BX
  - NASDAQ PSX
  - ISE
  - CBOE
  - BATS Y
  - BATS
  - EDGA
  - EDGX
  - IEX
  - LTSE
  - MIAX
  - MEMX
  - FINRA
  - NE24X
  - TXSE
  - UNKNOWN
  - INVALID
- property: coverage
  value: Corporate-action-adjusted tick-level US equity trades from the SIP Last Sale feed; the product
    page advertises adjusted prices and volumes since 2007. The shared Trade Only guide covers the raw
    feed (listed US equities, all exchanges plus FINRA TRFs, 04:00-20:00 ET) and does not mention adjustment.
- property: timezone
  value: America/New_York
- property: timestampFormat
  value: YYYY-MM-DD HH:MM:SS.nnnnnnnnn (single column, 9-digit fractional seconds)
- property: sessionHours
  value: '04:00-20:00 ET: pre-market 04:00:00-09:29:59, regular 09:30:00-16:00:00, post-market 16:00:01-20:00:00;
    events are occasionally recorded several minutes after 20:00; early close at 13:00 ET on some pre-holiday
    days (from the Trade Only guide; not restated for the adjusted product)'
- property: priceAdjustment
  value: adjusted (per-row multiplicative PriceAdjFactor and VolumeAdjFactor columns; method not documented
    for this product; sample arithmetic fits Price = raw price x PriceAdjFactor, rounded to 4 decimals)
- 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 only linked guide (Trade Only v2.7) does not document any adjusted-product field:
    ASID, PriceAdjFactor, VolumeAdjFactor and the adjustment method appear nowhere in it.'
  - 'Doc discrepancy: Renamed or reshaped versus the guide: Date -> TradeDate (yyyymmdd -> YYYY-MM-DD),
    Timestamp -> EventDateTime (date and time merged, always 9 fractional digits), Conditions -> ConditionCode
    (lower-case hex string -> decimal integer).'
  - 'Doc discrepancy: Guide says output is gzip CSV per symbol per day with millisecond timestamps before
    2016; the sample is an ArdaDB table whose EventDateTime always has nanosecond-width fractions.'
  - 'Doc discrepancy: Product page says ''since 2007'' but the guide documents no history start; coverage_start
    2007 comes from the page text only.'
  - 'Doc discrepancy: Guide''s Price is raw; here Price is the adjusted value (4 decimals), so values
    will not match the raw Trade Only/TAQ prices.'
  - 'Doc discrepancy: Exchange spelling follows the sample (''NASDAQ'') rather than the guide''s table
    (''Nasdaq'').'
  - 'Doc discrepancy: Guide has no ''Missing'' column; the sample has no empty cells.'
contractCreatedTs: '2026-11-02T00:00:00Z'
