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

# Danh sách gói vay

> Truy vấn danh sách gói vay để đặt lệnh theo từng mã chứng khoán.

Với giao dịch cơ sở, trả về **tối đa 2 gói vay** bao gồm:

- Gói tiền mặt: Tỷ lệ ký quỹ tiền mặt 100%, không sử dụng tiền vay margin (`initialRate` = 1)
    
- Gói vay ký quỹ (margin): Tỷ lệ ký quỹ dưới 100%, có sử dụng đòn bẩy tiền vay margin (`initialRate` ≠ 1)
    

Với giao dịch phái sinh, tài khoản thường chỉ áp dụng **một gói vay duy nhất** cho tất cả các mã, với bộ tỷ lệ ký quỹ và phí cố định.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-07-23.yaml get /accounts/{accountNo}/loan-packages
openapi: 3.0.0
info:
  title: OpenAPI-V2-Spec 260730
  version: 1.0.0
  description: DNSE OpenAPI spec and tests
servers:
  - url: https://openapi-uat.dnse.com.vn
security: []
paths:
  /accounts/{accountNo}/loan-packages:
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
    get:
      tags:
        - account
      summary: Danh sách gói vay
      description: >-
        Truy vấn danh sách gói vay để đặt lệnh theo từng mã chứng khoán.


        Với giao dịch cơ sở, trả về **tối đa 2 gói vay** bao gồm:


        - Gói tiền mặt: Tỷ lệ ký quỹ tiền mặt 100%, không sử dụng tiền vay
        margin (`initialRate` = 1)
            
        - Gói vay ký quỹ (margin): Tỷ lệ ký quỹ dưới 100%, có sử dụng đòn bẩy
        tiền vay margin (`initialRate` ≠ 1)
            

        Với giao dịch phái sinh, tài khoản thường chỉ áp dụng **một gói vay duy
        nhất** cho tất cả các mã, với bộ tỷ lệ ký quỹ và phí cố định.
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Gói vay giao dịch cơ sở
            - DERIVATIVE: Gói vay giao dịch phái sinh
            - BOND: Gói vay giao dịch trái phiếu
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: symbol
          in: query
          required: true
          description: Mã chứng khoán
          deprecated: false
          schema:
            type: string
          example: ACB
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: STOCK
          headers:
            Date:
              deprecated: false
              schema: {}
              example: Thu, 30 Jul 2026 04:44:20 GMT
            Vary:
              deprecated: false
              schema: {}
              example: Origin
            X-Ratelimit-Limit:
              deprecated: false
              schema: {}
              example: '-1'
            X-Ratelimit-Remaining:
              deprecated: false
              schema: {}
              example: '0'
            X-Ratelimit-Reset:
              deprecated: false
              schema: {}
              example: '1784800448'
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Transfer-Encoding:
              deprecated: false
              schema: {}
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  symbol:
                    type: string
                    example: ACB
                    description: Mã chứng khoán
                  marketType:
                    type: string
                    example: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Gói vay giao dịch cơ sở
                      - DERIVATIVE: Gói vay giao dịch phái sinh
                  loanPackages:
                    type: array
                    example:
                      - id: 1775
                        name: GD Tiền mặt
                        initialRate: 1
                        interestRate: 0.125
                        liquidRate: 0.3
                        maintenanceRate: 0.4
                        type: M
                        brokerFirmBuyingFeeRate: 0
                        brokerFirmSellingFeeRate: 0
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          format: int32
                          example: 1775
                          description: Id gói vay
                        name:
                          type: string
                          example: GD Tiền mặt
                          description: Tên gói vay
                        initialRate:
                          type: integer
                          format: int32
                          example: 1
                          description: Tỷ lệ ban đầu
                        interestRate:
                          type: number
                          format: float
                          example: 0.125
                          description: Tỷ lệ lãi vay
                        liquidRate:
                          type: number
                          format: double
                          example: 0.3
                          description: Tỷ lệ xử lý (force sell)
                        maintenanceRate:
                          type: number
                          format: double
                          example: 0.4
                          description: Tỷ lệ duy trì (call margin)
                        type:
                          type: string
                          example: M
                          description: Loại gói vay
                        brokerFirmBuyingFeeRate:
                          type: number
                          format: double
                          example: 0
                          description: Phí giao dịch chiều mua công ty chứng khoán thu
                        brokerFirmSellingFeeRate:
                          type: number
                          format: double
                          example: 0
                          description: Phí giao dịch chiều bán công ty chứng khoán thu
                    description: ''
              examples:
                STOCK:
                  value:
                    symbol: ACB
                    marketType: STOCK
                    loanPackages:
                      - id: 1775
                        name: GD Tiền mặt
                        initialRate: 1
                        interestRate: 0.125
                        liquidRate: 0.3
                        maintenanceRate: 0.4
                        type: M
                        brokerFirmBuyingFeeRate: 0
                        brokerFirmSellingFeeRate: 0
                      - id: 1769
                        name: RocketX
                        initialRate: 0.5
                        interestRate: 0.125
                        liquidRate: 0.3
                        maintenanceRate: 0.4
                        type: M
                        brokerFirmBuyingFeeRate: 0.00045
                        brokerFirmSellingFeeRate: 0.00045
                DERIVATIVE:
                  value:
                    symbolType: VN30F1M
                    marketType: DERIVATIVE
                    loanPackages:
                      - id: 2279
                        name: Gói giao dịch 02
                        initialRate: 0.1848
                        maintenanceRate: 0.1735
                        liquidRate: 0.1731
                        tradingFee:
                          id: 2404
                          name: 2000/HĐ
                          scope: PRODUCT
                          channel: ALL
                          schemaType: FIXED
                          createdDate: '2022-12-13T08:22:12.530837Z'
                          modifiedDate: '2022-12-13T08:22:12.530837Z'
                          fixedTradingFee: 2000
                          fixedDailyCloseTradingFee: 2000
                      - id: 5058
                        name: Test Phái sinh 1212
                        initialRate: 0.1
                        maintenanceRate: 0.03
                        liquidRate: 0.02
                        tradingFee:
                          id: 5057
                          name: 1500/HĐ
                          scope: PRODUCT
                          channel: ALL
                          schemaType: FIXED
                          createdDate: '2023-12-12T03:55:37.22881Z'
                          modifiedDate: '2023-12-12T03:55:37.22881Z'
                          fixedTradingFee: 1500
                          fixedDailyCloseTradingFee: 1500
                      - id: 2278
                        name: Gói giao dịch 01
                        initialRate: 0.2065
                        maintenanceRate: 0.1979
                        liquidRate: 0.1938
                        tradingFee:
                          id: 2436
                          name: Miễn phí
                          scope: PRODUCT
                          channel: ALL
                          schemaType: FIXED
                          createdDate: '2023-02-02T04:22:56.199278Z'
                          modifiedDate: '2023-02-02T04:22:56.199278Z'
                          fixedTradingFee: 2000
                          fixedDailyCloseTradingFee: 2000
                      - id: 9990
                        name: Linhpham test
                        initialRate: 0.2065
                        maintenanceRate: 0.1979
                        liquidRate: 0.1938
                        tradingFee:
                          id: 9989
                          name: fdfhv
                          scope: PRODUCT
                          channel: ALL
                          schemaType: PROGRESSIVE
                          createdDate: '2026-01-16T09:09:15.556640382Z'
                          modifiedDate: '2026-01-16T09:09:15.556640382Z'
                          progressTradingFee:
                            - fromQuantity: 1
                              toQuantity: 2000
                              fee: 1500
                          progressDailyCloseTradingFee:
                            - fromQuantity: 2001
                              toQuantity: 3000
                              fee: 2196
        '400':
          description: Yêu cầu không hợp lệ
          headers:
            Date:
              schema:
                type: string
              example: Wed, 25 Mar 2026 16:03:33 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 300
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 294
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1774540931
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: INVALID_INPUT
                    description: Mã lỗi
                  message:
                    type: string
                    example: marketType is invalid
                    description: Thông điệp lỗi
              example:
                status: 400
                code: INVALID_INPUT
                message: marketType is invalid
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500

````

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