# US Market data status scenario. It greets the API, imports KIS daily bars for US,
# then reads instruments and bars.
name: us_market_data_status_query
timeout: 5s
universes:
  - name: us-core
    provider: kis
    selector_kind: watchlist
    market: us
    venue: nasdaq
    symbols: ["AAPL"]
steps:
  - id: hello
    action: hello
    expect:
      status: ok
      capabilities:
        - market-read
  - id: import_us_daily_bars
    action: import_daily_bars
    request:
      universe: us-core
      from_yyyymmdd: "20240528"
      to_yyyymmdd: "20240529"
    expect:
      status: ok
  - id: list_us_instruments
    action: list_instruments
    request:
      market: us
    expect:
      status: ok
  - id: list_us_daily_bars
    action: list_bars
    request:
      instrument_id: "NASDAQ:AAPL"
      timeframe: daily
      from_unix_ms: 1716854400000 # 2024-05-28 00:00:00 UTC
      to_unix_ms: 1717027200000   # 2024-05-30 00:00:00 UTC
    expect:
      status: ok
  - id: freshness_status
    action: collection_freshness
    request:
      universe: us-core
      timeframe: daily
      from_unix_ms: 1716854400000
      to_unix_ms: 1717027200000
      expected_yyyymmdd: ["20240529"]
    expect:
      status: ok
      freshness_status: fresh
      missing_count: 0
      latest_yyyymmdd: "20240529"
      gap_status: clean
      gap_count: 0
      duplicate_count: 0
      provider_delay_days: 0

