# 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-trading-halts
name: AlgoSeek US Equities Trading Halts
version: 0.1.0
status: draft
domain: market-data
tags:
- algoseek
- licensed-data
- equity
- reference
- us
- event
description:
  purpose: One row per trading-halt case for a US equity symbol on a processing date, built from the CTA
    and UTP SIP feeds, with halt and resume timestamps (exchange and SIP clocks), raw and normalized reason
    codes and end-of-day status. Used for halt-duration analysis, trading controls and compliance monitoring.
  usage: Point-in-time security identity, corporate-action adjustment, and universe construction for US
    equities.
  limitations: 'Vendor-curated reference data: rows can be restated when AlgoSeek learns of a late or
    corrected event, so land each delivery as a snapshot rather than overwriting history. Identifiers:
    SecId and ASID are both algoseek keys ''added for cross-referencing with other US equity datasets'';
    both can be empty (e.g. test symbols such as ZWZZT/ZVZZT; FCHL, FFFZ, RNBW also lack ids in sample).
    Symbol is always present but is a ticker, not a stable key. ASID prefix 101 is for listed equities
    (OTC security master ASIDs start 121 in its sample). Date semantics: Date is the processing/file date.
    A halt that persists is repeated in later dates'' files with its original HaltDate (sample Date 20250814
    carries HaltDate 20250715 rows with EodStatus Halted); a halt that began earlier and resumed on Date
    also appears (ResumeDate = Date in every resumed sample row). Do not treat Date as the halt start;
    use HaltDate + HaltTime*. Time semantics: HaltTime* reflect dissemination of the halt notice, not
    necessarily the instant trading stopped. Each time exists in an Exch (exchange-stamped) and a Sip
    (SIP-stamped) version, both with nanosecond digits; in the sample SIP time is 14-614 microseconds
    after the exchange time, except one long-running halt (SVA, HaltDate 20241025) whose HaltTimeSip is
    about 52 minutes after HaltTimeExch. Time zone is not stated; times are bare clock strings without
    date, so combine with HaltDate/R… Open halts: a halt may outlast the session; then ResumeDate, UtpQuoteResumeTime*,
    TradeResumeTime* stay blank and EodStatus = Halted (17 of 60 sample rows). EodStatus = Trading implies
    ResumeDate is set (43 of 60).'
  authoritativeDefinitions:
  - type: businessDefinition
    url: https://algoseek.com/dataset/us-equities-trading-halts/
  - type: implementation
    url: https://algoseek.com/data-docs/equity-reference/algoseek.US.Equity.Trading.Halts.pdf
  - type: implementation
    url: https://algoseek.com/docs/rest-api/reference
