derivatives-trading-portfolio-margin

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Binance Derivatives-trading-portfolio-margin Skill

Binance衍生品交易组合保证金Skill

Derivatives-trading-portfolio-margin 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密钥和密钥,返回结果为JSON格式。

Quick Reference

快速参考

EndpointDescriptionRequiredOptionalAuthentication
/papi/v1/balance
(GET)
Account Balance(USER_DATA)Noneasset, recvWindowYes
/papi/v1/account
(GET)
Account Information(USER_DATA)NonerecvWindowYes
/papi/v1/bnb-transfer
(POST)
BNB transfer (TRADE)amount, transferSiderecvWindowYes
/papi/v1/cm/leverageBracket
(GET)
CM Notional and Leverage Brackets(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/repay-futures-switch
(POST)
Change Auto-repay-futures Status(TRADE)autoRepayrecvWindowYes
/papi/v1/repay-futures-switch
(GET)
Get Auto-repay-futures Status(USER_DATA)NonerecvWindowYes
/papi/v1/cm/leverage
(POST)
Change CM Initial Leverage (TRADE)symbol, leveragerecvWindowYes
/papi/v1/cm/positionSide/dual
(POST)
Change CM Position Mode(TRADE)dualSidePositionrecvWindowYes
/papi/v1/cm/positionSide/dual
(GET)
Get CM Current Position Mode(USER_DATA)NonerecvWindowYes
/papi/v1/um/leverage
(POST)
Change UM Initial Leverage(TRADE)symbol, leveragerecvWindowYes
/papi/v1/um/positionSide/dual
(POST)
Change UM Position Mode(TRADE)dualSidePositionrecvWindowYes
/papi/v1/um/positionSide/dual
(GET)
Get UM Current Position Mode(USER_DATA)NonerecvWindowYes
/papi/v1/auto-collection
(POST)
Fund Auto-collection(TRADE)NonerecvWindowYes
/papi/v1/asset-collection
(POST)
Fund Collection by Asset(TRADE)assetrecvWindowYes
/papi/v1/cm/account
(GET)
Get CM Account Detail(USER_DATA)NonerecvWindowYes
/papi/v1/cm/income
(GET)
Get CM Income History(USER_DATA)Nonesymbol, incomeType, startTime, endTime, page, limit, recvWindowYes
/papi/v1/um/order/asyn
(GET)
Get Download Id For UM Futures Order History (USER_DATA)startTime, endTimerecvWindowYes
/papi/v1/um/trade/asyn
(GET)
Get Download Id For UM Futures Trade History (USER_DATA)startTime, endTimerecvWindowYes
/papi/v1/um/income/asyn
(GET)
Get Download Id For UM Futures Transaction History (USER_DATA)startTime, endTimerecvWindowYes
/papi/v1/margin/marginInterestHistory
(GET)
Get Margin Borrow/Loan Interest History(USER_DATA)Noneasset, startTime, endTime, current, size, archived, recvWindowYes
/papi/v2/um/account
(GET)
Get UM Account Detail V2(USER_DATA)NonerecvWindowYes
/papi/v1/um/account
(GET)
Get UM Account Detail(USER_DATA)NonerecvWindowYes
/papi/v1/um/accountConfig
(GET)
UM Futures Account Configuration(USER_DATA)NonerecvWindowYes
/papi/v1/um/order/asyn/id
(GET)
Get UM Futures Order Download Link by Id(USER_DATA)downloadIdrecvWindowYes
/papi/v1/um/symbolConfig
(GET)
UM Futures Symbol Configuration(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/um/trade/asyn/id
(GET)
Get UM Futures Trade Download Link by Id(USER_DATA)downloadIdrecvWindowYes
/papi/v1/um/income/asyn/id
(GET)
Get UM Futures Transaction Download Link by Id(USER_DATA)downloadIdrecvWindowYes
/papi/v1/um/income
(GET)
Get UM Income History(USER_DATA)Nonesymbol, incomeType, startTime, endTime, page, limit, recvWindowYes
/papi/v1/cm/commissionRate
(GET)
Get User Commission Rate for CM(USER_DATA)symbolrecvWindowYes
/papi/v1/um/commissionRate
(GET)
Get User Commission Rate for UM(USER_DATA)symbolrecvWindowYes
/papi/v1/margin/maxBorrowable
(GET)
Margin Max Borrow(USER_DATA)assetrecvWindowYes
/papi/v1/um/apiTradingStatus
(GET)
Portfolio Margin UM Trading Quantitative Rules Indicators(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/cm/positionRisk
(GET)
Query CM Position Information(USER_DATA)NonemarginAsset, pair, recvWindowYes
/papi/v1/margin/marginLoan
(GET)
Query Margin Loan Record(USER_DATA)assettxId, startTime, endTime, current, size, archived, recvWindowYes
/papi/v1/margin/maxWithdraw
(GET)
Query Margin Max Withdraw(USER_DATA)assetrecvWindowYes
/papi/v1/margin/repayLoan
(GET)
Query Margin repay Record(USER_DATA)assettxId, startTime, endTime, current, size, archived, recvWindowYes
/papi/v1/portfolio/interest-history
(GET)
Query Portfolio Margin Negative Balance Interest History(USER_DATA)Noneasset, startTime, endTime, size, recvWindowYes
/papi/v1/um/positionRisk
(GET)
Query UM Position Information(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/portfolio/negative-balance-exchange-record
(GET)
Query User Negative Balance Auto Exchange Record (USER_DATA)startTime, endTimerecvWindowYes
/papi/v1/rateLimit/order
(GET)
Query User Rate Limit (USER_DATA)NonerecvWindowYes
/papi/v1/repay-futures-negative-balance
(POST)
Repay futures Negative Balance(USER_DATA)NonerecvWindowYes
/papi/v1/um/leverageBracket
(GET)
UM Notional and Leverage Brackets (USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/ping
(GET)
Test ConnectivityNoneNoneNo
/papi/v1/cm/userTrades
(GET)
CM Account Trade List(USER_DATA)Nonesymbol, pair, startTime, endTime, fromId, limit, recvWindowYes
/papi/v1/cm/adlQuantile
(GET)
CM Position ADL Quantile Estimation(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/cm/conditional/allOpenOrders
(DELETE)
Cancel All CM Open Conditional Orders(TRADE)symbolrecvWindowYes
/papi/v1/cm/allOpenOrders
(DELETE)
Cancel All CM Open Orders(TRADE)symbolrecvWindowYes
/papi/v1/um/conditional/allOpenOrders
(DELETE)
Cancel All UM Open Conditional Orders (TRADE)symbolrecvWindowYes
/papi/v1/um/allOpenOrders
(DELETE)
Cancel All UM Open Orders(TRADE)symbolrecvWindowYes
/papi/v1/cm/conditional/order
(DELETE)
Cancel CM Conditional Order(TRADE)symbolstrategyId, newClientStrategyId, recvWindowYes
/papi/v1/cm/conditional/order
(POST)
New CM Conditional Order(TRADE)symbol, side, strategyTypepositionSide, timeInForce, quantity, reduceOnly, price, workingType, priceProtect, newClientStrategyId, stopPrice, activationPrice, callbackRate, recvWindowYes
/papi/v1/cm/order
(DELETE)
Cancel CM Order(TRADE)symbolorderId, origClientOrderId, recvWindowYes
/papi/v1/cm/order
(PUT)
Modify CM Order(TRADE)symbol, side, quantity, priceorderId, origClientOrderId, priceMatch, recvWindowYes
/papi/v1/cm/order
(POST)
New CM Order(TRADE)symbol, side, typepositionSide, timeInForce, quantity, reduceOnly, price, priceMatch, newClientOrderId, newOrderRespType, recvWindowYes
/papi/v1/cm/order
(GET)
Query CM Order(USER_DATA)symbolorderId, origClientOrderId, recvWindowYes
/papi/v1/margin/allOpenOrders
(DELETE)
Cancel Margin Account All Open Orders on a Symbol(TRADE)symbolrecvWindowYes
/papi/v1/margin/orderList
(DELETE)
Cancel Margin Account OCO Orders(TRADE)symbolorderListId, listClientOrderId, newClientOrderId, recvWindowYes
/papi/v1/margin/orderList
(GET)
Query Margin Account's OCO (USER_DATA)NoneorderListId, origClientOrderId, recvWindowYes
/papi/v1/margin/order
(DELETE)
Cancel Margin Account Order(TRADE)symbolorderId, origClientOrderId, newClientOrderId, recvWindowYes
/papi/v1/margin/order
(POST)
New Margin Order(TRADE)symbol, side, typequantity, quoteOrderQty, price, stopPrice, newClientOrderId, newOrderRespType, icebergQty, sideEffectType, timeInForce, selfTradePreventionMode, autoRepayAtCancel, recvWindowYes
/papi/v1/margin/order
(GET)
Query Margin Account Order (USER_DATA)symbolorderId, origClientOrderId, recvWindowYes
/papi/v1/um/conditional/order
(DELETE)
Cancel UM Conditional Order(TRADE)symbolstrategyId, newClientStrategyId, recvWindowYes
/papi/v1/um/conditional/order
(POST)
New UM Conditional Order (TRADE)symbol, side, strategyTypepositionSide, timeInForce, quantity, reduceOnly, price, workingType, priceProtect, newClientStrategyId, stopPrice, activationPrice, callbackRate, priceMatch, selfTradePreventionMode, goodTillDate, recvWindowYes
/papi/v1/um/order
(DELETE)
Cancel UM Order(TRADE)symbolorderId, origClientOrderId, recvWindowYes
/papi/v1/um/order
(PUT)
Modify UM Order(TRADE)symbol, side, quantity, priceorderId, origClientOrderId, priceMatch, recvWindowYes
/papi/v1/um/order
(POST)
New UM Order (TRADE)symbol, side, typepositionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, newOrderRespType, priceMatch, selfTradePreventionMode, goodTillDate, recvWindowYes
/papi/v1/um/order
(GET)
Query UM Order (USER_DATA)symbolorderId, origClientOrderId, recvWindowYes
/papi/v1/um/feeBurn
(GET)
Get UM Futures BNB Burn Status (USER_DATA)NonerecvWindowYes
/papi/v1/um/feeBurn
(POST)
Toggle BNB Burn On UM Futures Trade (TRADE)feeBurnrecvWindowYes
/papi/v1/marginLoan
(POST)
Margin Account Borrow(MARGIN)asset, amountrecvWindowYes
/papi/v1/margin/order/oco
(POST)
Margin Account New OCO(TRADE)symbol, side, quantity, price, stopPricelistClientOrderId, limitClientOrderId, limitIcebergQty, stopClientOrderId, stopLimitPrice, stopIcebergQty, stopLimitTimeInForce, newOrderRespType, sideEffectType, recvWindowYes
/papi/v1/margin/repay-debt
(POST)
Margin Account Repay Debt(TRADE)assetamount, specifyRepayAssets, recvWindowYes
/papi/v1/repayLoan
(POST)
Margin Account Repay(MARGIN)asset, amountrecvWindowYes
/papi/v1/margin/myTrades
(GET)
Margin Account Trade List (USER_DATA)symbolorderId, startTime, endTime, fromId, limit, recvWindowYes
/papi/v1/cm/conditional/allOrders
(GET)
Query All CM Conditional Orders(USER_DATA)Nonesymbol, strategyId, startTime, endTime, limit, recvWindowYes
/papi/v1/cm/allOrders
(GET)
Query All CM Orders (USER_DATA)symbolpair, orderId, startTime, endTime, limit, recvWindowYes
/papi/v1/cm/conditional/openOrders
(GET)
Query All Current CM Open Conditional Orders (USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/cm/openOrders
(GET)
Query All Current CM Open Orders(USER_DATA)Nonesymbol, pair, recvWindowYes
/papi/v1/um/conditional/openOrders
(GET)
Query All Current UM Open Conditional Orders(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/um/openOrders
(GET)
Query All Current UM Open Orders(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/margin/allOrders
(GET)
Query All Margin Account Orders (USER_DATA)symbolorderId, startTime, endTime, limit, recvWindowYes
/papi/v1/um/conditional/allOrders
(GET)
Query All UM Conditional Orders(USER_DATA)Nonesymbol, strategyId, startTime, endTime, limit, recvWindowYes
/papi/v1/um/allOrders
(GET)
Query All UM Orders(USER_DATA)symbolorderId, startTime, endTime, limit, recvWindowYes
/papi/v1/cm/conditional/orderHistory
(GET)
Query CM Conditional Order History(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindowYes
/papi/v1/cm/orderAmendment
(GET)
Query CM Modify Order History(TRADE)symbolorderId, origClientOrderId, startTime, endTime, limit, recvWindowYes
/papi/v1/cm/conditional/openOrder
(GET)
Query Current CM Open Conditional Order(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindowYes
/papi/v1/cm/openOrder
(GET)
Query Current CM Open Order (USER_DATA)symbolorderId, origClientOrderId, recvWindowYes
/papi/v1/margin/openOrders
(GET)
Query Current Margin Open Order (USER_DATA)symbolrecvWindowYes
/papi/v1/um/conditional/openOrder
(GET)
Query Current UM Open Conditional Order(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindowYes
/papi/v1/um/openOrder
(GET)
Query Current UM Open Order(USER_DATA)symbolorderId, origClientOrderId, recvWindowYes
/papi/v1/margin/openOrderList
(GET)
Query Margin Account's Open OCO (USER_DATA)NonerecvWindowYes
/papi/v1/margin/allOrderList
(GET)
Query Margin Account's all OCO (USER_DATA)NonefromId, startTime, endTime, limit, recvWindowYes
/papi/v1/um/conditional/orderHistory
(GET)
Query UM Conditional Order History(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindowYes
/papi/v1/um/orderAmendment
(GET)
Query UM Modify Order History(TRADE)symbolorderId, origClientOrderId, startTime, endTime, limit, recvWindowYes
/papi/v1/cm/forceOrders
(GET)
Query User's CM Force Orders(USER_DATA)Nonesymbol, autoCloseType, startTime, endTime, limit, recvWindowYes
/papi/v1/margin/forceOrders
(GET)
Query User's Margin Force Orders(USER_DATA)NonestartTime, endTime, current, size, recvWindowYes
/papi/v1/um/forceOrders
(GET)
Query User's UM Force Orders (USER_DATA)Nonesymbol, autoCloseType, startTime, endTime, limit, recvWindowYes
/papi/v1/um/userTrades
(GET)
UM Account Trade List(USER_DATA)symbolstartTime, endTime, fromId, limit, recvWindowYes
/papi/v1/um/adlQuantile
(GET)
UM Position ADL Quantile Estimation(USER_DATA)Nonesymbol, recvWindowYes
/papi/v1/listenKey
(DELETE)
Close User Data Stream(USER_STREAM)NoneNoneNo
/papi/v1/listenKey
(PUT)
Keepalive User Data Stream (USER_STREAM)NoneNoneNo
/papi/v1/listenKey
(POST)
Start User Data Stream(USER_STREAM)NoneNoneNo

端点描述必填参数可选参数认证要求
/papi/v1/balance
(GET)
账户余额(USER_DATA)asset, recvWindow
/papi/v1/account
(GET)
账户信息(USER_DATA)recvWindow
/papi/v1/bnb-transfer
(POST)
BNB划转(TRADE)amount, transferSiderecvWindow
/papi/v1/cm/leverageBracket
(GET)
币本位合约名义金额与杠杆档位(USER_DATA)symbol, recvWindow
/papi/v1/repay-futures-switch
(POST)
修改自动偿还期货负余额状态(TRADE)autoRepayrecvWindow
/papi/v1/repay-futures-switch
(GET)
查询自动偿还期货负余额状态(USER_DATA)recvWindow
/papi/v1/cm/leverage
(POST)
修改币本位合约初始杠杆(TRADE)symbol, leveragerecvWindow
/papi/v1/cm/positionSide/dual
(POST)
修改币本位合约持仓模式(TRADE)dualSidePositionrecvWindow
/papi/v1/cm/positionSide/dual
(GET)
查询币本位合约当前持仓模式(USER_DATA)recvWindow
/papi/v1/um/leverage
(POST)
修改U本位合约初始杠杆(TRADE)symbol, leveragerecvWindow
/papi/v1/um/positionSide/dual
(POST)
修改U本位合约持仓模式(TRADE)dualSidePositionrecvWindow
/papi/v1/um/positionSide/dual
(GET)
查询U本位合约当前持仓模式(USER_DATA)recvWindow
/papi/v1/auto-collection
(POST)
资金自动归集(TRADE)recvWindow
/papi/v1/asset-collection
(POST)
按资产归集资金(TRADE)assetrecvWindow
/papi/v1/cm/account
(GET)
查询币本位合约账户详情(USER_DATA)recvWindow
/papi/v1/cm/income
(GET)
查询币本位合约收益历史(USER_DATA)symbol, incomeType, startTime, endTime, page, limit, recvWindow
/papi/v1/um/order/asyn
(GET)
获取U本位合约订单历史下载ID(USER_DATA)startTime, endTimerecvWindow
/papi/v1/um/trade/asyn
(GET)
获取U本位合约交易历史下载ID(USER_DATA)startTime, endTimerecvWindow
/papi/v1/um/income/asyn
(GET)
获取U本位合约交易记录下载ID(USER_DATA)startTime, endTimerecvWindow
/papi/v1/margin/marginInterestHistory
(GET)
查询保证金借贷利息历史(USER_DATA)asset, startTime, endTime, current, size, archived, recvWindow
/papi/v2/um/account
(GET)
查询U本位合约账户详情V2(USER_DATA)recvWindow
/papi/v1/um/account
(GET)
查询U本位合约账户详情(USER_DATA)recvWindow
/papi/v1/um/accountConfig
(GET)
U本位合约账户配置(USER_DATA)recvWindow
/papi/v1/um/order/asyn/id
(GET)
通过ID获取U本位合约订单下载链接(USER_DATA)downloadIdrecvWindow
/papi/v1/um/symbolConfig
(GET)
U本位合约交易对配置(USER_DATA)symbol, recvWindow
/papi/v1/um/trade/asyn/id
(GET)
通过ID获取U本位合约交易历史下载链接(USER_DATA)downloadIdrecvWindow
/papi/v1/um/income/asyn/id
(GET)
通过ID获取U本位合约交易记录下载链接(USER_DATA)downloadIdrecvWindow
/papi/v1/um/income
(GET)
查询U本位合约收益历史(USER_DATA)symbol, incomeType, startTime, endTime, page, limit, recvWindow
/papi/v1/cm/commissionRate
(GET)
查询币本位合约用户手续费率(USER_DATA)symbolrecvWindow
/papi/v1/um/commissionRate
(GET)
查询U本位合约用户手续费率(USER_DATA)symbolrecvWindow
/papi/v1/margin/maxBorrowable
(GET)
保证金最大可借额度(USER_DATA)assetrecvWindow
/papi/v1/um/apiTradingStatus
(GET)
组合保证金U本位交易量化规则指标(USER_DATA)symbol, recvWindow
/papi/v1/cm/positionRisk
(GET)
查询币本位合约持仓信息(USER_DATA)marginAsset, pair, recvWindow
/papi/v1/margin/marginLoan
(GET)
查询保证金借贷记录(USER_DATA)assettxId, startTime, endTime, current, size, archived, recvWindow
/papi/v1/margin/maxWithdraw
(GET)
查询保证金最大可提额度(USER_DATA)assetrecvWindow
/papi/v1/margin/repayLoan
(GET)
查询保证金还款记录(USER_DATA)assettxId, startTime, endTime, current, size, archived, recvWindow
/papi/v1/portfolio/interest-history
(GET)
查询组合保证金负余额利息历史(USER_DATA)asset, startTime, endTime, size, recvWindow
/papi/v1/um/positionRisk
(GET)
查询U本位合约持仓信息(USER_DATA)symbol, recvWindow
/papi/v1/portfolio/negative-balance-exchange-record
(GET)
查询用户负余额自动兑换记录(USER_DATA)startTime, endTimerecvWindow
/papi/v1/rateLimit/order
(GET)
查询用户订单频率限制(USER_DATA)recvWindow
/papi/v1/repay-futures-negative-balance
(POST)
偿还期货负余额(USER_DATA)recvWindow
/papi/v1/um/leverageBracket
(GET)
U本位合约名义金额与杠杆档位(USER_DATA)symbol, recvWindow
/papi/v1/ping
(GET)
测试连通性
/papi/v1/cm/userTrades
(GET)
币本位合约账户交易列表(USER_DATA)symbol, pair, startTime, endTime, fromId, limit, recvWindow
/papi/v1/cm/adlQuantile
(GET)
币本位合约持仓ADL分位估算(USER_DATA)symbol, recvWindow
/papi/v1/cm/conditional/allOpenOrders
(DELETE)
撤销所有币本位合约未成交条件单(TRADE)symbolrecvWindow
/papi/v1/cm/allOpenOrders
(DELETE)
撤销所有币本位合约未成交订单(TRADE)symbolrecvWindow
/papi/v1/um/conditional/allOpenOrders
(DELETE)
撤销所有U本位合约未成交条件单(TRADE)symbolrecvWindow
/papi/v1/um/allOpenOrders
(DELETE)
撤销所有U本位合约未成交订单(TRADE)symbolrecvWindow
/papi/v1/cm/conditional/order
(DELETE)
撤销币本位合约条件单(TRADE)symbolstrategyId, newClientStrategyId, recvWindow
/papi/v1/cm/conditional/order
(POST)
新增币本位合约条件单(TRADE)symbol, side, strategyTypepositionSide, timeInForce, quantity, reduceOnly, price, workingType, priceProtect, newClientStrategyId, stopPrice, activationPrice, callbackRate, recvWindow
/papi/v1/cm/order
(DELETE)
撤销币本位合约订单(TRADE)symbolorderId, origClientOrderId, recvWindow
/papi/v1/cm/order
(PUT)
修改币本位合约订单(TRADE)symbol, side, quantity, priceorderId, origClientOrderId, priceMatch, recvWindow
/papi/v1/cm/order
(POST)
新增币本位合约订单(TRADE)symbol, side, typepositionSide, timeInForce, quantity, reduceOnly, price, priceMatch, newClientOrderId, newOrderRespType, recvWindow
/papi/v1/cm/order
(GET)
查询币本位合约订单(USER_DATA)symbolorderId, origClientOrderId, recvWindow
/papi/v1/margin/allOpenOrders
(DELETE)
撤销保证金账户某交易对所有未成交订单(TRADE)symbolrecvWindow
/papi/v1/margin/orderList
(DELETE)
撤销保证金账户OCO订单(TRADE)symbolorderListId, listClientOrderId, newClientOrderId, recvWindow
/papi/v1/margin/orderList
(GET)
查询保证金账户OCO订单(USER_DATA)orderListId, origClientOrderId, recvWindow
/papi/v1/margin/order
(DELETE)
撤销保证金账户订单(TRADE)symbolorderId, origClientOrderId, newClientOrderId, recvWindow
/papi/v1/margin/order
(POST)
新增保证金账户订单(TRADE)symbol, side, typequantity, quoteOrderQty, price, stopPrice, newClientOrderId, newOrderRespType, icebergQty, sideEffectType, timeInForce, selfTradePreventionMode, autoRepayAtCancel, recvWindow
/papi/v1/margin/order
(GET)
查询保证金账户订单(USER_DATA)symbolorderId, origClientOrderId, recvWindow
/papi/v1/um/conditional/order
(DELETE)
撤销U本位合约条件单(TRADE)symbolstrategyId, newClientStrategyId, recvWindow
/papi/v1/um/conditional/order
(POST)
新增U本位合约条件单(TRADE)symbol, side, strategyTypepositionSide, timeInForce, quantity, reduceOnly, price, workingType, priceProtect, newClientStrategyId, stopPrice, activationPrice, callbackRate, priceMatch, selfTradePreventionMode, goodTillDate, recvWindow
/papi/v1/um/order
(DELETE)
撤销U本位合约订单(TRADE)symbolorderId, origClientOrderId, recvWindow
/papi/v1/um/order
(PUT)
修改U本位合约订单(TRADE)symbol, side, quantity, priceorderId, origClientOrderId, priceMatch, recvWindow
/papi/v1/um/order
(POST)
新增U本位合约订单(TRADE)symbol, side, typepositionSide, timeInForce, quantity, reduceOnly, price, newClientOrderId, newOrderRespType, priceMatch, selfTradePreventionMode, goodTillDate, recvWindow
/papi/v1/um/order
(GET)
查询U本位合约订单(USER_DATA)symbolorderId, origClientOrderId, recvWindow
/papi/v1/um/feeBurn
(GET)
查询U本位合约BNB抵扣状态(USER_DATA)recvWindow
/papi/v1/um/feeBurn
(POST)
切换U本位合约交易BNB抵扣功能(TRADE)feeBurnrecvWindow
/papi/v1/marginLoan
(POST)
保证金账户借贷(MARGIN)asset, amountrecvWindow
/papi/v1/margin/order/oco
(POST)
保证金账户新增OCO订单(TRADE)symbol, side, quantity, price, stopPricelistClientOrderId, limitClientOrderId, limitIcebergQty, stopClientOrderId, stopLimitPrice, stopIcebergQty, stopLimitTimeInForce, newOrderRespType, sideEffectType, recvWindow
/papi/v1/margin/repay-debt
(POST)
保证金账户偿还债务(TRADE)assetamount, specifyRepayAssets, recvWindow
/papi/v1/repayLoan
(POST)
保证金账户还款(MARGIN)asset, amountrecvWindow
/papi/v1/margin/myTrades
(GET)
保证金账户交易列表(USER_DATA)symbolorderId, startTime, endTime, fromId, limit, recvWindow
/papi/v1/cm/conditional/allOrders
(GET)
查询所有币本位合约条件单(USER_DATA)symbol, strategyId, startTime, endTime, limit, recvWindow
/papi/v1/cm/allOrders
(GET)
查询所有币本位合约订单(USER_DATA)symbolpair, orderId, startTime, endTime, limit, recvWindow
/papi/v1/cm/conditional/openOrders
(GET)
查询所有当前币本位合约未成交条件单(USER_DATA)symbol, recvWindow
/papi/v1/cm/openOrders
(GET)
查询所有当前币本位合约未成交订单(USER_DATA)symbol, pair, recvWindow
/papi/v1/um/conditional/openOrders
(GET)
查询所有当前U本位合约未成交条件单(USER_DATA)symbol, recvWindow
/papi/v1/um/openOrders
(GET)
查询所有当前U本位合约未成交订单(USER_DATA)symbol, recvWindow
/papi/v1/margin/allOrders
(GET)
查询所有保证金账户订单(USER_DATA)symbolorderId, startTime, endTime, limit, recvWindow
/papi/v1/um/conditional/allOrders
(GET)
查询所有U本位合约条件单(USER_DATA)symbol, strategyId, startTime, endTime, limit, recvWindow
/papi/v1/um/allOrders
(GET)
查询所有U本位合约订单(USER_DATA)symbolorderId, startTime, endTime, limit, recvWindow
/papi/v1/cm/conditional/orderHistory
(GET)
查询币本位合约条件单历史(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindow
/papi/v1/cm/orderAmendment
(GET)
查询币本位合约订单修改历史(TRADE)symbolorderId, origClientOrderId, startTime, endTime, limit, recvWindow
/papi/v1/cm/conditional/openOrder
(GET)
查询当前币本位合约未成交条件单(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindow
/papi/v1/cm/openOrder
(GET)
查询当前币本位合约未成交订单(USER_DATA)symbolorderId, origClientOrderId, recvWindow
/papi/v1/margin/openOrders
(GET)
查询当前保证金未成交订单(USER_DATA)symbolrecvWindow
/papi/v1/um/conditional/openOrder
(GET)
查询当前U本位合约未成交条件单(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindow
/papi/v1/um/openOrder
(GET)
查询当前U本位合约未成交订单(USER_DATA)symbolorderId, origClientOrderId, recvWindow
/papi/v1/margin/openOrderList
(GET)
查询保证金账户未成交OCO订单(USER_DATA)recvWindow
/papi/v1/margin/allOrderList
(GET)
查询保证金账户所有OCO订单(USER_DATA)fromId, startTime, endTime, limit, recvWindow
/papi/v1/um/conditional/orderHistory
(GET)
查询U本位合约条件单历史(USER_DATA)symbolstrategyId, newClientStrategyId, recvWindow
/papi/v1/um/orderAmendment
(GET)
查询U本位合约订单修改历史(TRADE)symbolorderId, origClientOrderId, startTime, endTime, limit, recvWindow
/papi/v1/cm/forceOrders
(GET)
查询用户币本位合约强平订单(USER_DATA)symbol, autoCloseType, startTime, endTime, limit, recvWindow
/papi/v1/margin/forceOrders
(GET)
查询用户保证金强平订单(USER_DATA)startTime, endTime, current, size, recvWindow
/papi/v1/um/forceOrders
(GET)
查询用户U本位合约强平订单(USER_DATA)symbol, autoCloseType, startTime, endTime, limit, recvWindow
/papi/v1/um/userTrades
(GET)
U本位合约账户交易列表(USER_DATA)symbolstartTime, endTime, fromId, limit, recvWindow
/papi/v1/um/adlQuantile
(GET)
U本位合约持仓ADL分位估算(USER_DATA)symbol, recvWindow
/papi/v1/listenKey
(DELETE)
关闭用户数据流(USER_STREAM)
/papi/v1/listenKey
(PUT)
保持用户数据流活跃(USER_STREAM)
/papi/v1/listenKey
(POST)
启动用户数据流(USER_STREAM)

Parameters

参数

Common Parameters

通用参数

  • asset:
  • recvWindow: (e.g., 5000)
  • amount: (e.g., 1.0)
  • transferSide: "TO_UM","FROM_UM"
  • symbol:
  • autoRepay: Default:
    true
    ;
    false
    for turn off the auto-repay futures negative balance function (e.g., true)
  • symbol:
  • leverage: target initial leverage: int from 1 to 125
  • dualSidePosition: "true": Hedge Mode; "false": One-way Mode
  • asset:
  • 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
  • startTime: Timestamp in ms to get funding from INCLUSIVE. (e.g., 1623319461670)
  • endTime: Timestamp in ms to get funding until INCLUSIVE. (e.g., 1641782889000)
  • page:
  • limit: Default 100; max 1000 (e.g., 100)
  • startTime: (e.g., 1623319461670)
  • endTime: (e.g., 1641782889000)
  • current: Currently querying page. Start from 1. Default:1 (e.g., 1)
  • size: Default:10 Max:100 (e.g., 10)
  • archived: Default:
    false
    . Set to
    true
    for archived data from 6 months ago
  • downloadId: get by download id api (e.g., 1)
  • marginAsset:
  • pair:
  • txId: the
    tranId
    in
    POST/papi/v1/marginLoan
    (e.g., 1)
  • fromId: Trade id to fetch from. Default gets most recent trades. (e.g., 1)
  • strategyId: (e.g., 1)
  • newClientStrategyId: (e.g., 1)
  • orderId: (e.g., 1)
  • origClientOrderId: (e.g., 1)
  • orderListId: Either
    orderListId
    or
    listClientOrderId
    must be provided (e.g., 1)
  • listClientOrderId: Either
    orderListId
    or
    listClientOrderId
    must be provided (e.g., 1)
  • newClientOrderId: Used to uniquely identify this cancel. Automatically generated by default (e.g., 1)
  • quantity: Order quantity (e.g., 1.0)
  • limitClientOrderId: A unique Id for the limit order (e.g., 1)
  • price: (e.g., 1.0)
  • limitIcebergQty: (e.g., 1.0)
  • stopClientOrderId: A unique Id for the stop loss/stop loss limit leg (e.g., 1)
  • stopPrice: (e.g., 1.0)
  • stopLimitPrice: If provided, stopLimitTimeInForce is required. (e.g., 1.0)
  • stopIcebergQty: (e.g., 1.0)
  • amount:
  • specifyRepayAssets: Specific asset list to repay debt; Can be added in batch, separated by commas
  • quantity: (e.g., 1.0)
  • reduceOnly: "true" or "false". default "false". Cannot be sent in Hedge Mode .
  • price: (e.g., 1.0)
  • priceProtect: "TRUE" or "FALSE", default "FALSE". Used with
    STOP/STOP_MARKET
    or
    TAKE_PROFIT/TAKE_PROFIT_MARKET
    orders
  • stopPrice: Used with
    STOP/STOP_MARKET
    or
    TAKE_PROFIT/TAKE_PROFIT_MARKET
    orders. (e.g., 1.0)
  • activationPrice: Used with
    TRAILING_STOP_MARKET
    orders, default as the mark price (e.g., 1.0)
  • callbackRate: Used with
    TRAILING_STOP_MARKET
    orders, min 0.1, max 5 where 1 for 1% (e.g., 1.0)
  • quoteOrderQty: (e.g., 1.0)
  • icebergQty: Used with
    LIMIT
    ,
    STOP_LOSS_LIMIT
    , and
    TAKE_PROFIT_LIMIT
    to create an iceberg order (e.g., 1.0)
  • autoRepayAtCancel: Only when MARGIN_BUY or AUTO_BORROW_REPAY order takes effect, true means that the debt generated by the order needs to be repay after the order is cancelled. The default is true (e.g., true)
  • goodTillDate: order cancel time for timeInForce
    GTD
    , mandatory when
    timeInforce
    set to
    GTD
    ; 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 253402300799000Mode. It must be sent in Hedge Mode.
  • feeBurn: "true": Fee Discount On; "false": Fee Discount Off
  • asset: 资产名称
  • recvWindow: 请求超时时间(例如:5000)
  • amount: 金额(例如:1.0)
  • transferSide: 划转方向,可选值:"TO_UM","FROM_UM"
  • symbol: 交易对
  • autoRepay: 默认值:
    true
    ;设置为
    false
    可关闭自动偿还期货负余额功能(例如:true)
  • leverage: 目标初始杠杆:整数,范围1到125
  • dualSidePosition: "true": 对冲模式;"false": 单向模式
  • 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
  • startTime: 开始时间戳(毫秒),包含该时间点的数据(例如:1623319461670)
  • endTime: 结束时间戳(毫秒),包含该时间点的数据(例如:1641782889000)
  • page: 页码
  • limit: 默认值100;最大值1000(例如:100)
  • current: 当前查询页码,从1开始,默认值:1(例如:1)
  • size: 默认值10;最大值100(例如:10)
  • archived: 默认值:
    false
    。设置为
    true
    可查询6个月前的归档数据
  • downloadId: 通过下载ID接口获取(例如:1)
  • marginAsset: 保证金资产
  • pair: 交易对
  • txId:
    POST/papi/v1/marginLoan
    接口返回的
    tranId
    (例如:1)
  • fromId: 起始交易ID,默认获取最新交易(例如:1)
  • strategyId: 策略ID(例如:1)
  • newClientStrategyId: 新的客户端策略ID(例如:1)
  • orderId: 订单ID(例如:1)
  • origClientOrderId: 原始客户端订单ID(例如:1)
  • orderListId: 订单列表ID,必须提供
    orderListId
    listClientOrderId
    其中一个(例如:1)
  • listClientOrderId: 客户端订单列表ID,必须提供
    orderListId
    listClientOrderId
    其中一个(例如:1)
  • newClientOrderId: 用于唯一标识本次撤销操作,默认自动生成(例如:1)
  • quantity: 订单数量(例如:1.0)
  • limitClientOrderId: 限价订单的唯一ID(例如:1)
  • price: 价格(例如:1.0)
  • limitIcebergQty: 限价冰山订单数量(例如:1.0)
  • stopClientOrderId: 止损/止损限价订单的唯一ID(例如:1)
  • stopPrice: 止损价格(例如:1.0)
  • stopLimitPrice: 若提供该参数,则必须同时提供stopLimitTimeInForce(例如:1.0)
  • stopIcebergQty: 止损冰山订单数量(例如:1.0)
  • specifyRepayAssets: 用于偿还债务的特定资产列表;可批量添加,用逗号分隔
  • reduceOnly: "true"或"false",默认"false"。对冲模式下不可发送该参数
  • priceProtect: "TRUE"或"FALSE",默认"FALSE"。仅适用于
    STOP/STOP_MARKET
    TAKE_PROFIT/TAKE_PROFIT_MARKET
    订单
  • activationPrice: 仅适用于
    TRAILING_STOP_MARKET
    订单,默认标记价格(例如:1.0)
  • callbackRate: 仅适用于
    TRAILING_STOP_MARKET
    订单,最小值0.1,最大值5,1代表1%(例如:1.0)
  • quoteOrderQty: 报价金额(例如:1.0)
  • icebergQty: 仅适用于
    LIMIT
    STOP_LOSS_LIMIT
    TAKE_PROFIT_LIMIT
    订单,用于创建冰山订单(例如:1.0)
  • autoRepayAtCancel: 仅当订单类型为MARGIN_BUY或AUTO_BORROW_REPAY时生效,true表示订单撤销后需偿还该订单产生的债务,默认值为true(例如:true)
  • goodTillDate: 当timeInForce设置为
    GTD
    时为必填参数,代表订单撤销时间;时间戳仅保留秒级精度,毫秒部分将被忽略;goodTillDate时间戳必须大于当前时间加600秒,且小于253402300799000
  • feeBurn: "true": 开启手续费抵扣;"false": 关闭手续费抵扣

Enums

枚举值

  • side: BUY | SELL
  • stopLimitTimeInForce: GTC | IOC | FOK
  • newOrderRespType: ACK | RESULT
  • sideEffectType: NO_SIDE_EFFECT | MARGIN_BUY | AUTO_REPAY
  • priceMatch: NONE | OPPONENT | OPPONENT_5 | OPPONENT_10 | OPPONENT_20 | QUEUE | QUEUE_5 | QUEUE_10 | QUEUE_20
  • positionSide: BOTH | LONG | SHORT
  • strategyType: STOP | STOP_MARKET | LIMIT_MAKER | TAKE_PROFIT | TAKE_PROFIT_MARKET | TRAILING_STOP_MARKET
  • timeInForce: GTC | IOC | FOK | GTX
  • workingType: MARK_PRICE
  • type: LIMIT | MARKET
  • selfTradePreventionMode: NONE | EXPIRE_TAKER | EXPIRE_BOTH | EXPIRE_MAKER
  • autoCloseType: LIQUIDATION | ADL
  • side: BUY | SELL(买入 | 卖出)
  • stopLimitTimeInForce: GTC | IOC | FOK(取消前有效 | 立即成交剩余撤销 | 全部成交否则撤销)
  • newOrderRespType: ACK | RESULT(确认响应 | 结果响应)
  • sideEffectType: NO_SIDE_EFFECT | MARGIN_BUY | AUTO_REPAY(无副作用 | 保证金买入 | 自动还款)
  • priceMatch: NONE | OPPONENT | OPPONENT_5 | OPPONENT_10 | OPPONENT_20 | QUEUE | QUEUE_5 | QUEUE_10 | QUEUE_20(无对手价 | 对手价 | 对手价5档 | 对手价10档 | 对手价20档 | 队列价 | 队列价5档 | 队列价10档 | 队列价20档)
  • positionSide: BOTH | LONG | SHORT(双向持仓 | 多头 | 空头)
  • strategyType: STOP | STOP_MARKET | LIMIT_MAKER | TAKE_PROFIT | TAKE_PROFIT_MARKET | TRAILING_STOP_MARKET(止损限价 | 止损市价 | 限价挂单 | 止盈限价 | 止盈市价 | 跟踪止损市价)
  • timeInForce: GTC | IOC | FOK | GTX(取消前有效 | 立即成交剩余撤销 | 全部成交否则撤销 | 无法成交即撤销)
  • workingType: MARK_PRICE(标记价格)
  • type: LIMIT | MARKET(限价订单 | 市价订单)
  • selfTradePreventionMode: NONE | EXPIRE_TAKER | EXPIRE_BOTH | EXPIRE_MAKER(无自动处理 | 撤销 taker 订单 | 撤销双方订单 | 撤销 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:
对于需要认证的端点,您需要提供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...key

Never 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 密钥: ***...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
undefined
bash
undefined

Binance 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
undefined

Agent Behavior

Agent行为

  1. Credentials requested: Mask secrets (show last 5 chars only)
  2. Listing accounts: Show names and environment, never keys
  3. Account selection: Ask if ambiguous, default to main
  4. When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed
  5. New credentials: Prompt for name, environment, signing mode
  1. 请求凭证时:隐藏密钥(仅显示最后5位)
  2. 展示账户列表时:仅显示名称和环境,切勿显示密钥
  3. 账户选择:若存在歧义则询问用户,默认选择main账户
  4. 在主网执行交易时,必须先向用户确认,要求用户输入"CONFIRM"才能继续
  5. 添加新凭证时:提示用户输入账户名称、环境、签名模式

Adding New Accounts

添加新账户

When user provides new credentials:
  • Ask for account name
  • Ask: Mainnet, Testnet
  • Store in
    TOOLS.md
    with masked display confirmation
当用户提供新凭证时:
  • 询问账户名称
  • 询问:主网还是测试网
  • 将凭证存储在
    TOOLS.md
    中,并向用户展示隐藏后的凭证进行确认

Signing Requests

请求签名

For trading endpoints that require a signature:
  1. Build query string with all parameters, including the timestamp (Unix ms).
  2. Percent-encode the parameters using UTF-8 according to RFC 3986.
  3. Sign query string with secretKey using HMAC SHA256, RSA, or Ed25519 (depending on the account configuration).
  4. Append signature to query string.
  5. Include
    X-MBX-APIKEY
    header.
Otherwise, do not perform steps 3–5.
对于需要签名的交易端点:
  1. 构建包含所有参数的查询字符串,包括时间戳(毫秒级Unix时间)。
  2. 根据RFC 3986标准,使用UTF-8对参数进行百分号编码。
  3. 使用secretKey通过HMAC SHA256、RSA或Ed25519(取决于账户配置)对查询字符串进行签名。
  4. 将签名追加到查询字符串末尾。
  5. 在请求头中包含
    X-MBX-APIKEY
若无需签名,则跳过步骤3-5。

New Client Order ID

新客户端订单ID

For endpoints that include the
newClientOrderId
parameter, the value must always start with
agent-
. If the parameter is not provided,
agent-
followed by 18 random alphanumeric characters will be generated automatically. If a value is provided, it will be prefixed with
agent-
Example:
agent-1a2b3c4d5e6f7g8h9i
对于包含
newClientOrderId
参数的端点,参数值必须以
agent-
开头。若用户未提供该参数,则自动生成
agent-
后接18个随机字母数字字符的ID。若用户提供了该参数,则在其值前添加
agent-
前缀。
示例:
agent-1a2b3c4d5e6f7g8h9i

User Agent Header

User Agent请求头

Include
User-Agent
header with the following string:
binance-derivatives-trading-portfolio-margin/1.0.0 (Skill)
See
references/authentication.md
for implementation details.
请求头中需包含
User-Agent
,值为:
binance-derivatives-trading-portfolio-margin/1.0.0 (Skill)
实现细节请参考
references/authentication.md