$npx -y skills add Kucoin/kucoin-skills-hub --skill margin-tradingKuCoin Margin trading using the KuCoin API. Cross margin and isolated margin market data, order queries, borrowing/repaying queries, lending queries, and risk limits. Authentication requires API Key, API Secret, and Passphrase.
| 1 | # KuCoin Margin Trading Skill |
| 2 | |
| 3 | Margin trading on KuCoin using authenticated API endpoints. Supports cross margin and isolated margin market data, HF order queries, stop order queries, OCO order queries, borrow/repay history queries, lending queries, and risk limits. Requires API Key, API Secret, and Passphrase for authenticated endpoints. Return the result in JSON format. |
| 4 | |
| 5 | > **Note:** This skill only supports Classic REST API GET endpoints (read-only operations). |
| 6 | |
| 7 | ## Quick Reference |
| 8 | |
| 9 | ### Classic Margin Market Data |
| 10 | |
| 11 | | Endpoint | Description | Required | Optional | Authentication | |
| 12 | |----------|-------------|----------|----------|----------------| |
| 13 | | `/api/v3/margin/symbols` (GET) | Get Symbols - Cross Margin (trading pair config) | None | symbol | No | |
| 14 | | `/api/v1/isolated/symbols` (GET) | Get Symbols - Isolated Margin (trading pair config) | None | None | No | |
| 15 | | `/api/v3/etf/info` (GET) | Get ETF Info (leveraged token info) | None | currency | No | |
| 16 | | `/api/v1/mark-price/{symbol}/current` (GET) | Get Mark Price Detail (current mark price for a margin pair) | symbol (path) | None | No | |
| 17 | | `/api/v1/margin/config` (GET) | Get Margin Config (cross margin config, currency list) | None | None | No | |
| 18 | | `/api/v3/mark-price/all-symbols` (GET) | Get Mark Price List (current mark price for all margin pairs) | None | None | No | |
| 19 | | `/api/v3/margin/collateralRatio` (GET) | Get Margin Collateral Ratio | None | currencyList | No | |
| 20 | | `/api/v3/margin/available-inventory` (GET) | Get Market Available Inventory (platform borrowable amount) | None | currency | No | |
| 21 | |
| 22 | ### Classic Margin HF Order Queries |
| 23 | |
| 24 | | Endpoint | Description | Required | Optional | Authentication | |
| 25 | |----------|-------------|----------|----------|----------------| |
| 26 | | `/api/v3/hf/margin/orders/{orderId}` (GET) | Get Order By OrderId | orderId (path), symbol (query) | None | Yes | |
| 27 | | `/api/v3/hf/margin/orders/client-order/{clientOid}` (GET) | Get Order By ClientOid | clientOid (path), symbol (query) | None | Yes | |
| 28 | | `/api/v3/hf/margin/order/active/symbols` (GET) | Get Symbols With Open Order | tradeType | None | Yes | |
| 29 | | `/api/v3/hf/margin/orders/active` (GET) | Get Open Orders | symbol, tradeType | None | Yes | |
| 30 | | `/api/v3/hf/margin/orders/done` (GET) | Get Closed Orders | symbol, tradeType | side, type, lastId, limit, startAt, endAt | Yes | |
| 31 | | `/api/v3/hf/margin/fills` (GET) | Get Trade History | symbol, tradeType | orderId, side, type, lastId, limit, startAt, endAt | Yes | |
| 32 | |
| 33 | ### Classic Margin Stop Order Queries |
| 34 | |
| 35 | | Endpoint | Description | Required | Optional | Authentication | |
| 36 | |----------|-------------|----------|----------|----------------| |
| 37 | | `/api/v3/hf/margin/stop-orders` (GET) | Get Stop Orders List (paginated, untriggered) | None | symbol, side, type, tradeType, startAt, endAt, currentPage, orderIds, pageSize, stop | Yes | |
| 38 | | `/api/v3/hf/margin/stop-order/orderId` (GET) | Get Stop Order By OrderId | orderId | None | Yes | |
| 39 | | `/api/v3/hf/margin/stop-order/clientOid` (GET) | Get Stop Order By ClientOid | clientOid | None | Yes | |
| 40 | |
| 41 | ### Classic Margin OCO Order Queries |
| 42 | |
| 43 | | Endpoint | Description | Required | Optional | Authentication | |
| 44 | |----------|-------------|----------|----------|----------------| |
| 45 | | `/api/v3/hf/margin/oco-order/orderId` (GET) | Get OCO Order By OrderId | orderId | None | Yes | |
| 46 | | `/api/v3/hf/margin/oco-order/clientOid` (GET) | Get OCO Order By ClientOid | clientOid | None | Yes | |
| 47 | | `/api/v3/hf/margin/oco-order/detail/orderId` (GET) | Get OCO Order Detail By OrderId (includes sub-orders) | orderId | None | Yes | |
| 48 | | `/api/v3/hf/margin/oco-orders` (GET) | Get OCO Order List (paginated) | pageSize, currentPage | symbol, startAt, endAt, orderIds, tradeType | Yes | |
| 49 | |
| 50 | ### Classic Debit Queries (Borrowing and Repaying) |
| 51 | |
| 52 | | Endpoint | Description | Required | Optional | Authentication | |
| 53 | |----------|-------------|----------|----------|----------------| |
| 54 | | `/api/v3/margin/borrowRate` (GET) | Get Borrow Interest Rate | None | vipLevel, currency | Yes | |
| 55 | | `/api/v3/margin/borrow` (GET) | Get Borrow History | currency | isIsolated, symbol, orderNo, startTime, endTime, currentPage, pageSize | Yes | |
| 56 | | `/api/v3/margin/repay` (GET) | Get Repay History | currency | isIsolated, symbol, orderNo, startTime, endTime, currentPage, pageSize | Yes | |
| 57 | | `/api/v3/margin/interest` (GET) | Get Interest History | None | currency, isIsolated, symbol, startTime, endTime, currentPage, pageSize | Yes | |
| 58 | |
| 59 | ### Classic Credit Queries (Lending) |
| 60 | |
| 61 | | Endpoint | Description | Required | Optional | Authentication | |
| 62 | |----------|-------------|----------|----------|----------------| |
| 63 | | `/api/v3/project/list` (GET) | Get Loan Market (currencies available for lending) | None | currency |