context:
  instructions: Rows are effective-dated. Answer point-in-time questions with the row in force on the
    as-of date, never the latest row. SecId and ASID are both durable AlgoSeek security keys but different
    values (the ASID lookup links them); tickers are reused across companies, so resolve a ticker to a
    key with a trade date.
  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_TRADING_HALTS}/
  format: csv
  encoding: UTF-8
  customProperties:
  - property: layout
    value: 'Plain-text CSV with a fixed header; date-based aggregation: all halt data for the whole US
      equity universe for one trading date is stored in a single CSV file.'
  - 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-ref/trading-halts
  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_trading_halts
  physicalName: eq_trading_halts
  physicalType: file
  logicalType: object
  businessName: US Equities Trading Halts
  description: One row per trading-halt case for a US equity symbol on a processing date, built from the
    CTA and UTP SIP feeds, with halt and resume timestamps (exchange and SIP clocks), raw and normalized
    reason codes and end-of-day status. Used for halt-duration analysis, trading controls and compliance
    monitoring.
  dataGranularityDescription: one halt case (halt episode) per symbol, listed in the file for each processing
    Date on which it is active or resumed
  properties:
  - name: Date
    logicalType: date
    logicalTypeOptions:
      format: yyyymmdd
    physicalType: string (yyyymmdd) (csv text)
    description: Date on which this record was processed; one file per Date, and ongoing halts from earlier
      days are repeated under later Dates.
    primaryKey: true
    primaryKeyPosition: 1
    required: true
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: SecId
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: algoseek unique security identifier; blank for test symbols (6 of 60 sample rows).
    customProperties:
    - property: nullMeaning
      value: May be empty, e.g. for test symbols
    - property: evidence
      value: guide+sample
  - name: ASID
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: algoseek unique security identifier (second form, 16 digits in sample, prefix 101); blank
      when SecId is blank.
    customProperties:
    - property: nullMeaning
      value: May be empty, e.g. for test symbols
    - property: evidence
      value: guide+sample
  - name: Symbol
    logicalType: string
    physicalType: string (csv text)
    description: Ticker symbol; may include exchange test symbols (e.g. ZWZZT, ZVZZT) for completeness.
    primaryKey: true
    primaryKeyPosition: 2
    required: true
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: OrigExch
    logicalType: string
    physicalType: string (csv text)
    description: Exchange where the halt originated, typically the primary listing venue (Nasdaq, NYSE
      American in sample).
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: Plan
    logicalType: string
    physicalType: string (csv text)
    description: SIP plan under which the halt was reported; decides which fields are populated.
    enum:
    - value: CTA
      label: Consolidated Tape Association SIP plan (NYSE, NYSE American and other CTA-listed securities)
    - value: UTP
      label: UTP SIP plan (Nasdaq-listed securities)
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: EodStatus
    logicalType: string
    physicalType: string (csv text)
    description: Trading status of the security at market close.
    enum:
    - value: Halted
      label: Still halted at the market close
    - value: Trading
      label: Resumed by the close
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: HaltDate
    logicalType: date
    logicalTypeOptions:
      format: yyyymmdd
    physicalType: string (yyyymmdd) (csv text)
    description: Date the present halt began; can be earlier than Date for multi-day halts.
    primaryKey: true
    primaryKeyPosition: 3
    required: true
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: HaltTimeExch
    logicalType: time
    logicalTypeOptions:
      format: HH:MM:SS.mmmuuunnn
    physicalType: string (HH:MM:SS.mmmuuunnn) (csv text)
    description: Exchange-provided timestamp, nanosecond precision, when the halt was activated.
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: HaltTimeSip
    logicalType: time
    logicalTypeOptions:
      format: HH:MM:SS.mmmuuunnn
    physicalType: string (HH:MM:SS.mmmuuunnn) (csv text)
    description: SIP-provided timestamp when the halt message was disseminated.
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: CtaLastPricePreHalt
    logicalType: number
    physicalType: decimal (csv text)
    description: Last price before the halt from CTA-plan exchanges; currency not stated (USD implied).
    customProperties:
    - property: nullMeaning
      value: Blank for UTP-plan securities (not available); otherwise unstated
    - property: evidence
      value: guide+sample
  - name: ResumeDate
    logicalType: date
    logicalTypeOptions:
      format: yyyymmdd
    physicalType: string (yyyymmdd) (csv text)
    description: Date on which trading resumed.
    customProperties:
    - property: nullMeaning
      value: Blank until the halt is lifted (halt may persist beyond the session)
    - property: evidence
      value: guide+sample
  - name: UtpQuoteResumeTimeExch
    logicalType: time
    logicalTypeOptions:
      format: HH:MM:SS.mmmuuunnn
    physicalType: string (HH:MM:SS.mmmuuunnn) (csv text)
    description: Exchange-provided timestamp when quotation resumed, for UTP-plan securities.
    customProperties:
    - property: nullMeaning
      value: Blank for CTA plan and until quotes resume
    - property: evidence
      value: guide+sample
  - name: UtpQuoteResumeTimeSip
    logicalType: time
    logicalTypeOptions:
      format: HH:MM:SS.mmmuuunnn
    physicalType: string (HH:MM:SS.mmmuuunnn) (csv text)
    description: SIP-provided timestamp when quotation resumed, for UTP-plan securities.
    customProperties:
    - property: nullMeaning
      value: Blank for CTA plan and until quotes resume
    - property: evidence
      value: guide+sample
  - name: TradeResumeTimeExch
    logicalType: time
    logicalTypeOptions:
      format: HH:MM:SS.mmmuuunnn
    physicalType: string (HH:MM:SS.mmmuuunnn) (csv text)
    description: Exchange-provided timestamp when the security resumed trading.
    customProperties:
    - property: nullMeaning
      value: Blank until the halt is lifted
    - property: evidence
      value: guide+sample
  - name: TradeResumeTimeSip
    logicalType: time
    logicalTypeOptions:
      format: HH:MM:SS.mmmuuunnn
    physicalType: string (HH:MM:SS.mmmuuunnn) (csv text)
    description: SIP-provided timestamp when the resumption message was disseminated.
    customProperties:
    - property: nullMeaning
      value: Blank until the halt is lifted
    - property: evidence
      value: guide+sample
  - name: AsNormRsnCode
    logicalType: string
    logicalTypeOptions:
      format: one or more codes separated by semicolon (e.g. P;D)
    physicalType: string (csv text)
    description: algoseek-normalized halt reason code(s), semicolon-separated when several reasons apply.
    enum:
    - value: <space>
      label: Reason Not Available
    - value: A
      label: Additional Information Requested
    - value: C
      label: Regulatory Concern
    - value: D
      label: News Released
    - value: F
      label: ETF Component Prices Not Available
    - value: V
      label: Volatility Pause
    - value: O
      label: Security Offering
    - value: N
      label: Corporation Action
    - value: P
      label: News Pending
    - value: NQ
      label: Quote Not Available
    - value: X
      label: Operational
    - value: NC
      label: Non Compliance
    - value: '1'
      label: Market-Wide Circuit Breaker Level 1 - Breached
    - value: '2'
      label: Market-Wide Circuit Breaker Level 2 - Breached
    - value: '3'
      label: Market-Wide Circuit Breaker Level 3 - Breached
    - value: '0'
      label: Market Wide Circuit Breaker Resumption
    customProperties:
    - property: nullMeaning
      value: Blank in 13 of 60 sample rows (UTP reason may be unavailable at halt start)
    - property: evidence
      value: guide+sample
  - name: AsNormRsn
    logicalType: string
    logicalTypeOptions:
      format: one or more descriptions separated by semicolon
    physicalType: string (csv text)
    description: algoseek-normalized reason description(s), semicolon-separated.
    customProperties:
    - property: nullMeaning
      value: Blank when AsNormRsnCode is blank
    - property: evidence
      value: guide+sample
  - name: ExchRsnCode
    logicalType: string
    logicalTypeOptions:
      format: one or more exchange codes separated by semicolon (e.g. T1;T3)
    physicalType: string (csv text)
    description: Original exchange reason code(s) from CTA or UTP, semicolon-separated.
    customProperties:
    - property: nullMeaning
      value: Blank in 13 of 60 sample rows
    - property: evidence
      value: guide+sample
  - name: HaltCaseSeq
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: string (csv text)
    description: Sequence number of the halt case during a trading session (1..5 in sample); guide types
      it string, sample values are integers.
    primaryKey: true
    primaryKeyPosition: 4
    required: true
    customProperties:
    - property: nullMeaning
      value: unstated (always populated in sample)
    - property: evidence
      value: guide+sample
  - name: TotalMessages
    logicalType: integer
    logicalTypeOptions:
      format: i64
    physicalType: integer (csv text)
    description: Total number of messages for the halt (1-4 in sample).
    customProperties:
    - property: unit
      value: count
    - property: nullMeaning
      value: unstated (always populated in sample)
    - 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
      - Symbol
      - HaltDate
      - HaltCaseSeq
    dimension: uniqueness
    severity: error
    description: The declared primary key is unique within each delivered partition (one file or table
      snapshot).
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-ref
- property: vendorDatasetTextId
  value: eq_trading_halts
