> ## 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.

# Khớp lệnh nâng cao

> Gửi cập nhật khớp lệnh nâng cao theo danh sách mã chứng khoán.



## AsyncAPI

````yaml vi/asyncapi/dnse.2026-09-10.asyncapi.yaml tradeExtraStream
id: tradeExtraStream
title: Khớp lệnh nâng cao
description: Gửi cập nhật khớp lệnh nâng cao theo danh sách mã chứng khoán.
servers:
  - id: production
    protocol: wss
    host: ws-openapi.dnse.com.vn
    bindings: []
    variables: []
  - id: sanbox
    protocol: wss
    host: ws-sb-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 (`json`, `msgpack`).
    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 (`json`, `msgpack`).
            required: true
operations:
  - &ref_1
    id: onTradeExtraSubscription
    title: Đăng ký luồng khớp lệnh nâng cao
    type: receive
    messages:
      - &ref_3
        id: subscribeRequest
        contentType: application/json
        payload:
          - name: Đăng ký luồng khớp lệnh nâng cao
            description: Đăng ký topic `tick_extra.{market_group}.{encoding}`.
            type: object
            properties:
              - name: action
                type: string
                description: subscribe
                required: true
              - name: channels
                type: array
                required: true
                properties:
                  - name: name
                    type: string
                    description: Topic khớp lệnh nâng cao theo nhóm thị trường.
                    required: true
                  - name: symbols
                    type: array
                    required: true
                    properties:
                      - name: item
                        type: string
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - action
            - channels
          properties:
            action:
              type: string
              const: subscribe
              x-parser-schema-id: <anonymous-schema-80>
            channels:
              type: array
              minItems: 1
              uniqueItems: true
              items:
                type: object
                additionalProperties: false
                required:
                  - name
                  - symbols
                properties:
                  name:
                    type: string
                    description: Topic khớp lệnh nâng cao theo nhóm thị trường.
                    pattern: ^tick_extra\.[A-Z0-9]+\.json$
                    x-parser-schema-id: <anonymous-schema-83>
                  symbols:
                    type: array
                    minItems: 1
                    uniqueItems: true
                    items:
                      type: string
                      minLength: 1
                      x-parser-schema-id: <anonymous-schema-85>
                    x-parser-schema-id: <anonymous-schema-84>
                x-parser-schema-id: <anonymous-schema-82>
              x-parser-schema-id: <anonymous-schema-81>
          x-parser-schema-id: <anonymous-schema-79>
        title: Đăng ký luồng khớp lệnh nâng cao
        description: Đăng ký topic `tick_extra.{market_group}.{encoding}`.
        example: |-
          {
            "action": "subscribe",
            "channels": [
              {
                "name": "tick_extra.G1.json",
                "symbols": [
                  "HPG"
                ]
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribeRequest
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: tradeExtraStream
  - &ref_2
    id: onTradeExtraUpdates
    title: Nhận cập nhật khớp lệnh nâng cao
    type: send
    messages:
      - &ref_4
        id: update
        contentType: application/json
        payload:
          - name: Cập nhật khớp lệnh nâng cao
            description: Bản cập nhật giao dịch kèm giá bình quân và chiều giao dịch.
            type: object
            properties:
              - name: T
                type: string
                description: Mã loại message khớp lệnh nâng cao.
                required: true
              - name: symbol
                type: string
                description: Mã chứng khoán.
                required: true
              - name: marketId
                type: string
                description: Mã thị trường niêm yết mã chứng khoán.
                required: true
              - name: boardId
                type: string
                description: Mã bảng giao dịch.
                required: true
              - name: isin
                type: string
                description: Mã định danh quốc tế (ISIN) của chứng khoán.
                required: true
              - name: matchPrice
                type: number
                description: Giá khớp gần nhất.
                required: true
              - name: matchQtty
                type: number
                description: Khối lượng khớp gần nhất.
                required: true
              - name: avgPrice
                type: number
                description: Giá khớp trung bình.
                required: true
              - name: side
                type: string
                description: Chiều mua hoặc bán chủ động.
                required: true
              - name: totalVolumeTraded
                type: integer
                description: Tổng khối lượng khớp trong ngày.
                required: true
              - name: grossTradeAmount
                type: number
                description: Tổng giá trị giao dịch trong ngày.
                required: true
              - name: highestPrice
                type: number
                description: Giá khớp cao nhất trong ngày.
                required: true
              - name: lowestPrice
                type: number
                description: Giá khớp thấp nhất trong ngày.
                required: true
              - name: openPrice
                type: number
                description: Giá mở cửa.
                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: time
                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: Dữ liệu khớp lệnh nâng cao theo thời gian thực.
          required:
            - T
            - symbol
            - matchPrice
            - matchQtty
            - marketId
            - boardId
            - isin
            - avgPrice
            - side
            - totalVolumeTraded
            - grossTradeAmount
            - highestPrice
            - lowestPrice
            - openPrice
            - tradingSessionId
            - multicastReceiveTime
            - time
          properties:
            T:
              type: string
              description: Mã loại message khớp lệnh nâng cao.
              const: te
              x-parser-schema-id: <anonymous-schema-87>
            symbol:
              type: string
              description: Mã chứng khoán.
              x-parser-schema-id: <anonymous-schema-88>
            marketId:
              type: string
              description: Mã thị trường niêm yết mã chứng khoán.
              x-parser-schema-id: <anonymous-schema-89>
            boardId:
              type: string
              description: Mã bảng giao dịch.
              x-parser-schema-id: <anonymous-schema-90>
            isin:
              type: string
              description: Mã định danh quốc tế (ISIN) của chứng khoán.
              x-parser-schema-id: <anonymous-schema-91>
            matchPrice:
              type: number
              description: Giá khớp gần nhất.
              x-parser-schema-id: <anonymous-schema-92>
            matchQtty:
              type: number
              description: Khối lượng khớp gần nhất.
              x-parser-schema-id: <anonymous-schema-93>
            avgPrice:
              type: number
              description: Giá khớp trung bình.
              x-parser-schema-id: <anonymous-schema-94>
            side:
              type: string
              description: Chiều mua hoặc bán chủ động.
              x-parser-schema-id: <anonymous-schema-95>
            totalVolumeTraded:
              type: integer
              description: Tổng khối lượng khớp trong ngày.
              x-parser-schema-id: <anonymous-schema-96>
            grossTradeAmount:
              type: number
              description: Tổng giá trị giao dịch trong ngày.
              x-parser-schema-id: <anonymous-schema-97>
            highestPrice:
              type: number
              description: Giá khớp cao nhất trong ngày.
              x-parser-schema-id: <anonymous-schema-98>
            lowestPrice:
              type: number
              description: Giá khớp thấp nhất trong ngày.
              x-parser-schema-id: <anonymous-schema-99>
            openPrice:
              type: number
              description: Giá mở cửa.
              x-parser-schema-id: <anonymous-schema-100>
            tradingSessionId:
              type: string
              description: Mã phiên giao dịch hiện tại.
              x-parser-schema-id: <anonymous-schema-101>
            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-103>
                Nanos:
                  type: integer
                  format: int32
                  description: Phần nanosecond của timestamp.
                  x-parser-schema-id: <anonymous-schema-104>
              x-parser-schema-id: <anonymous-schema-102>
            time:
              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-106>
                Nanos:
                  type: integer
                  format: int32
                  description: Phần nanosecond của timestamp.
                  x-parser-schema-id: <anonymous-schema-107>
              x-parser-schema-id: <anonymous-schema-105>
          x-parser-schema-id: <anonymous-schema-86>
        title: Cập nhật khớp lệnh nâng cao
        description: Bản cập nhật giao dịch kèm giá bình quân và chiều giao dịch.
        example: |-
          {
            "T": "te",
            "avgPrice": 21.006,
            "boardId": "G1",
            "grossTradeAmount": 218.2127,
            "highestPrice": 21.2,
            "isin": "VN000000HPG4",
            "lowestPrice": 20.9,
            "marketId": "STO",
            "matchPrice": 21,
            "matchQtty": 50,
            "multicastReceiveTime": {
              "Nanos": 518530993,
              "Seconds": 1787121509
            },
            "openPrice": 21.1,
            "side": "SELL",
            "symbol": "HPG",
            "time": {
              "Nanos": 879000000,
              "Seconds": 1787121511
            },
            "totalVolumeTraded": 1038820,
            "tradingSessionId": "40"
          }
        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: tradeExtraStream
securitySchemes: []

````

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