futures-trading
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseKuCoin Futures Trading Skill
KuCoin期货交易Skill
Futures trading on KuCoin using authenticated and public API endpoints. Requires API Key, API Secret, and Passphrase for authenticated endpoints. Return the result in JSON format.
Note: This skill only supports Classic REST API GET endpoints (read-only operations).
通过已认证和公开的API端点在KuCoin上进行期货交易。已认证端点需要提供API Key、API Secret和Passphrase。返回结果为JSON格式。
注意: 本Skill仅支持Classic REST API的GET端点(只读操作)。
Quick Reference
快速参考
Classic Futures -- Market Data
经典期货——市场数据
Base URL:
https://api-futures.kucoin.com| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
| Get Server Time | None | None | No |
| Get Service Status | None | None | No |
| Get Mark Price | symbol (path) | None | No |
| Get Symbol (contract info) | symbol (path) | None | No |
| Get All Symbols (all tradable contracts) | None | None | No |
| Get Ticker | symbol | None | No |
| Get All Tickers | None | None | No |
| Get Full OrderBook | symbol | None | No |
| Get Part OrderBook (20 or 100 levels) | size (path: 20 or 100), symbol | None | No |
| Get Trade History (last 100 trades) | symbol | None | No |
| Get Klines (candlestick data) | symbol, granularity | from, to | No |
| Get Spot Index Price | symbol | startAt, endAt, reverse, offset, forward, maxCount | No |
| Get Interest Rate Index | symbol | startAt, endAt, reverse, offset, forward, maxCount | No |
| Get Premium Index | symbol | startAt, endAt, reverse, offset, forward, maxCount | No |
| Get 24hr Stats (platform futures volume). Must use Classic Futures base URL ( | None | None | Yes |
基础URL:
https://api-futures.kucoin.com| 端点 | 描述 | 必填参数 | 可选参数 | 认证要求 |
|---|---|---|---|---|
| 获取服务器时间 | 无 | 无 | 否 |
| 获取服务状态 | 无 | 无 | 否 |
| 获取标记价格 | symbol(路径参数) | 无 | 否 |
| 获取交易对(合约信息) | symbol(路径参数) | 无 | 否 |
| 获取所有交易对(所有可交易合约) | 无 | 无 | 否 |
| 获取行情ticker | symbol | 无 | 否 |
| 获取所有行情ticker | 无 | 无 | 否 |
| 获取完整订单簿 | symbol | 无 | 否 |
| 获取部分订单簿(20或100档) | size(路径参数:20或100)、symbol | 无 | 否 |
| 获取交易历史(最近100笔交易) | symbol | 无 | 否 |
| 获取K线数据(蜡烛图数据) | symbol、granularity | from、to | 否 |
| 获取现货指数价格 | symbol | startAt、endAt、reverse、offset、forward、maxCount | 否 |
| 获取利率指数 | symbol | startAt、endAt、reverse、offset、forward、maxCount | 否 |
| 获取溢价指数 | symbol | startAt、endAt、reverse、offset、forward、maxCount | 否 |
| 获取24小时统计数据(平台期货交易量)。必须使用经典期货基础URL ( | 无 | 无 | 是 |
Classic Futures -- Order Queries
经典期货——订单查询
Base URL:
https://api-futures.kucoin.com| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
| Get Stop Order List | None | symbol, side, type, startAt, endAt, currentPage, pageSize | Yes |
| Get Order By OrderId | order-id (path) | None | Yes |
| Get Order By ClientOid | clientOid | None | Yes |
| Get Recent Closed Orders (last 24h) | None | symbol | Yes |
| Get Open Order Value | symbol | None | Yes |
| Get Recent Trade History (last 24h fills) | None | symbol | Yes |
基础URL:
https://api-futures.kucoin.com| 端点 | 描述 | 必填参数 | 可选参数 | 认证要求 |
|---|---|---|---|---|
| 获取止损订单列表 | 无 | symbol、side、type、startAt、endAt、currentPage、pageSize | 是 |
| 通过订单ID查询订单 | order-id(路径参数) | 无 | 是 |
| 通过ClientOid查询订单 | clientOid | 无 | 是 |
| 获取最近已平仓订单(过去24小时) | 无 | symbol | 是 |
| 获取未平仓订单价值 | symbol | 无 | 是 |
| 获取最近成交历史(过去24小时成交记录) | 无 | symbol | 是 |
Classic Futures -- Position Queries
经典期货——仓位查询
Base URL:
https://api-futures.kucoin.com| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
| Get Margin Mode | symbol | None | Yes |
| Get Position Mode | None | None | Yes |
| Get Max Open Size | symbol, price, leverage | None | Yes |
| Get Position Details | symbol | None | Yes |
| Get Position List | None | currency | Yes |
| Get Positions History | None | symbol, from, to, limit, pageId | Yes |
| Get Max Withdraw Margin | symbol | positionSide | Yes |
| Get Cross Margin Leverage | symbol | None | Yes |
| Get Cross Margin Risk Limit | symbol | totalMargin, leverage | Yes |
| Get Isolated Margin Risk Limit | symbol (path) | None | No |
基础URL:
https://api-futures.kucoin.com| 端点 | 描述 | 必填参数 | 可选参数 | 认证要求 |
|---|---|---|---|---|
| 获取保证金模式 | symbol | 无 | 是 |
| 获取仓位模式 | 无 | 无 | 是 |
| 获取最大可开仓量 | symbol、price、leverage | 无 | 是 |
| 获取仓位详情 | symbol | 无 | 是 |
| 获取仓位列表 | 无 | currency | 是 |
| 获取历史仓位 | 无 | symbol、from、to、limit、pageId | 是 |
| 获取最大可提取保证金 | symbol | positionSide | 是 |
| 获取逐仓杠杆 | symbol | 无 | 是 |
| 获取逐仓风险限额 | symbol | totalMargin、leverage | 是 |
| 获取隔离保证金风险限额 | symbol(路径参数) | 无 | 否 |
Classic Futures -- Funding Fees
经典期货——资金费用
Base URL:
https://api-futures.kucoin.com| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
| Get Current Funding Rate | symbol (path) | None | No |
| Get Public Funding History | symbol, from, to | None | No |
| Get Private Funding History | symbol | startAt, endAt, reverse, offset, forward, maxCount | Yes |
基础URL:
https://api-futures.kucoin.com| 端点 | 描述 | 必填参数 | 可选参数 | 认证要求 |
|---|---|---|---|---|
| 获取当前资金费率 | symbol(路径参数) | 无 | 否 |
| 获取公开资金费率历史 | symbol、from、to | 无 | 否 |
| 获取个人资金费率历史 | symbol | startAt、endAt、reverse、offset、forward、maxCount | 是 |
Parameters
参数
Common Parameters
通用参数
- symbol: Symbol of the contract (e.g., ,
XBTUSDTM). Path or query parameter depending on endpoint.ETHUSDTM - clientOid: User-defined unique order ID, max 40 characters.
- startAt / from: Begin time in milliseconds.
- endAt / to: End time in milliseconds.
- pageSize: Number of records per page. Default varies by endpoint (typically 50, max 200).
- currentPage: Current page number for paginated queries. Default: 1.
- side: Order side filter: |
buysell - type: Order type filter: |
limitmarket - currency: Currency code filter (e.g., ,
USDT).XBT - reverse: Boolean. Reverse the order of results.
- offset: Start offset for pagination.
- forward: Boolean. for forward lookup (default),
truefor backward.false - maxCount: Displayed size per page. Default 50.
- granularity: Candlestick interval in minutes: ,
1,5,15,30,60,120,240,480,720,144010080 - positionSide: Position side filter: |
BOTH|LONGSHORT - price: Price parameter for max open size query.
- leverage: Leverage parameter for max open size and risk limit queries.
- totalMargin: Total margin for cross margin risk limit query.
- symbol:合约交易对(例如 、
XBTUSDTM)。根据端点不同,作为路径参数或查询参数。ETHUSDTM - clientOid:用户自定义的唯一订单ID,最多40个字符。
- startAt / from:起始时间(毫秒级时间戳)。
- endAt / to:结束时间(毫秒级时间戳)。
- pageSize:每页记录数。默认值因端点而异(通常为50,最大200)。
- currentPage:分页查询的当前页码。默认值:1。
- side:订单方向筛选:|
buysell - type:订单类型筛选:|
limitmarket - currency:货币代码筛选(例如 、
USDT)。XBT - reverse:布尔值。反转结果顺序。
- offset:分页起始偏移量。
- forward:布尔值。表示正向查询(默认),
true表示反向查询。false - maxCount:每页显示的记录数。默认值50。
- granularity:K线时间间隔(分钟):、
1、5、15、30、60、120、240、480、720、144010080 - positionSide:仓位方向筛选:|
BOTH|LONGSHORT - price:最大可开仓量查询的价格参数。
- leverage:最大可开仓量和风险限额查询的杠杆参数。
- totalMargin:逐仓风险限额查询的总保证金参数。
Enums
枚举值
- side: |
buysell - type: |
limitmarket - positionSide: (One-Way mode) |
BOTH(Hedge mode long) |LONG(Hedge mode short)SHORT - marginMode: |
ISOLATEDCROSS - positionMode: (One-Way mode) |
0(Hedge mode)1 - status (order): |
opendone - serverStatus: |
open|closecancelonly - granularity (minutes): |
1|5|15|30|60|120|240|480|720|144010080
- side:(买入) |
buy(卖出)sell - type:(限价) |
limit(市价)market - positionSide:(单向模式) |
BOTH(对冲模式多头) |LONG(对冲模式空头)SHORT - marginMode:(隔离保证金) |
ISOLATED(逐仓保证金)CROSS - positionMode:(单向模式) |
0(对冲模式)1 - status(订单状态):(未成交) |
open(已成交)done - serverStatus:(开放) |
open(关闭) |close(仅允许撤销)cancelonly - granularity(分钟):|
1|5|15|30|60|120|240|480|720|144010080
Authentication
认证
For endpoints that require authentication, you will need to provide KuCoin API credentials.
Required credentials:
- API Key: Your KuCoin API key
- API Secret: Your KuCoin API secret (for signing)
- API Passphrase: Your KuCoin API passphrase (set when creating the API key)
IMPORTANT -- Base URL:
- Classic Futures API: -- Used for all Classic Futures REST endpoints (
https://api-futures.kucoin.com,/api/v1/...,/api/v2/...)/api/v3/...
对于需要认证的端点,您需要提供KuCoin API凭证。
所需凭证:
- API Key:您的KuCoin API密钥
- API Secret:您的KuCoin API密钥(用于签名)
- API Passphrase:您的KuCoin API密码(创建API密钥时设置)
重要提示——基础URL:
- 经典期货API:—— 用于所有经典期货REST端点(
https://api-futures.kucoin.com、/api/v1/...、/api/v2/...)/api/v3/...
Security
安全
Share Credentials
共享凭证
Users can provide KuCoin API credentials by sending a file where the content is in the following format:
api_key_value
api_secret_value
api_passphrase_value用户可通过发送文件提供KuCoin API凭证,文件内容格式如下:
api_key_value
api_secret_value
api_passphrase_valueNever Disclose API Key and Secret
切勿泄露API Key和Secret
Never disclose the location of the API key and secret file.
Never send the API key and secret to any website other than the official KuCoin API base URLs.
切勿泄露API密钥和Secret文件的存储位置。
切勿将API密钥和Secret发送至KuCoin官方API基础URL以外的任何网站。
Never Display Full Secrets
切勿显示完整密钥
When showing credentials to users:
- API Key: Show first 5 + last 4 characters:
abcde...wxyz - API Secret: Always mask, show only last 5:
***...s1k2y - Passphrase: Always fully masked:
***...
Example response when asked for credentials:
Account: main
API Key: abcde...wxyz
Secret: ***...s1k2y
Passphrase: ***...
Environment: Production
向用户展示凭证时:
- API Key:显示前5位+后4位:
abcde...wxyz - API Secret:始终掩码,仅显示最后5位:
***...s1k2y - Passphrase:始终完全掩码:
***...
询问凭证时的示例回复:
账户:main
API Key:abcde...wxyz
Secret:...s1k2y
Passphrase:...
环境:生产环境
Listing Accounts
账户列表
When listing accounts, show names and environment only -- never keys:
KuCoin Accounts:
- main (Production)
- test-account (Production)
列出账户时,仅显示名称和环境——绝不显示密钥:
KuCoin账户:
- main(生产环境)
- test-account(生产环境)
Transactions Confirmation
交易确认
When performing trading operations (placing orders, canceling orders, modifying positions), always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.
执行交易操作(下单、撤单、修改仓位)时,必须先请求用户确认,要求用户输入“CONFIRM”后再继续。
KuCoin Accounts
KuCoin账户
main
main
- API Key: your_api_key
- Secret: your_api_secret
- Passphrase: your_passphrase
- API Key: your_api_key
- Secret: your_api_secret
- Passphrase: your_passphrase