- property: vendorSampleUrl
  value: https://as-metadata-services-assets.s3.amazonaws.com/sample_data/cloud_storage/eq_trading_halts.csv
- property: assetClass
  value: equity
- property: venues
  value:
  - Nasdaq
  - NYSE
  - NYSE American
- property: coverage
  value: Halts across all US equity exchanges, derived from the CTA feed (NYSE, NYSE American and other
    listed securities) and UTP feed (Nasdaq-listed and UTP-eligible securities). History start is not
    stated in the guide.
- property: timezone
  value: America/New_York
- property: timestampFormat
  value: HH:MM:SS.mmmuuunnn (nanosecond precision) for times; yyyymmdd for dates
- property: sessionHours
  value: extended hours seen in sample (04:00:00 to 19:50:00)
- property: priceAdjustment
  value: n/a
- 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: Header spelling differs between guide and sample: the guide Table 2 lists HaltTimeSIP
    and TradeResumeTimeSIP, the published CSV header uses HaltTimeSip and TradeResumeTimeSip (UtpQuoteResumeTimeSip
    matches in both).'
  - 'Doc discrepancy: Guide types HaltCaseSeq as string, but every sample value is a small integer (1-5);
    guide types TotalMessages as integer.'
  - 'Doc discrepancy: Guide AsNormRsn text for code D is ''News Released'' (Tables 3 and 4), but sample
    rows with D carry the longer ''News Released (formerly News Dissemination)''.'
  - 'Doc discrepancy: Guide Table 4 describes the Level 2 circuit-breaker resumption as ''if previously
    level 3'' (apparent typo for level 2) and spells ''Filling Requirements'' for ''Filing Requirements''.'
  - 'Doc discrepancy: Guide Table 1 sample for the CTA row (ACCS) shows a time under UtpQuoteResumeTimeSip,
    which the field definition limits to UTP-plan securities; the published CSV has that CTA value in
    TradeResumeTimeExch and leaves UtpQuoteResumeTime* blank, so the guide example is likely mis-aligned
    (possibly a layout artifact).'
  - 'Doc discrepancy: Guide gives no Missing column; blank behavior is only described in prose (special
    cases section) and the SecId/ASID field text.'
  - 'Doc discrepancy: Guide says both SecId and ASID are ''algoseek unique security identifier'' with
    identical text; the two are distinct values (SecId 7-8 digits, ASID 16 digits starting 101 in sample)
    and the guide does not explain the difference.'
contractCreatedTs: '2026-11-02T00:00:00Z'
