> For the complete documentation index, see [llms.txt](https://hdsd2.entrade.com.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hdsd2.entrade.com.vn/entrade-api/4.-lay-danh-sach-goi-vay.md).

# 4. Lấy danh sách gói vay

* **URL:**
  * PROD: <https://services.entrade.com.vn/entrade-api/investors/:investorId/derivative_margin_portfolios>
  * PAPERTRADE: <https://services.entrade.com.vn/papertrade-entrade-api/investors/:investorId/derivative_margin_portfolios>
* **Method:** `GET`
* **Description:** Lấy danh sách gói vay
* **Parameters:**
  * `investorId`: Mã investorId của Khách Hàng
* **Response:**

```
{
    "total": 1,
    "data": [
        {
            "id": 123,
            "bankId": 10001,
            "bankAccountId": 1000005,
            "name": "Gói kỹ quỹ 5%",
            "interestRate": 4.11E-4,
            "tradingFeeRate": 15750.0,
            "overdueInterestRate": 0.0,
            "loanTerm": 30,
            "maxLoanPool": 1.0E10,
            "coInvestTaxRate": 0.05,
            "createdDate": "2025-08-15T07:18:32.574Z",
            "modifiedDate": "2025-10-08T03:18:12.780Z",
            "closedPositionFee": 4.11E-4,
            "tradingTaxRate": 0.0,
            "portfolio": [
                {
                    "symbol": "VN30F1M",
                    "initialRate": 0.05,
                    "maintenanceRate": 0.03,
                    "liquidateRate": 0.02,
                    "overnightRate": 0.05,
                    "dailyStockBorrowFee": 0.0,
                    "withdrawalRate": 0.05,
                    "additionalRate": 0.05,
                    "companySecureRate": 0.2,
                    "vsdSecureRate": 0.17,
                    "bankSecureRate": 0.2
                },
                {
                    "symbol": "VN30F2M",
                    "initialRate": 0.05,
                    "maintenanceRate": 0.03,
                    "liquidateRate": 0.02,
                    "overnightRate": 0.05,
                    "dailyStockBorrowFee": 0.0,
                    "withdrawalRate": 0.05,
                    "additionalRate": 0.05,
                    "companySecureRate": 0.2,
                    "vsdSecureRate": 0.17,
                    "bankSecureRate": 0.2
                }
            ],
            "assetManagementOvernightFee": 0.0,
            "autoAdvanceRealizedProfit": true,
            "displaySymbols": [
                "VN30F2512"
            ]
        }
    ]
}
```

* **Mô tả (các field quan trọng):**
  * `id`: mã id của gói vay
  * `name`: tên mô tả gói vay
  * `interesRate`: lãi vay/ lãi qua đêm
  * `tradingFeeRate`: phí giao dịch
  * `closedPositionFee`: phí đóng mở trong ngày
  * `autoAdvanceRealizedProfit`: có tự đồng tính lãi đã chốt vào sức mua hay không
  * `coInvestTaxRate`: phần trăm thuế
  * `portfolio`: Chi tiết gói vay theo mã
    * `symbol`: Mã phái sinh
    * `initialRate`: tỉ lệ cọc ban đầu
    * `maintenanceRate`: tỉ lệ cọc duy trì
    * `liquidrate`: tỉ lệ cọc xử lý
    * `overnightRate`: tỉ lệ cọc duy trì qua đêm
