> ## Documentation Index
> Fetch the complete documentation index at: https://hoalulab.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Chỉ số thị trường

> Cung cấp thông tin chỉ số thị trường bao gồm giá trị chỉ số, mức thay đổi, 
độ rộng thị trường (số mã tăng/giảm/đi ngang) và thanh khoản. 
Dữ liệu được cập nhật liên tục trong phiên giao dịch.



## AsyncAPI

````yaml vi/openapi/dnse-v2-asyncapi.yaml marketIndexStream
id: marketIndexStream
title: Chỉ số thị trường
description: |-
  Cung cấp thông tin chỉ số thị trường bao gồm giá trị chỉ số, mức thay đổi, 
  độ rộng thị trường (số mã tăng/giảm/đi ngang) và thanh khoản. 
  Dữ liệu được cập nhật liên tục trong phiên giao dịch.
servers:
  - id: production
    protocol: wss
    host: ws-openapi.dnse.com.vn
    bindings: []
    variables: []
address: /v1/stream
parameters: []
bindings:
  - protocol: ws
    version: 0.1.0
    value:
      method: GET
      query:
        type: object
        additionalProperties: false
        required:
          - encoding
        properties:
          encoding:
            type: string
            const: json
            default: json
            description: Định dạng mã hóa dữ liệu WebSocket.
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: query
        type: object
        required: false
        properties:
          - name: encoding
            type: string
            description: Định dạng mã hóa dữ liệu WebSocket.
            required: true
