derivatives-trading-coin-futures
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBinance Derivatives-trading-coin-futures Skill
Binance 币本位期货衍生品交易Skill
Derivatives-trading-coin-futures request on Binance using authenticated API endpoints. Requires API key and secret key for certain endpoints. Return the result in JSON format.
使用经过身份验证的API端点在Binance上发起币本位期货衍生品交易请求,部分端点需提供API key和secret key,返回结果为JSON格式。
Quick Reference
快速参考
| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
| Account Information (USER_DATA) | None | recvWindow | Yes |
| Futures Account Balance (USER_DATA) | None | recvWindow | Yes |
| Get Current Position Mode(USER_DATA) | None | recvWindow | Yes |
| Change Position Mode(TRADE) | dualSidePosition | recvWindow | Yes |
| Get Download Id For Futures Order History (USER_DATA) | startTime, endTime | recvWindow | Yes |
| Get Download Id For Futures Trade History (USER_DATA) | startTime, endTime | recvWindow | Yes |
| Get Download Id For Futures Transaction History(USER_DATA) | startTime, endTime | recvWindow | Yes |
| Get Futures Order History Download Link by Id (USER_DATA) | downloadId | recvWindow | Yes |
| Get Futures Trade Download Link by Id(USER_DATA) | downloadId | recvWindow | Yes |
| Get Futures Transaction History Download Link by Id (USER_DATA) | downloadId | recvWindow | Yes |
| Get Income History(USER_DATA) | None | symbol, incomeType, startTime, endTime, page, limit, recvWindow | Yes |
| Notional Bracket for Pair(USER_DATA) | None | pair, recvWindow | Yes |
| Notional Bracket for Symbol(USER_DATA) | None | symbol, recvWindow | Yes |
| User Commission Rate (USER_DATA) | symbol | recvWindow | Yes |
| 24hr Ticker Price Change Statistics | None | symbol, pair | No |
| Basis | pair, contractType, period | limit, startTime, endTime | No |
| Check Server time | None | None | No |
| Compressed/Aggregate Trades List | symbol | fromId, startTime, endTime, limit | No |
| Continuous Contract Kline/Candlestick Data | pair, contractType, interval | startTime, endTime, limit | No |
| Exchange Information | None | None | No |
| Get Funding Rate Info | None | None | No |
| Get Funding Rate History of Perpetual Futures | symbol | startTime, endTime, limit | No |
| Query Index Price Constituents | symbol | None | No |
| Index Price Kline/Candlestick Data | pair, interval | startTime, endTime, limit | No |
| Index Price and Mark Price | None | symbol, pair | No |
| Kline/Candlestick Data | symbol, interval | startTime, endTime, limit | No |
| Long/Short Ratio | pair, period | limit, startTime, endTime | No |
| Mark Price Kline/Candlestick Data | symbol, interval | startTime, endTime, limit | No |
| Old Trades Lookup(MARKET_DATA) | symbol | limit, fromId | No |
| Open Interest Statistics | pair, contractType, period | limit, startTime, endTime | No |
| Open Interest | symbol | None | No |
| Order Book | symbol | limit | No |
| Premium index Kline Data | symbol, interval | startTime, endTime, limit | No |
| Recent Trades List | symbol | limit | No |
| Symbol Order Book Ticker | None | symbol, pair | No |
| Symbol Price Ticker | None | symbol, pair | No |
| Taker Buy/Sell Volume | pair, contractType, period | limit, startTime, endTime | No |
| Test Connectivity | None | None | No |
| Top Trader Long/Short Ratio (Accounts) | symbol, period | limit, startTime, endTime | No |
| Top Trader Long/Short Ratio (Positions) | pair, period | limit, startTime, endTime | No |
| Classic Portfolio Margin Account Information (USER_DATA) | asset | recvWindow | Yes |
| Account Trade List (USER_DATA) | None | symbol, pair, orderId, startTime, endTime, fromId, limit, recvWindow | Yes |
| All Orders (USER_DATA) | None | symbol, pair, orderId, startTime, endTime, limit, recvWindow | Yes |
| Auto-Cancel All Open Orders (TRADE) | symbol, countdownTime | recvWindow | Yes |
| Cancel All Open Orders(TRADE) | symbol | recvWindow | Yes |
| Cancel Multiple Orders(TRADE) | symbol | orderIdList, origClientOrderIdList, recvWindow | Yes |
| Modify Multiple Orders(TRADE) | batchOrders | recvWindow | Yes |
| Place Multiple Orders(TRADE) | batchOrders | recvWindow | Yes |
| Cancel Order (TRADE) | symbol | orderId, origClientOrderId, recvWindow | Yes |
| Modify Order (TRADE) | symbol, side | orderId, origClientOrderId, quantity, price, priceMatch, recvWindow | Yes |
| New Order (TRADE) | symbol, side, type | positionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, stopPrice, closePosition, activationPrice, callbackRate, workingType, priceProtect, newOrderRespType, priceMatch, selfTradePreventionMode, recvWindow | Yes |
| Query Order (USER_DATA) | symbol | orderId, origClientOrderId, recvWindow | Yes |
| Change Initial Leverage (TRADE) | symbol, leverage | recvWindow | Yes |
| Change Margin Type (TRADE) | symbol, marginType | recvWindow | Yes |
| Current All Open Orders (USER_DATA) | None | symbol, pair, recvWindow | Yes |
| Get Order Modify History (USER_DATA) | symbol | orderId, origClientOrderId, startTime, endTime, limit, recvWindow | Yes |
| Get Position Margin Change History(TRADE) | symbol | type, startTime, endTime, limit, recvWindow | Yes |
| Modify Isolated Position Margin(TRADE) | symbol, amount, type | positionSide, recvWindow | Yes |
| Position ADL Quantile Estimation(USER_DATA) | None | symbol, recvWindow | Yes |
| Position Information(USER_DATA) | None | marginAsset, pair, recvWindow | Yes |
| Query Current Open Order(USER_DATA) | symbol | orderId, origClientOrderId, recvWindow | Yes |
| User's Force Orders(USER_DATA) | None | symbol, autoCloseType, startTime, endTime, limit, recvWindow | Yes |
| Close User Data Stream(USER_STREAM) | None | None | No |
| Keepalive User Data Stream (USER_STREAM) | None | None | No |
| Start User Data Stream (USER_STREAM) | None | None | No |
| 端点 | 描述 | 必填参数 | 可选参数 | 是否需要身份验证 |
|---|---|---|---|---|
| 账户信息(USER_DATA) | 无 | recvWindow | 是 |
| 期货账户余额(USER_DATA) | 无 | recvWindow | 是 |
| 获取当前持仓模式(USER_DATA) | 无 | recvWindow | 是 |
| 修改持仓模式(TRADE) | dualSidePosition | recvWindow | 是 |
| 获取期货订单历史下载ID(USER_DATA) | startTime, endTime | recvWindow | 是 |
| 获取期货交易历史下载ID(USER_DATA) | startTime, endTime | recvWindow | 是 |
| 获取期货交易流水历史下载ID(USER_DATA) | startTime, endTime | recvWindow | 是 |
| 通过ID获取期货订单历史下载链接(USER_DATA) | downloadId | recvWindow | 是 |
| 通过ID获取期货交易历史下载链接(USER_DATA) | downloadId | recvWindow | 是 |
| 通过ID获取期货交易流水历史下载链接(USER_DATA) | downloadId | recvWindow | 是 |
| 获取收益历史(USER_DATA) | 无 | symbol, incomeType, startTime, endTime, page, limit, recvWindow | 是 |
| 交易对名义金额档位(USER_DATA) | 无 | pair, recvWindow | 是 |
| 交易品种名义金额档位(USER_DATA) | 无 | symbol, recvWindow | 是 |
| 用户手续费率(USER_DATA) | symbol | recvWindow | 是 |
| 24小时价格变动统计 | 无 | symbol, pair | 否 |
| 基差 | pair, contractType, period | limit, startTime, endTime | 否 |
| 检查服务器时间 | 无 | 无 | 否 |
| 压缩/聚合交易列表 | symbol | fromId, startTime, endTime, limit | 否 |
| 连续合约K线/蜡烛图数据 | pair, contractType, interval | startTime, endTime, limit | 否 |
| 交易所信息 | 无 | 无 | 否 |
| 获取资金费率信息 | 无 | 无 | 否 |
| 获取永续期货资金费率历史 | symbol | startTime, endTime, limit | 否 |
| 查询指数价格成分 | symbol | 无 | 否 |
| 指数价格K线/蜡烛图数据 | pair, interval | startTime, endTime, limit | 否 |
| 指数价格与标记价格 | 无 | symbol, pair | 否 |
| K线/蜡烛图数据 | symbol, interval | startTime, endTime, limit | 否 |
| 多空账户比率 | pair, period | limit, startTime, endTime | 否 |
| 标记价格K线/蜡烛图数据 | symbol, interval | startTime, endTime, limit | 否 |
| 历史交易查询(MARKET_DATA) | symbol | limit, fromId | 否 |
| 持仓量统计 | pair, contractType, period | limit, startTime, endTime | 否 |
| 持仓量 | symbol | 无 | 否 |
| 订单簿 | symbol | limit | 否 |
| 溢价指数K线数据 | symbol, interval | startTime, endTime, limit | 否 |
| 近期交易列表 | symbol | limit | 否 |
| 品种订单簿行情 | 无 | symbol, pair | 否 |
| 品种价格行情 | 无 | symbol, pair | 否 |
| Taker买卖量 | pair, contractType, period | limit, startTime, endTime | 否 |
| 测试连通性 | 无 | 无 | 否 |
| 顶级交易者多空账户比率 | symbol, period | limit, startTime, endTime | 否 |
| 顶级交易者多空持仓比率 | pair, period | limit, startTime, endTime | 否 |
| 经典组合保证金账户信息(USER_DATA) | asset | recvWindow | 是 |
| 账户交易列表(USER_DATA) | 无 | symbol, pair, orderId, startTime, endTime, fromId, limit, recvWindow | 是 |
| 所有订单(USER_DATA) | 无 | symbol, pair, orderId, startTime, endTime, limit, recvWindow | 是 |
| 自动取消所有挂单(TRADE) | symbol, countdownTime | recvWindow | 是 |
| 取消所有挂单(TRADE) | symbol | recvWindow | 是 |
| 批量取消订单(TRADE) | symbol | orderIdList, origClientOrderIdList, recvWindow | 是 |
| 批量修改订单(TRADE) | batchOrders | recvWindow | 是 |
| 批量下单(TRADE) | batchOrders | recvWindow | 是 |
| 取消订单(TRADE) | symbol | orderId, origClientOrderId, recvWindow | 是 |
| 修改订单(TRADE) | symbol, side | orderId, origClientOrderId, quantity, price, priceMatch, recvWindow | 是 |
| 下单(TRADE) | symbol, side, type | positionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, stopPrice, closePosition, activationPrice, callbackRate, workingType, priceProtect, newOrderRespType, priceMatch, selfTradePreventionMode, recvWindow | 是 |
| 查询订单(USER_DATA) | symbol | orderId, origClientOrderId, recvWindow | 是 |
| 修改初始杠杆(TRADE) | symbol, leverage | recvWindow | 是 |
| 修改保证金模式(TRADE) | symbol, marginType | recvWindow | 是 |
| 当前所有挂单(USER_DATA) | 无 | symbol, pair, recvWindow | 是 |
| 获取订单修改历史(USER_DATA) | symbol | orderId, origClientOrderId, startTime, endTime, limit, recvWindow | 是 |
| 获取持仓保证金变更历史(TRADE) | symbol | type, startTime, endTime, limit, recvWindow | 是 |
| 修改逐仓持仓保证金(TRADE) | symbol, amount, type | positionSide, recvWindow | 是 |
| 持仓ADL分位数估算(USER_DATA) | 无 | symbol, recvWindow | 是 |
| 持仓信息(USER_DATA) | 无 | marginAsset, pair, recvWindow | 是 |
| 查询当前挂单(USER_DATA) | symbol | orderId, origClientOrderId, recvWindow | 是 |
| 用户强平订单(USER_DATA) | 无 | symbol, autoCloseType, startTime, endTime, limit, recvWindow | 是 |
| 关闭用户数据流(USER_STREAM) | 无 | 无 | 否 |
| 保持用户数据流活跃(USER_STREAM) | 无 | 无 | 否 |
| 启动用户数据流(USER_STREAM) | 无 | 无 | 否 |
Parameters
参数
Common Parameters
通用参数
- recvWindow: (e.g., 5000)
- startTime: Timestamp in ms (e.g., 1623319461670)
- endTime: Timestamp in ms (e.g., 1641782889000)
- downloadId: get by download id api (e.g., 1)
- symbol:
- incomeType: "TRANSFER","WELCOME_BONUS", "FUNDING_FEE", "REALIZED_PNL", "COMMISSION", "INSURANCE_CLEAR", and "DELIVERED_SETTELMENT"
- startTime: (e.g., 1623319461670)
- endTime: (e.g., 1641782889000)
- page:
- limit: Default 100; max 1000 (e.g., 100)
- pair:
- symbol:
- pair: BTCUSD
- fromId: ID to get aggregate trades from INCLUSIVE. (e.g., 1)
- asset:
- orderId: (e.g., 1)
- orderId: (e.g., 1)
- countdownTime: countdown time, 1000 for 1 second. 0 to cancel the timer
- orderIdList: max length 10 e.g. [1234567,2345678]
- origClientOrderIdList: max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma.
- origClientOrderId: (e.g., 1)
- leverage: target initial leverage: int from 1 to 125
- dualSidePosition: "true": Hedge Mode; "false": One-way Mode
- type: 1: Add position margin,2: Reduce position margin
- amount: (e.g., 1.0)
- batchOrders: order list. Max 5 orders
- quantity: quantity measured by contract number, Cannot be sent with =
closePosition(e.g., 1.0)true - price: (e.g., 1.0)
- reduceOnly: "true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with =
closePosition(Close-All)true - newClientOrderId: A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: (e.g., 1)
^[\.A-Z\:/a-z0-9_-]{1,36}$ - stopPrice: Used with or
STOP/STOP_MARKETorders. (e.g., 1.0)TAKE_PROFIT/TAKE_PROFIT_MARKET - closePosition: ,
true;Close-All,used withfalseorSTOP_MARKET.TAKE_PROFIT_MARKET - activationPrice: Used with orders, default as the latest price(supporting different
TRAILING_STOP_MARKET) (e.g., 1.0)workingType - callbackRate: Used with orders, min 0.1, max 10 where 1 for 1% (e.g., 1.0)
TRAILING_STOP_MARKET - priceProtect: "TRUE" or "FALSE", default "FALSE". Used with or
STOP/STOP_MARKETorders.TAKE_PROFIT/TAKE_PROFIT_MARKET - batchOrders: order list. Max 5 orders
- marginAsset:
- recvWindow: (例如:5000)
- startTime: 毫秒级时间戳(例如:1623319461670)
- endTime: 毫秒级时间戳(例如:1641782889000)
- downloadId: 通过下载ID接口获取(例如:1)
- symbol:
- incomeType: 可选值包括"TRANSFER"、"WELCOME_BONUS"、"FUNDING_FEE"、"REALIZED_PNL"、"COMMISSION"、"INSURANCE_CLEAR"和"DELIVERED_SETTELMENT"
- page:
- limit: 默认100,最大值1000(例如:100)
- pair:
- fromId: 获取聚合交易的起始ID(包含该ID,例如:1)
- asset:
- orderId: (例如:1)
- countdownTime: 倒计时时间,1000代表1秒,设为0可取消计时器
- orderIdList: 最大长度10,示例:[1234567,2345678]
- origClientOrderIdList: 最大长度10,示例:["my_id_1","my_id_2"],需转义双引号,逗号后无空格
- origClientOrderId: (例如:1)
- leverage: 目标初始杠杆,取值范围1-125的整数
- dualSidePosition: "true"表示对冲模式,"false"表示单向模式
- type: 1表示增加持仓保证金,2表示减少持仓保证金
- amount: (例如:1.0)
- batchOrders: 订单列表,最多5个订单
- quantity: 合约数量,当=
closePosition时不可传入该参数(例如:1.0)true - price: (例如:1.0)
- reduceOnly: "true"或"false",默认"false",对冲模式下不可传入;当=
closePosition(全平)时不可传入true - newClientOrderId: 挂单中的唯一标识,若未传入则自动生成,格式需符合规则:(例如:1)
^[\.A-Z\:/a-z0-9_-]{1,36}$ - stopPrice: 用于或
STOP/STOP_MARKET订单(例如:1.0)TAKE_PROFIT/TAKE_PROFIT_MARKET - closePosition: 或
true,用于false或STOP_MARKET订单的全平功能TAKE_PROFIT_MARKET - activationPrice: 用于订单,默认值为最新价格(支持不同
TRAILING_STOP_MARKET,例如:1.0)workingType - callbackRate: 用于订单,最小值0.1,最大值10,1代表1%(例如:1.0)
TRAILING_STOP_MARKET - priceProtect: "TRUE"或"FALSE",默认"FALSE",用于或
STOP/STOP_MARKET订单TAKE_PROFIT/TAKE_PROFIT_MARKET - marginAsset:
Enums
枚举值
- contractType: PERPETUAL | CURRENT_QUARTER | NEXT_QUARTER | CURRENT_QUARTER_DELIVERING | NEXT_QUARTER_DELIVERING | PERPETUAL_DELIVERING
- period: 5m | 15m | 30m | 1h | 2h | 4h | 6h | 12h | 1d
- interval: 1m | 3m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 8h | 12h | 1d | 3d | 1w | 1M
- marginType: ISOLATED | CROSSED
- positionSide: BOTH | LONG | SHORT
- type: LIMIT | MARKET | STOP | STOP_MARKET | TAKE_PROFIT | TAKE_PROFIT_MARKET | TRAILING_STOP_MARKET
- side: BUY | SELL
- priceMatch: NONE | OPPONENT | OPPONENT_5 | OPPONENT_10 | OPPONENT_20 | QUEUE | QUEUE_5 | QUEUE_10 | QUEUE_20
- timeInForce: GTC | IOC | FOK | GTX
- workingType: MARK_PRICE | CONTRACT_PRICE
- newOrderRespType: ACK | RESULT
- selfTradePreventionMode: NONE | EXPIRE_TAKER | EXPIRE_BOTH | EXPIRE_MAKER
- autoCloseType: LIQUIDATION | ADL
- contractType: PERPETUAL | CURRENT_QUARTER | NEXT_QUARTER | CURRENT_QUARTER_DELIVERING | NEXT_QUARTER_DELIVERING | PERPETUAL_DELIVERING
- period: 5m | 15m | 30m | 1h | 2h | 4h | 6h | 12h | 1d
- interval: 1m | 3m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 8h | 12h | 1d | 3d | 1w | 1M
- marginType: ISOLATED | CROSSED
- positionSide: BOTH | LONG | SHORT
- type: LIMIT | MARKET | STOP | STOP_MARKET | TAKE_PROFIT | TAKE_PROFIT_MARKET | TRAILING_STOP_MARKET
- side: BUY | SELL
- priceMatch: NONE | OPPONENT | OPPONENT_5 | OPPONENT_10 | OPPONENT_20 | QUEUE | QUEUE_5 | QUEUE_10 | QUEUE_20
- timeInForce: GTC | IOC | FOK | GTX
- workingType: MARK_PRICE | CONTRACT_PRICE
- newOrderRespType: ACK | RESULT
- selfTradePreventionMode: NONE | EXPIRE_TAKER | EXPIRE_BOTH | EXPIRE_MAKER
- autoCloseType: LIQUIDATION | ADL
Authentication
身份验证
For endpoints that require authentication, you will need to provide Binance API credentials.
Required credentials:
- apiKey: Your Binance API key (for header)
- secretKey: Your Binance API secret (for signing)
Base URLs:
- Mainnet: https://dapi.binance.com
- Testnet: https://testnet.binancefuture.com
对于需要身份验证的端点,你需要提供Binance API凭证。
所需凭证:
- apiKey: 你的Binance API密钥(用于请求头)
- secretKey: 你的Binance密钥(用于签名)
基础URL:
Security
安全规范
Share Credentials
凭证共享
Users can provide Binance API credentials by sending a file where the content is in the following format:
bash
abc123...xyz
secret123...key用户可通过文件提供Binance API凭证,文件内容格式如下:
bash
abc123...xyz
secret123...keyNever Disclose API Key and Secret
切勿泄露API密钥
Never disclose the location of the API key and secret file.
Never send the API key and secret to any website other than Mainnet and Testnet.
切勿泄露API密钥和密钥文件的存储位置。
切勿向主网和测试网以外的任何网站发送API密钥和密钥。
Never Display Full Secrets
切勿显示完整密钥
When showing credentials to users:
- API Key: Show first 5 + last 4 characters:
su1Qc...8akf - Secret Key: Always mask, show only last 5:
***...aws1
Example response when asked for credentials:
Account: main
API Key: su1Qc...8akf
Secret: ***...aws1
Environment: Mainnet
向用户展示凭证时:
- API Key: 仅显示前5位和后4位字符,例如:
su1Qc...8akf - Secret Key: 始终隐藏,仅显示最后5位字符,例如:
***...aws1
询问凭证时的示例回复:
账户:main
API Key: su1Qc...8akf
Secret: ***...aws1
环境:主网
Listing Accounts
账户列表展示
When listing accounts, show names and environment only — never keys:
Binance Accounts:
- main (Mainnet/Testnet)
- testnet-dev (Testnet)
- futures-keys (Mainnet)
展示账户列表时,仅显示账户名称和环境,绝不显示密钥:
Binance账户列表:
- main(主网/测试网)
- testnet-dev(测试网)
- futures-keys(主网)
Transactions in Mainnet
主网交易
When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.
在主网执行交易时,必须先请用户输入"CONFIRM"进行确认,再继续操作。
Binance Accounts
Binance账户示例
main
main
- API Key: your_mainnet_api_key
- Secret: your_mainnet_secret
- Testnet: false
- API Key: your_mainnet_api_key
- Secret: your_mainnet_secret
- Testnet: false
testnet-dev
testnet-dev
- API Key: your_testnet_api_key
- Secret: your_testnet_secret
- Testnet: true
- API Key: your_testnet_api_key
- Secret: your_testnet_secret
- Testnet: true
TOOLS.md Structure
TOOLS.md文件结构
bash
undefinedbash
undefinedBinance Accounts
Binance Accounts
main
main
- API Key: abc123...xyz
- Secret: secret123...key
- Testnet: false
- Description: Primary trading account
- API Key: abc123...xyz
- Secret: secret123...key
- Testnet: false
- Description: Primary trading account
testnet-dev
testnet-dev
- API Key: test456...abc
- Secret: testsecret...xyz
- Testnet: true
- Description: Development/testing
- API Key: test456...abc
- Secret: testsecret...xyz
- Testnet: true
- Description: Development/testing
futures-keys
futures-keys
- API Key: futures789...def
- Secret: futuressecret...uvw
- Testnet: false
- Description: Futures trading account
undefined- API Key: futures789...def
- Secret: futuressecret...uvw
- Testnet: false
- Description: Futures trading account
undefinedAgent Behavior
Agent行为规范
- Credentials requested: Mask secrets (show last 5 chars only)
- Listing accounts: Show names and environment, never keys
- Account selection: Ask if ambiguous, default to main
- When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed
- New credentials: Prompt for name, environment, signing mode
- 请求凭证时:隐藏密钥(仅显示最后5位字符)
- 展示账户列表时:仅显示名称和环境,绝不显示密钥
- 账户选择:若存在歧义则询问用户,默认选择main账户
- 在主网执行交易时:必须先请用户输入"CONFIRM"确认后再继续
- 添加新凭证时:提示用户输入账户名称、环境和签名模式
Adding New Accounts
添加新账户
When user provides new credentials:
- Ask for account name
- Ask: Mainnet, Testnet
- Store in with masked display confirmation
TOOLS.md
当用户提供新凭证时:
- 询问账户名称
- 询问:主网还是测试网
- 将凭证存储到中,并向用户展示隐藏后的凭证以确认
TOOLS.md
Signing Requests
请求签名
For trading endpoints that require a signature:
- Build query string with all parameters, including the timestamp (Unix ms).
- Percent-encode the parameters using UTF-8 according to RFC 3986.
- Sign query string with secretKey using HMAC SHA256, RSA, or Ed25519 (depending on the account configuration).
- Append signature to query string.
- Include header.
X-MBX-APIKEY
Otherwise, do not perform steps 3–5.
对于需要签名的交易端点:
- 构建包含所有参数的查询字符串,包括时间戳(毫秒级Unix时间)
- 根据RFC 3986标准,使用UTF-8对参数进行百分号编码
- 使用secretKey通过HMAC SHA256、RSA或Ed25519算法对查询字符串签名(取决于账户配置)
- 将签名追加到查询字符串中
- 在请求头中包含
X-MBX-APIKEY
若无需签名,则跳过步骤3-5。
New Client Order ID
新客户端订单ID规则
For endpoints that include the parameter, the value must always start with . If the parameter is not provided, followed by 18 random alphanumeric characters will be generated automatically. If a value is provided, it will be prefixed with
newClientOrderIdagent-agent-agent-Example:
agent-1a2b3c4d5e6f7g8h9i对于包含参数的端点,参数值必须以开头。若用户未提供该参数,则自动生成后接18位随机字母数字字符的ID;若用户提供了值,则在其值前添加前缀。
newClientOrderIdagent-agent-agent-示例:
agent-1a2b3c4d5e6f7g8h9iUser Agent Header
用户代理请求头
Include header with the following string:
User-Agentbinance-derivatives-trading-coin-futures/1.0.0 (Skill)See for implementation details.
references/authentication.md请求头中需包含,值为:
User-Agentbinance-derivatives-trading-coin-futures/1.0.0 (Skill)实现细节请参考
references/authentication.md