derivatives-trading-usds-futures
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBinance Derivatives-trading-usds-futures Skill
Binance Derivatives-trading-usds-futures Skill
Derivatives-trading-usds-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 U本位衍生品交易请求,部分端点需要API key和密钥,返回结果为JSON格式。
Quick Reference
快速参考
| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
| Futures Account Configuration(USER_DATA) | None | recvWindow | Yes |
| Account Information V2(USER_DATA) | None | recvWindow | Yes |
| Account Information V3(USER_DATA) | None | recvWindow | Yes |
| Futures Account Balance V2 (USER_DATA) | None | recvWindow | Yes |
| Futures Account Balance V3 (USER_DATA) | None | recvWindow | Yes |
| Futures Trading Quantitative Rules Indicators (USER_DATA) | None | symbol, recvWindow | Yes |
| Get BNB Burn Status (USER_DATA) | None | recvWindow | Yes |
| Toggle BNB Burn On Futures Trade (TRADE) | feeBurn | recvWindow | Yes |
| Get Current Multi-Assets Mode (USER_DATA) | None | recvWindow | Yes |
| Change Multi-Assets Mode (TRADE) | multiAssetsMargin | 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 and Leverage Brackets (USER_DATA) | None | symbol, recvWindow | Yes |
| Query User Rate Limit (USER_DATA) | None | recvWindow | Yes |
| Symbol Configuration(USER_DATA) | None | symbol, recvWindow | Yes |
| User Commission Rate (USER_DATA) | symbol | recvWindow | Yes |
| Accept the offered quote (USER_DATA) | quoteId | recvWindow | Yes |
| List All Convert Pairs | None | fromAsset, toAsset | No |
| Order status(USER_DATA) | None | orderId, quoteId | Yes |
| Send Quote Request(USER_DATA) | fromAsset, toAsset | fromAmount, toAmount, validTime, recvWindow | Yes |
| 24hr Ticker Price Change Statistics | None | symbol | No |
| ADL Risk | None | symbol | No |
| Basis | pair, contractType, period, limit | startTime, endTime | No |
| Check Server Time | None | None | No |
| Composite Index Symbol Information | None | symbol | No |
| Compressed/Aggregate Trades List | symbol | fromId, startTime, endTime, limit | No |
| Continuous Contract Kline/Candlestick Data | pair, contractType, interval | startTime, endTime, limit | No |
| Quarterly Contract Settlement Price | pair | None | No |
| Exchange Information | None | None | No |
| Get Funding Rate History | None | symbol, startTime, endTime, limit | No |
| Get Funding Rate Info | None | None | No |
| Query Index Price Constituents | symbol | None | No |
| Index Price Kline/Candlestick Data | pair, interval | startTime, endTime, limit | No |
| Query Insurance Fund Balance Snapshot | None | symbol | No |
| Kline/Candlestick Data | symbol, interval | startTime, endTime, limit | No |
| Long/Short Ratio | symbol, period | limit, startTime, endTime | No |
| Mark Price Kline/Candlestick Data | symbol, interval | startTime, endTime, limit | No |
| Mark Price | None | symbol | No |
| Multi-Assets Mode Asset Index | None | symbol | No |
| Old Trades Lookup (MARKET_DATA) | symbol | limit, fromId | No |
| Open Interest Statistics | symbol, period | limit, startTime, endTime | No |
| Open Interest | symbol | None | No |
| RPI Order Book | symbol | limit | 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 | No |
| Symbol Price Ticker V2 | None | symbol | No |
| Symbol Price Ticker | None | symbol | No |
| Taker Buy/Sell Volume | symbol, 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) | symbol, period | limit, startTime, endTime | No |
| Trading Schedule | None | None | No |
| Classic Portfolio Margin Account Information (USER_DATA) | asset | recvWindow | Yes |
| Account Trade List (USER_DATA) | symbol | orderId, startTime, endTime, fromId, limit, recvWindow | Yes |
| All Orders (USER_DATA) | symbol | orderId, startTime, endTime, limit, recvWindow | Yes |
| Auto-Cancel All Open Orders (TRADE) | symbol, countdownTime | recvWindow | Yes |
| Cancel Algo Order (TRADE) | None | algoId, clientAlgoId, recvWindow | Yes |
| New Algo Order(TRADE) | algoType, symbol, side, type | positionSide, timeInForce, quantity, price, triggerPrice, workingType, priceMatch, closePosition, priceProtect, reduceOnly, activatePrice, callbackRate, clientAlgoId, newOrderRespType, selfTradePreventionMode, goodTillDate, recvWindow | Yes |
| Query Algo Order (USER_DATA) | None | algoId, clientAlgoId, recvWindow | Yes |
| Cancel All Algo Open Orders (TRADE) | symbol | 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, quantity, price | orderId, origClientOrderId, priceMatch, recvWindow | Yes |
| New Order(TRADE) | symbol, side, type | positionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, newOrderRespType, priceMatch, selfTradePreventionMode, goodTillDate, 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 Algo Open Orders (USER_DATA) | None | algoType, symbol, algoId, recvWindow | Yes |
| Current All Open Orders (USER_DATA) | None | symbol, 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 |
| Test Order(TRADE) | symbol, side, type | positionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, stopPrice, closePosition, activationPrice, callbackRate, workingType, priceProtect, newOrderRespType, priceMatch, selfTradePreventionMode, goodTillDate, recvWindow | Yes |
| Position ADL Quantile Estimation(USER_DATA) | None | symbol, recvWindow | Yes |
| Position Information V2 (USER_DATA) | None | symbol, recvWindow | Yes |
| Position Information V3 (USER_DATA) | None | symbol, recvWindow | Yes |
| Query All Algo Orders (USER_DATA) | symbol | algoId, startTime, endTime, page, limit, recvWindow | Yes |
| Query Current Open Order (USER_DATA) | symbol | orderId, origClientOrderId, recvWindow | Yes |
| Futures TradFi Perps Contract(USER_DATA) | None | 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 |
| Endpoint | Description | Required | Optional | Authentication |
|---|---|---|---|---|
| 合约账户配置(USER_DATA) | None | recvWindow | 是 |
| 账户信息V2(USER_DATA) | None | recvWindow | 是 |
| 账户信息V3(USER_DATA) | None | recvWindow | 是 |
| 合约账户余额V2 (USER_DATA) | None | recvWindow | 是 |
| 合约账户余额V3 (USER_DATA) | None | recvWindow | 是 |
| 合约交易量化规则指标 (USER_DATA) | None | symbol, recvWindow | 是 |
| 查询BNB手续费抵扣状态 (USER_DATA) | None | recvWindow | 是 |
| 切换合约交易BNB手续费抵扣开关 (TRADE) | feeBurn | recvWindow | 是 |
| 查询当前多资产模式状态 (USER_DATA) | None | recvWindow | 是 |
| 切换多资产模式 (TRADE) | multiAssetsMargin | recvWindow | 是 |
| 查询当前持仓模式(USER_DATA) | None | 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) | None | symbol, incomeType, startTime, endTime, page, limit, recvWindow | 是 |
| 名义价值与杠杆档位 (USER_DATA) | None | symbol, recvWindow | 是 |
| 查询用户下单速率限制 (USER_DATA) | None | recvWindow | 是 |
| 交易对配置(USER_DATA) | None | symbol, recvWindow | 是 |
| 用户手续费率 (USER_DATA) | symbol | recvWindow | 是 |
| 接受报价 (USER_DATA) | quoteId | recvWindow | 是 |
| 列出所有闪兑交易对 | None | fromAsset, toAsset | 否 |
| 订单状态(USER_DATA) | None | orderId, quoteId | 是 |
| 发起报价请求(USER_DATA) | fromAsset, toAsset | fromAmount, toAmount, validTime, recvWindow | 是 |
| 24小时价格变动统计 | None | symbol | 否 |
| ADL风险指标 | None | symbol | 否 |
| 基差 | pair, contractType, period, limit | startTime, endTime | 否 |
| 检查服务器时间 | None | None | 否 |
| 复合指数交易对信息 | None | symbol | 否 |
| 压缩/聚合成交列表 | symbol | fromId, startTime, endTime, limit | 否 |
| 连续合约K线数据 | pair, contractType, interval | startTime, endTime, limit | 否 |
| 季度合约结算价格 | pair | None | 否 |
| 交易所信息 | None | None | 否 |
| 查询资金费率历史 | None | symbol, startTime, endTime, limit | 否 |
| 查询资金费率信息 | None | None | 否 |
| 查询指数价格成分 | symbol | None | 否 |
| 指数价格K线数据 | pair, interval | startTime, endTime, limit | 否 |
| 查询保险基金余额快照 | None | symbol | 否 |
| K线数据 | symbol, interval | startTime, endTime, limit | 否 |
| 多空比 | symbol, period | limit, startTime, endTime | 否 |
| 标记价格K线数据 | symbol, interval | startTime, endTime, limit | 否 |
| 标记价格 | None | symbol | 否 |
| 多资产模式资产指数 | None | symbol | 否 |
| 历史成交查询 (MARKET_DATA) | symbol | limit, fromId | 否 |
| 持仓量统计 | symbol, period | limit, startTime, endTime | 否 |
| 持仓量 | symbol | None | 否 |
| RPI订单簿 | symbol | limit | 否 |
| 订单簿 | symbol | limit | 否 |
| 溢价指数K线数据 | symbol, interval | startTime, endTime, limit | 否 |
| 最新成交列表 | symbol | limit | 否 |
| 交易对订单簿最优报价 | None | symbol | 否 |
| 交易对价格 ticker V2 | None | symbol | 否 |
| 交易对价格 ticker | None | symbol | 否 |
| 吃单买卖成交量 | symbol, period | limit, startTime, endTime | 否 |
| 测试连通性 | None | None | 否 |
| 顶级交易员多空比(账户维度) | symbol, period | limit, startTime, endTime | 否 |
| 顶级交易员多空比(持仓维度) | symbol, period | limit, startTime, endTime | 否 |
| 交易时间表 | None | None | 否 |
| 经典组合保证金账户信息 (USER_DATA) | asset | recvWindow | 是 |
| 账户成交列表 (USER_DATA) | symbol | orderId, startTime, endTime, fromId, limit, recvWindow | 是 |
| 所有订单 (USER_DATA) | symbol | orderId, startTime, endTime, limit, recvWindow | 是 |
| 自动取消所有未成交订单 (TRADE) | symbol, countdownTime | recvWindow | 是 |
| 取消策略订单 (TRADE) | None | algoId, clientAlgoId, recvWindow | 是 |
| 创建策略订单(TRADE) | algoType, symbol, side, type | positionSide, timeInForce, quantity, price, triggerPrice, workingType, priceMatch, closePosition, priceProtect, reduceOnly, activatePrice, callbackRate, clientAlgoId, newOrderRespType, selfTradePreventionMode, goodTillDate, recvWindow | 是 |
| 查询策略订单 (USER_DATA) | None | algoId, clientAlgoId, recvWindow | 是 |
| 取消所有未成交策略订单 (TRADE) | symbol | recvWindow | 是 |
| 取消所有未成交订单 (TRADE) | symbol | recvWindow | 是 |
| 批量撤销订单 (TRADE) | symbol | orderIdList, origClientOrderIdList, recvWindow | 是 |
| 批量修改订单(TRADE) | batchOrders | recvWindow | 是 |
| 批量下单(TRADE) | batchOrders | recvWindow | 是 |
| 撤销订单 (TRADE) | symbol | orderId, origClientOrderId, recvWindow | 是 |
| 修改订单 (TRADE) | symbol, side, quantity, price | orderId, origClientOrderId, priceMatch, recvWindow | 是 |
| 下单(TRADE) | symbol, side, type | positionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, newOrderRespType, priceMatch, selfTradePreventionMode, goodTillDate, recvWindow | 是 |
| 查询订单 (USER_DATA) | symbol | orderId, origClientOrderId, recvWindow | 是 |
| 调整初始杠杆(TRADE) | symbol, leverage | recvWindow | 是 |
| 调整保证金模式(TRADE) | symbol, marginType | recvWindow | 是 |
| 当前所有未成交策略订单 (USER_DATA) | None | algoType, symbol, algoId, recvWindow | 是 |
| 当前所有未成交订单 (USER_DATA) | None | symbol, recvWindow | 是 |
| 查询订单修改历史 (USER_DATA) | symbol | orderId, origClientOrderId, startTime, endTime, limit, recvWindow | 是 |
| 查询持仓保证金调整历史 (TRADE) | symbol | type, startTime, endTime, limit, recvWindow | 是 |
| 调整逐仓持仓保证金(TRADE) | symbol, amount, type | positionSide, recvWindow | 是 |
| 测试下单(TRADE) | symbol, side, type | positionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, stopPrice, closePosition, activationPrice, callbackRate, workingType, priceProtect, newOrderRespType, priceMatch, selfTradePreventionMode, goodTillDate, recvWindow | 是 |
| 持仓ADL分位估算(USER_DATA) | None | symbol, recvWindow | 是 |
| 持仓信息V2 (USER_DATA) | None | symbol, recvWindow | 是 |
| 持仓信息V3 (USER_DATA) | None | symbol, recvWindow | 是 |
| 查询所有策略订单 (USER_DATA) | symbol | algoId, startTime, endTime, page, limit, recvWindow | 是 |
| 查询当前未成交订单 (USER_DATA) | symbol | orderId, origClientOrderId, recvWindow | 是 |
| 合约TradFi永续合约(USER_DATA) | None | recvWindow | 是 |
| 用户强平订单 (USER_DATA) | None | symbol, autoCloseType, startTime, endTime, limit, recvWindow | 是 |
| 关闭用户数据流 (USER_STREAM) | None | None | 否 |
| 延长用户数据流有效期 (USER_STREAM) | None | None | 否 |
| 启动用户数据流 (USER_STREAM) | None | None | 否 |
Parameters
参数
Common Parameters
通用参数
- recvWindow: (e.g., 5000)
- symbol:
- startTime: Timestamp in ms (e.g., 1623319461670)
- endTime: Timestamp in ms (e.g., 1641782889000)
- downloadId: get by download id api (e.g., 1)
- incomeType: TRANSFER, WELCOME_BONUS, REALIZED_PNL, FUNDING_FEE, COMMISSION, INSURANCE_CLEAR, REFERRAL_KICKBACK, COMMISSION_REBATE, API_REBATE, CONTEST_REWARD, CROSS_COLLATERAL_TRANSFER, OPTIONS_PREMIUM_FEE, OPTIONS_SETTLE_PROFIT, INTERNAL_TRANSFER, AUTO_EXCHANGE, DELIVERED_SETTELMENT, COIN_SWAP_DEPOSIT, COIN_SWAP_WITHDRAW, POSITION_LIMIT_INCREASE_FEE, STRATEGY_UMFUTURES_TRANSFER,FEE_RETURN,BFUSD_REWARD
- startTime: (e.g., 1623319461670)
- endTime: (e.g., 1641782889000)
- page:
- limit: Default 100; max 1000 (e.g., 100)
- feeBurn: "true": Fee Discount On; "false": Fee Discount Off
- symbol:
- quoteId: (e.g., 1)
- fromAsset: User spends coin
- toAsset: User receives coin
- orderId: Either orderId or quoteId is required (e.g., 1)
- quoteId: Either orderId or quoteId is required (e.g., 1)
- fromAsset:
- toAsset:
- fromAmount: When specified, it is the amount you will be debited after the conversion (e.g., 1.0)
- toAmount: When specified, it is the amount you will be credited after the conversion (e.g., 1.0)
- validTime: 10s, default 10s (e.g., 10s)
- pair:
- limit: Default 30,Max 500 (e.g., 30)
- fromId: ID to get aggregate trades from INCLUSIVE. (e.g., 1)
- asset:
- orderId: (e.g., 1)
- countdownTime: countdown time, 1000 for 1 second. 0 to cancel the timer
- algoId: (e.g., 1)
- clientAlgoId: (e.g., 1)
- 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
- multiAssetsMargin: "true": Multi-Assets Mode; "false": Single-Asset Mode
- dualSidePosition: "true": Hedge Mode; "false": One-way Mode
- algoType:
- type: 1: Add position margin,2: Reduce position margin
- amount: (e.g., 1.0)
- type:
- batchOrders: order list. Max 5 orders
- quantity: Order quantity, cannot be sent with (e.g., 1.0)
closePosition=true - price: (e.g., 1.0)
- algoType: Only support
CONDITIONAL - quantity: (e.g., 1.0)
- price: (e.g., 1.0)
- triggerPrice: (e.g., 1.0)
- closePosition: ,
true;Close-All,used withfalseorSTOP_MARKET.TAKE_PROFIT_MARKET - priceProtect: "TRUE" or "FALSE", default "FALSE". Used with or
STOP/STOP_MARKETorders.TAKE_PROFIT/TAKE_PROFIT_MARKET - reduceOnly: "true" or "false". default "false". Cannot be sent in Hedge Mode
- activatePrice: 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 5 where 1 for 1% (e.g., 1.0)
TRAILING_STOP_MARKET - goodTillDate: order cancel time for timeInForce , mandatory when
GTDset totimeInforce; order the timestamp only retains second-level precision, ms part will be ignored; The goodTillDate timestamp must be greater than the current time plus 600 seconds and smaller than 253402300799000GTD - 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 - activationPrice: Used with orders, default as the latest price(supporting different
TRAILING_STOP_MARKET) (e.g., 1.0)workingType - batchOrders: order list. Max 5 orders
- recvWindow: (例如5000)
- symbol: 交易对
- startTime: 毫秒级时间戳(例如1623319461670)
- endTime: 毫秒级时间戳(例如1641782889000)
- downloadId: 通过下载ID接口获取(例如1)
- incomeType: TRANSFER, WELCOME_BONUS, REALIZED_PNL, FUNDING_FEE, COMMISSION, INSURANCE_CLEAR, REFERRAL_KICKBACK, COMMISSION_REBATE, API_REBATE, CONTEST_REWARD, CROSS_COLLATERAL_TRANSFER, OPTIONS_PREMIUM_FEE, OPTIONS_SETTLE_PROFIT, INTERNAL_TRANSFER, AUTO_EXCHANGE, DELIVERED_SETTELMENT, COIN_SWAP_DEPOSIT, COIN_SWAP_WITHDRAW, POSITION_LIMIT_INCREASE_FEE, STRATEGY_UMFUTURES_TRANSFER,FEE_RETURN,BFUSD_REWARD
- startTime: (例如1623319461670)
- endTime: (例如1641782889000)
- page: 页码
- limit: 默认100,最大1000(例如100)
- **feeBurn": "true": 开启手续费抵扣; "false": 关闭手续费抵扣
- symbol: 交易对
- quoteId: (例如1)
- fromAsset: 用户支出的币种
- toAsset: 用户获得的币种
- orderId: orderId和quoteId二选一必填(例如1)
- quoteId: orderId和quoteId二选一必填(例如1)
- fromAsset: 支出币种
- toAsset: 获得币种
- fromAmount: 传入时为兑换后将扣除的金额(例如1.0)
- toAmount: 传入时为兑换后将到账的金额(例如1.0)
- validTime: 10s,默认10s(例如10s)
- pair: 交易对
- limit: 默认30,最大500(例如30)
- fromId: 聚合成交查询的起始ID(包含该ID)(例如1)
- asset: 资产
- orderId: (例如1)
- countdownTime: 倒计时,1000对应1秒,0表示取消计时器
- algoId: (例如1)
- clientAlgoId: (例如1)
- orderIdList: 最大长度10,例如 [1234567,2345678]
- origClientOrderIdList: 最大长度10,例如 ["my_id_1","my_id_2"],需要对双引号编码,逗号后无空格
- origClientOrderId: (例如1)
- leverage: 目标初始杠杆:1到125的整数
- **multiAssetsMargin": "true": 多资产模式; "false": 单资产模式
- **dualSidePosition": "true": 双向持仓模式; "false": 单向持仓模式
- algoType: 策略类型
- type: 1: 增加持仓保证金,2: 减少持仓保证金
- amount: (例如1.0)
- type: 类型
- batchOrders: 订单列表,最多5个订单
- quantity: 订单数量,时不可传入(例如1.0)
closePosition=true - price: (例如1.0)
- algoType: 仅支持
CONDITIONAL - quantity: (例如1.0)
- price: (例如1.0)
- triggerPrice: (例如1.0)
- closePosition: ,
true;全平,需配合false或STOP_MARKET使用TAKE_PROFIT_MARKET - **priceProtect": "TRUE" 或 "FALSE", 默认 "FALSE",用于或
STOP/STOP_MARKET订单TAKE_PROFIT/TAKE_PROFIT_MARKET - **reduceOnly": "true" 或 "false",默认 "false",双向持仓模式下不可传入
- activatePrice: 用于订单,默认使用最新价格(支持不同
TRAILING_STOP_MARKET)(例如1.0)workingType - callbackRate: 用于订单,最小值0.1,最大值5,1对应1%(例如1.0)
TRAILING_STOP_MARKET - goodTillDate: 为
timeInForce时的订单取消时间,GTD设为timeInforce时必填;时间戳仅保留秒级精度,毫秒部分会被忽略;goodTillDate时间戳必须大于当前时间加600秒,且小于253402300799000GTD - newClientOrderId: 未成交订单中的唯一ID,未传入时将自动生成,仅支持符合正则的字符串(例如1)
^[\.A-Z\:/a-z0-9_-]{1,36}$ - stopPrice: 用于或
STOP/STOP_MARKET订单(例如1.0)TAKE_PROFIT/TAKE_PROFIT_MARKET - activationPrice: 用于订单,默认使用最新价格(支持不同
TRAILING_STOP_MARKET)(例如1.0)workingType - batchOrders: 订单列表,最多5个订单
Enums
枚举值
- contractType: PERPETUAL | CURRENT_MONTH | NEXT_MONTH | CURRENT_QUARTER | NEXT_QUARTER | 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
- side: BUY | SELL
- priceMatch: NONE | OPPONENT | OPPONENT_5 | OPPONENT_10 | OPPONENT_20 | QUEUE | QUEUE_5 | QUEUE_10 | QUEUE_20
- timeInForce: GTC | IOC | FOK | GTX | GTD | RPI
- workingType: MARK_PRICE | CONTRACT_PRICE
- newOrderRespType: ACK | RESULT
- selfTradePreventionMode: EXPIRE_TAKER | EXPIRE_BOTH | EXPIRE_MAKER
- autoCloseType: LIQUIDATION | ADL
- contractType: PERPETUAL | CURRENT_MONTH | NEXT_MONTH | CURRENT_QUARTER | NEXT_QUARTER | 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
- side: BUY | SELL
- priceMatch: NONE | OPPONENT | OPPONENT_5 | OPPONENT_10 | OPPONENT_20 | QUEUE | QUEUE_5 | QUEUE_10 | QUEUE_20
- timeInForce: GTC | IOC | FOK | GTX | GTD | RPI
- workingType: MARK_PRICE | CONTRACT_PRICE
- newOrderRespType: ACK | RESULT
- selfTradePreventionMode: 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://fapi.binance.com
- Testnet: https://demo-fapi.binance.com
需要身份验证的端点需要提供Binance API凭证。
所需凭证:
- apiKey: 你的Binance API key(放入请求头)
- secretKey: 你的Binance API密钥(用于签名)
基础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 Key和密钥
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 key和密钥文件的存储位置。
切勿将API key和密钥发送到主网和测试网以外的任何网站。
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
密钥: ***...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
- 密钥: your_mainnet_secret
- 测试网: false
testnet-dev
testnet-dev
- API Key: your_testnet_api_key
- Secret: your_testnet_secret
- Testnet: true
- API Key: your_testnet_api_key
- 密钥: your_testnet_secret
- 测试网: 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: 主交易账户
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: 开发/测试用
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: 合约交易账户
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对参数进行百分号编码
- 根据账户配置,使用HMAC SHA256、RSA或Ed25519算法,用secretKey对查询字符串进行签名
- 将签名追加到查询字符串中
- 加入请求头
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
User-Agent请求头
Include header with the following string:
User-Agentbinance-derivatives-trading-usds-futures/1.0.0 (Skill)See for implementation details.
references/authentication.md请求需携带头,值为:
User-Agentbinance-derivatives-trading-usds-futures/1.0.0 (Skill)实现细节请参考。
references/authentication.md