operations:
  - &ref_1
    id: onMarketIndexSubscription
    title: Đăng ký luồng chỉ số thị trường
    type: receive
    messages:
      - &ref_3
        id: subscribeRequest
        contentType: application/json
        payload:
          - name: Đăng ký luồng chỉ số thị trường
            description: Đăng ký topic `market_index.{index_name}.json`.
            type: object
            properties:
              - name: action
                type: string
                description: subscribe
                required: true
              - name: channels
                type: array
                required: true
                properties:
                  - name: name
                    type: string
                    description: Topic chỉ số thị trường theo tên chỉ số.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - action
            - channels
          properties:
            action:
              type: string
              const: subscribe
              x-parser-schema-id: <anonymous-schema-276>
            channels:
              type: array
              minItems: 1
              uniqueItems: true
              items:
                type: object
                additionalProperties: false
                required:
                  - name
                properties:
                  name:
                    type: string
                    description: Topic chỉ số thị trường theo tên chỉ số.
                    pattern: ^market_index\.[A-Z0-9]+\.json$
                    x-parser-schema-id: <anonymous-schema-279>
                x-parser-schema-id: <anonymous-schema-278>
              x-parser-schema-id: <anonymous-schema-277>
          x-parser-schema-id: <anonymous-schema-275>
        title: Đăng ký luồng chỉ số thị trường
        description: Đăng ký topic `market_index.{index_name}.json`.
        example: |-
          {
            "action": "subscribe",
            "channels": [
              {
                "name": "market_index.VN30.json"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribeRequest
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: marketIndexStream
  - &ref_2
    id: onMarketIndexUpdates
    title: Nhận cập nhật chỉ số thị trường
    type: send
    messages:
      - &ref_4
        id: update
        contentType: application/json
        payload:
          - name: Cập nhật chỉ số thị trường
            description: Bản cập nhật giá trị và biến động của chỉ số thị trường.
            type: object
            properties:
              - name: T
                type: string
                description: Mã loại message chỉ số thị trường.
                required: true
              - name: indexName
                type: string
                description: Tên chỉ số thị trường.
                required: true
              - name: valueIndexes
                type: number
                description: Giá trị hiện tại của chỉ số.
                required: true
              - name: changedValue
                type: number
                description: Giá trị tăng hoặc giảm so với giá tham chiếu.
                required: true
              - name: changedRatio
                type: number
                description: Tỷ lệ phần trăm tăng hoặc giảm so với giá tham chiếu.
                required: true
              - name: fluctuationSteadinessIssueCount
                type: integer
                description: Số lượng mã có giá không đổi.
                required: true
              - name: fluctuationDownIssueCount
                type: integer
                description: Số lượng mã có giá giảm.
                required: true
              - name: fluctuationUpIssueCount
                type: integer
                description: Số lượng mã có giá tăng.
                required: true
              - name: fluctuationLowerLimitIssueCount
                type: integer
                description: Số lượng mã giảm sàn.
                required: true
              - name: fluctuationUpperLimitIssueCount
                type: integer
                description: Số lượng mã tăng trần.
                required: true
              - name: fluctuationDownIssueVolume
                type: integer
                description: Tổng khối lượng giao dịch các mã có giá giảm.
                required: true
              - name: fluctuationUpIssueVolume
                type: integer
                description: Tổng khối lượng giao dịch các mã có giá tăng.
                required: true
              - name: fluctuationSteadinessIssueVolume
                type: integer
                description: Tổng khối lượng giao dịch các mã có giá không đổi.
                required: true
              - name: currencyCode
                type: string
                description: Đơn vị tiền tệ.
                required: true
              - name: indexTypeCode
                type: string
                description: Mã loại chỉ số.
                required: true
              - name: lowestValueIndexes
                type: number
                description: Giá thấp nhất trong phiên.
                required: true
              - name: highestValueIndexes
                type: number
                description: Giá cao nhất trong phiên.
                required: true
              - name: priorValueIndexes
                type: number
                description: Giá trị tham chiếu.
                required: true
              - name: contauctAccTrdVal
                type: number
                description: Tổng giá trị giao dịch theo phương thức khớp lệnh.
                required: true
              - name: contauctAccTrdVol
                type: integer
                description: Tổng khối lượng giao dịch theo phương thức khớp lệnh.
                required: true
              - name: blkTrdAccTrdVal
                type: number
                description: Tổng giá trị giao dịch theo phương thức thỏa thuận.
                required: true
              - name: blkTrdAccTrdVol
                type: integer
                description: Tổng khối lượng giao dịch theo phương thức thỏa thuận.
                required: true
              - name: grossTradeAmount
                type: number
                description: Tổng giá trị giao dịch trong ngày.
                required: true
              - name: totalVolumeTraded
                type: integer
                description: Tổng khối lượng giao dịch trong ngày.
                required: true
              - name: marketIndexClass
                type: oneOf
                description: Phân loại chỉ số.
                required: true
              - name: marketId
                type: string
                description: Mã thị trường.
                required: true
              - name: tradingSessionId
                type: string
                description: Mã phiên giao dịch hiện tại.
                required: true
              - name: multicastReceiveTime
                type: object
                description: Thời gian nhận message qua multicast.
                required: true
                properties:
                  - name: Seconds
                    type: integer
                    description: Unix timestamp tính bằng giây.
                    required: true
                  - name: Nanos
                    type: integer
                    description: Phần nanosecond của timestamp.
                    required: true
              - name: transactTime
                type: object
                description: Thời gian trong các message giá của sàn trả về.
                required: true
                properties:
                  - name: Seconds
                    type: integer
                    description: Unix timestamp tính bằng giây.
                    required: true
                  - name: Nanos
                    type: integer
                    description: Phần nanosecond của timestamp.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Cập nhật từ topic `market_index.{index_name}.json`.
          required:
            - T
            - indexName
            - valueIndexes
            - changedValue
            - changedRatio
            - fluctuationSteadinessIssueCount
            - fluctuationDownIssueCount
            - fluctuationUpIssueCount
            - fluctuationLowerLimitIssueCount
            - fluctuationUpperLimitIssueCount
            - fluctuationDownIssueVolume
            - fluctuationUpIssueVolume
            - fluctuationSteadinessIssueVolume
            - currencyCode
            - indexTypeCode
            - lowestValueIndexes
            - highestValueIndexes
            - priorValueIndexes
            - contauctAccTrdVal
            - contauctAccTrdVol
            - blkTrdAccTrdVal
            - blkTrdAccTrdVol
            - grossTradeAmount
            - totalVolumeTraded
            - marketIndexClass
            - marketId
            - tradingSessionId
            - multicastReceiveTime
            - transactTime
          properties:
            T:
              type: string
              description: Mã loại message chỉ số thị trường.
              const: mi
              x-parser-schema-id: <anonymous-schema-281>
            indexName:
              type: string
              description: Tên chỉ số thị trường.
              x-parser-schema-id: <anonymous-schema-282>
            valueIndexes:
              type: number
              description: Giá trị hiện tại của chỉ số.
              x-parser-schema-id: <anonymous-schema-283>
            changedValue:
              type: number
              description: Giá trị tăng hoặc giảm so với giá tham chiếu.
              x-parser-schema-id: <anonymous-schema-284>
            changedRatio:
              type: number
              description: Tỷ lệ phần trăm tăng hoặc giảm so với giá tham chiếu.
              x-parser-schema-id: <anonymous-schema-285>
            fluctuationSteadinessIssueCount:
              type: integer
              description: Số lượng mã có giá không đổi.
              x-parser-schema-id: <anonymous-schema-286>
            fluctuationDownIssueCount:
              type: integer
              description: Số lượng mã có giá giảm.
              x-parser-schema-id: <anonymous-schema-287>
            fluctuationUpIssueCount:
              type: integer
              description: Số lượng mã có giá tăng.
              x-parser-schema-id: <anonymous-schema-288>
            fluctuationLowerLimitIssueCount:
              oneOf:
                - type: integer
                  x-parser-schema-id: <anonymous-schema-290>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-291>
              description: Số lượng mã giảm sàn.
              x-parser-schema-id: <anonymous-schema-289>
            fluctuationUpperLimitIssueCount:
              type: integer
              description: Số lượng mã tăng trần.
              x-parser-schema-id: <anonymous-schema-292>
            fluctuationDownIssueVolume:
              type: integer
              format: int64
              description: Tổng khối lượng giao dịch các mã có giá giảm.
              x-parser-schema-id: <anonymous-schema-293>
            fluctuationUpIssueVolume:
              type: integer
              format: int64
              description: Tổng khối lượng giao dịch các mã có giá tăng.
              x-parser-schema-id: <anonymous-schema-294>
            fluctuationSteadinessIssueVolume:
              type: integer
              format: int64
              description: Tổng khối lượng giao dịch các mã có giá không đổi.
              x-parser-schema-id: <anonymous-schema-295>
            currencyCode:
              type: string
              description: Đơn vị tiền tệ.
              x-parser-schema-id: <anonymous-schema-296>
            indexTypeCode:
              type: string
              description: Mã loại chỉ số.
              x-parser-schema-id: <anonymous-schema-297>
            lowestValueIndexes:
              type: number
              description: Giá thấp nhất trong phiên.
              x-parser-schema-id: <anonymous-schema-298>
            highestValueIndexes:
              type: number
              description: Giá cao nhất trong phiên.
              x-parser-schema-id: <anonymous-schema-299>
            priorValueIndexes:
              type: number
              description: Giá trị tham chiếu.
              x-parser-schema-id: <anonymous-schema-300>
            contauctAccTrdVal:
              type: number
              description: Tổng giá trị giao dịch theo phương thức khớp lệnh.
              x-parser-schema-id: <anonymous-schema-301>
            contauctAccTrdVol:
              type: integer
              format: int64
              description: Tổng khối lượng giao dịch theo phương thức khớp lệnh.
              x-parser-schema-id: <anonymous-schema-302>
            blkTrdAccTrdVal:
              type: number
              description: Tổng giá trị giao dịch theo phương thức thỏa thuận.
              x-parser-schema-id: <anonymous-schema-303>
            blkTrdAccTrdVol:
              type: integer
              format: int64
              description: Tổng khối lượng giao dịch theo phương thức thỏa thuận.
              x-parser-schema-id: <anonymous-schema-304>
            grossTradeAmount:
              type: number
              description: Tổng giá trị giao dịch trong ngày.
              x-parser-schema-id: <anonymous-schema-305>
            totalVolumeTraded:
              type: integer
              format: int64
              description: Tổng khối lượng giao dịch trong ngày.
              x-parser-schema-id: <anonymous-schema-306>
            marketIndexClass:
              oneOf:
                - type: integer
                  x-parser-schema-id: <anonymous-schema-308>
                - type: string
                  x-parser-schema-id: <anonymous-schema-309>
              description: Phân loại chỉ số.
              x-parser-schema-id: <anonymous-schema-307>
            marketId:
              type: string
              description: Mã thị trường.
              x-parser-schema-id: <anonymous-schema-310>
            tradingSessionId:
              type: string
              description: Mã phiên giao dịch hiện tại.
              x-parser-schema-id: <anonymous-schema-311>
            multicastReceiveTime:
              type: object
              description: Thời gian nhận message qua multicast.
              required:
                - Seconds
                - Nanos
              properties:
                Seconds:
                  type: integer
                  format: int64
                  description: Unix timestamp tính bằng giây.
                  x-parser-schema-id: <anonymous-schema-313>
                Nanos:
                  type: integer
                  format: int32
                  description: Phần nanosecond của timestamp.
                  x-parser-schema-id: <anonymous-schema-314>
              x-parser-schema-id: <anonymous-schema-312>
            transactTime:
              type: object
              description: Thời gian trong các message giá của sàn trả về.
              required:
                - Seconds
                - Nanos
              properties:
                Seconds:
                  type: integer
                  format: int64
                  description: Unix timestamp tính bằng giây.
                  x-parser-schema-id: <anonymous-schema-316>
                Nanos:
                  type: integer
                  format: int32
                  description: Phần nanosecond của timestamp.
                  x-parser-schema-id: <anonymous-schema-317>
              x-parser-schema-id: <anonymous-schema-315>
          x-parser-schema-id: <anonymous-schema-280>
        title: Cập nhật chỉ số thị trường
        description: Bản cập nhật giá trị và biến động của chỉ số thị trường.
        example: |-
          {
            "T": "mi",
            "blkTrdAccTrdVal": 1633.46998985,
            "blkTrdAccTrdVol": 62679813,
            "changedRatio": -0.46,
            "changedValue": -8.570000000000164,
            "contauctAccTrdVal": 4001.6785832,
            "contauctAccTrdVol": 119469304,
            "currencyCode": "VND",
            "fluctuationDownIssueCount": 24,
            "fluctuationDownIssueVolume": 151005844,
            "fluctuationSteadinessIssueCount": 2,
            "fluctuationSteadinessIssueVolume": 19131891,
            "fluctuationUpIssueCount": 4,
            "fluctuationUpIssueVolume": 12011382,
            "grossTradeAmount": 5635.14857305,
            "highestValueIndexes": 1879.66,
            "indexName": "VN30",
            "indexTypeCode": "101",
            "lowestValueIndexes": 1864.16,
            "marketId": "STO",
            "marketIndexClass": "HSX",
            "multicastReceiveTime": {
              "Nanos": 771733668,
              "Seconds": 1787122657
            },
            "priorValueIndexes": 1876.14,
            "totalVolumeTraded": 182149117,
            "tradingSessionId": "40",
            "transactTime": {
              "Nanos": 75000000,
              "Seconds": 1787122660
            },
            "valueIndexes": 1867.57
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: update
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
extensions:
  - id: x-parser-unique-object-id
    value: marketIndexStream
securitySchemes: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.