Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Before using the SDK, ensure you have:
- [binance-sdk-sub-account](./clients/sub_account/) - Sub Account connector (Pypi package: [`binance-sdk-sub-account`](https://pypi.org/project/binance-sdk-sub-account/))
- [binance-sdk-vip-loan](./clients/vip_loan/) - VIP Loan connector (Pypi package: [`binance-sdk-vip-loan`](https://pypi.org/project/binance-sdk-vip-loan/))
- [binance-sdk-wallet](./clients/wallet/) - Wallet connector (Pypi package: [`binance-sdk-wallet`](https://pypi.org/project/binance-sdk-wallet/))
- [binance-sdk-w3w-prediction](./clients/w3w_prediction/) - W3W Prediction connector (Pypi package: [`binance-sdk-w3w-prediction`](https://pypi.org/project/binance-sdk-wallet/))

## Documentation

Expand Down
48 changes: 48 additions & 0 deletions clients/derivatives_trading_coin_futures/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## 6.0.0 - 2026-06-29

### Changed (13)

#### WebSocket Streams

- Modified response for `all_book_tickers_stream()` (`!bookTicker` stream):
- property `st` added

- Modified response for `contract_info_stream()` (`!contractInfo` stream):
- property `st` added

- Modified response for `all_market_liquidation_order_streams()` (`!forceOrder@arr` stream):
- property `st` added

- Modified response for `all_market_mini_tickers_stream()` (`!miniTicker@arr` stream):
- items: property `st` added
- items: item property `st` added

- Modified response for `all_market_tickers_streams()` (`!ticker@arr` stream):
- items: property `st` added
- items: item property `st` added

- Modified response for `aggregate_trade_streams()` (`<symbol>@aggTrade` stream):
- property `st` added

- Modified response for `individual_symbol_book_ticker_streams()` (`<symbol>@bookTicker` stream):
- property `st` added

- Modified response for `partial_book_depth_streams()` (`<symbol>@depth<levels>@<updateSpeed>` stream):
- property `st` added

- Modified response for `diff_book_depth_streams()` (`<symbol>@depth@<updateSpeed>` stream):
- property `st` added

- Modified response for `mark_price_stream()` (`<symbol>@markPrice@<updateSpeed>` stream):
- property `st` added

- Modified response for `individual_symbol_mini_ticker_stream()` (`<symbol>@miniTicker` stream):
- property `st` added

- Modified response for `individual_symbol_ticker_streams()` (`<symbol>@ticker` stream):
- property `st` added

- Modified response for `mark_price_of_all_symbols_of_a_pair()` (`<pair>@markPrice@<updateSpeed>` stream):
- items: property `st` added
- items: item property `st` added

## 5.7.0 - 2026-06-09

### Changed (2)
Expand Down
2 changes: 1 addition & 1 deletion clients/derivatives_trading_coin_futures/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "binance-sdk-derivatives-trading-coin-futures"
version = "5.7.0"
version = "6.0.0"
description = "Official Binance Derivatives Trading Coin Futures SDK - A lightweight library that provides a convenient interface to Binance's DerivativesTradingCoinFutures REST API, WebSocket API and WebSocket Streams."
authors = ["Binance"]
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ def get_download_id_for_futures_order_history(

Get Download Id For Futures Order History

* Request Limitation is 10 times per month, shared by front end download page and rest api
* Request Limitation is 8 times per month, shared by front end download page and rest api
* This endpoint uses the IP rate limit bucket and costs 1000 weight per call. The maximum is 2 calls per minute; the 3rd call within the same minute will trigger a ban.
* The time between `startTime` and `endTime` can not be longer than 1 year

Weight: 5
Weight: 1000

Args:
start_time (Union[int, None]): Timestamp in ms
Expand Down Expand Up @@ -241,10 +242,11 @@ def get_download_id_for_futures_trade_history(

Get download id for futures trade history

* Request Limitation is 5 times per month, shared by front end download page and rest api
* Request Limitation is 8 times per month, shared by front end download page and rest api
* This endpoint uses the IP rate limit bucket and costs 1000 weight per call. The maximum is 2 calls per minute; the 3rd call within the same minute will trigger a ban.
* The time between `startTime` and `endTime` can not be longer than 1 year

Weight: 5
Weight: 1000

Args:
start_time (Union[int, None]): Timestamp in ms
Expand Down Expand Up @@ -302,10 +304,11 @@ def get_download_id_for_futures_transaction_history(

Get download id for futures transaction history

* Request Limitation is 5 times per month, shared by front end download page and rest api
* Request Limitation is 8 times per month, shared by front end download page and rest api
* This endpoint uses the IP rate limit bucket and costs 1000 weight per call. The maximum is 2 calls per minute; the 3rd call within the same minute will trigger a ban.
* The time between `startTime` and `endTime` can not be longer than 1 year

Weight: 5
Weight: 1000

Args:
start_time (Union[int, None]): Timestamp in ms
Expand Down Expand Up @@ -362,7 +365,7 @@ def get_futures_order_history_download_link_by_id(

Get futures order history download link by Id

* Download link expiration: 24h
* Download link expiration: 7 days

Weight: 5

Expand Down Expand Up @@ -412,7 +415,7 @@ def get_futures_trade_download_link_by_id(

Get futures trade download link by Id

* Download link expiration: 24h
* Download link expiration: 7 days

Weight: 5

Expand Down Expand Up @@ -462,7 +465,7 @@ def get_futures_transaction_history_download_link_by_id(

Get futures transaction history download link by Id

* Download link expiration: 24h
* Download link expiration: 7 days

Weight: 5

Expand Down Expand Up @@ -620,7 +623,7 @@ def notional_bracket_for_symbol(

Get the symbol's notional bracket list.

Weight: 1
Weight: 1 (after CM migration: 1 with symbol / 2 without symbol)

Args:
symbol (Optional[str] = None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def compressed_aggregate_trades_list(

Get compressed, aggregate trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated.

* support querying futures trade histories that are not older than one year
* support querying futures trade histories that are not older than 24 hours
* If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 1 hour.
* If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned.
* Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won't be aggregated.
Expand Down Expand Up @@ -269,7 +269,6 @@ def continuous_contract_kline_candlestick_data(
* CURRENT_QUARTER
* NEXT_QUARTER


1000 | 10
* The difference between `startTime` and `endTime` can only be up to 200 days
* Between `startTime` and `endTime`, the most recent `limit` data from `endTime` will be returned:
Expand Down Expand Up @@ -519,7 +518,6 @@ def index_price_kline_candlestick_data(

Kline/candlestick bars for the index price of a pair. Klines are uniquely identified by their open time.


1000 | 10
* The difference between `startTime` and `endTime` can only be up to 200 days
* Between `startTime` and `endTime`, the most recent `limit` data from `endTime` will be returned:
Expand Down Expand Up @@ -734,7 +732,6 @@ def mark_price_kline_candlestick_data(
Kline/candlestick bars for the mark price of a symbol.
Klines are uniquely identified by their open time.


1000 | 10
* The difference between `startTime` and `endTime` can only be up to 200 days
* Between `startTime` and `endTime`, the most recent `limit` data from `endTime` will be returned:
Expand Down Expand Up @@ -808,6 +805,7 @@ def old_trades_lookup(
Get older market historical trades.

* Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned.
* Only supports data from within the last one month

Weight: 20

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def account_trade_list(
* If startTime and endTime are both not sent, then the last 7 days' data will be returned.
* The time between startTime and endTime cannot be longer than 7 days.

Weight: 20 with symbol,40 with pair
Weight: 20 with symbol,40 with pair (after CM migration: 5 flat)

Args:
symbol (Optional[str] = None):
Expand Down Expand Up @@ -174,7 +174,7 @@ def all_orders(
* If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
* The query time period must be less then 7 days( default as the recent 7 days).

Weight: 20 with symbol, 40 with pair
Weight: 20 with symbol, 40 with pair (after CM migration: 5 flat)

Args:
symbol (Optional[str] = None):
Expand Down Expand Up @@ -399,7 +399,6 @@ def cancel_order(

Cancel an active order.


* Either `orderId` or `origClientOrderId` must be sent.

Weight: 1
Expand Down Expand Up @@ -567,7 +566,11 @@ def change_position_mode(
POST /dapi/v1/positionSide/dual
https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Change-Position-Mode

Change user's position mode (Hedge Mode or One-way Mode ) on ***EVERY symbol***
Change user's position mode (Hedge Mode or One-way Mode ) on ***EVERY symbol***.

**After CM migration**, UM and CM share the **same** `dualSidePosition` setting. Calling this endpoint flips both UM and CM at once. If either side has any open order or open position, the change is rejected:
- `-4067` (open orders exist)
- `-4068` (open position exists)

Weight: 1

Expand Down Expand Up @@ -802,7 +805,7 @@ def modify_isolated_position_margin(
Args:
symbol (Union[str, None]):
amount (Union[float, None]):
type (Union[ModifyIsolatedPositionMarginTypeEnum, None]):
type (Union[ModifyIsolatedPositionMarginTypeEnum, None]): **After CM migration, stop-type values (`STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`, `TRAILING_STOP_MARKET`) are no longer accepted by this endpoint and will return `-4120`. Use the new `/dapi/v1/algoOrder` endpoint instead.**
position_side (Optional[ModifyIsolatedPositionMarginPositionSideEnum] = None): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent with Hedge Mode.
recv_window (Optional[int] = None):

Expand Down Expand Up @@ -921,7 +924,7 @@ def modify_order(
Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue

* Either `orderId` or `origClientOrderId` must be sent, and the `orderId` will prevail if both are sent.
* Either `quantity` or `price` must be sent.
* Either `quantity` or `price` must be sent. *(After CM migration, both `quantity` and `price` are required.)*
* When the new `quantity` or `price` doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.
* However the order will be cancelled by the amendment in the following situations:
* when the order is in partially filled status and the new `quantity` <= `executedQty`
Expand Down Expand Up @@ -1013,7 +1016,6 @@ def new_order(

Send in a new order.


* Order with type `STOP`, parameter `timeInForce` can be sent ( default `GTC`).
* Order with type `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default `GTC`).
* Condition orders will be triggered when:
Expand Down Expand Up @@ -1056,7 +1058,7 @@ def new_order(
Args:
symbol (Union[str, None]):
side (Union[NewOrderSideEnum, None]): `SELL`, `BUY`
type (Union[NewOrderTypeEnum, None]):
type (Union[NewOrderTypeEnum, None]): **After CM migration, stop-type values (`STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`, `TRAILING_STOP_MARKET`) are no longer accepted by this endpoint and will return `-4120`. Use the new `/dapi/v1/algoOrder` endpoint instead.**
position_side (Optional[NewOrderPositionSideEnum] = None): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent with Hedge Mode.
time_in_force (Optional[NewOrderTimeInForceEnum] = None):
quantity (Optional[float] = None): quantity measured by contract number, Cannot be sent with `closePosition`=`true`
Expand All @@ -1068,7 +1070,7 @@ def new_order(
activation_price (Optional[float] = None): Used with `TRAILING_STOP_MARKET` orders, default as the latest price(supporting different `workingType`)
callback_rate (Optional[float] = None): Used with `TRAILING_STOP_MARKET` orders, min 0.1, max 10 where 1 for 1%
working_type (Optional[NewOrderWorkingTypeEnum] = None): stopPrice triggered by: "MARK_PRICE", "CONTRACT_PRICE". Default "CONTRACT_PRICE"
price_protect (Optional[str] = None): "TRUE" or "FALSE", default "FALSE". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders.
price_protect (Optional[str] = None): "true" or "false", default "false". Used with `STOP/STOP_MARKET` or `TAKE_PROFIT/TAKE_PROFIT_MARKET` orders.
new_order_resp_type (Optional[NewOrderNewOrderRespTypeEnum] = None): "ACK", "RESULT", default "ACK"
price_match (Optional[NewOrderPriceMatchEnum] = None): only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price`
self_trade_prevention_mode (Optional[NewOrderSelfTradePreventionModeEnum] = None): `EXPIRE_TAKER`:expire taker order when STP triggers/ `EXPIRE_MAKER`:expire taker order when STP triggers/ `EXPIRE_BOTH`:expire both orders when STP triggers; default `EXPIRE_MAKER`
Expand Down Expand Up @@ -1424,9 +1426,9 @@ def users_force_orders(
User's Force Orders

* If "autoCloseType" is not sent, orders with both of the types will be returned
* If "startTime" is not sent, data within 200 days before "endTime" can be queried
* Only support querying data in the past 90 days

Weight: 20 with symbol, 50 without symbol
Weight: 20 (after CM migration: 20 with symbol / 50 without symbol)

Args:
symbol (Optional[str] = None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@
from .kline_candlestick_data_response import (
KlineCandlestickDataResponse as KlineCandlestickDataResponse,
)
from .kline_candlestick_data_response_item import (
KlineCandlestickDataResponseItem as KlineCandlestickDataResponseItem,
)
from .long_short_ratio_response import LongShortRatioResponse as LongShortRatioResponse
from .long_short_ratio_response_inner import (
LongShortRatioResponseInner as LongShortRatioResponseInner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
import re # noqa: F401
import json

from pydantic import ConfigDict
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict
from binance_sdk_derivatives_trading_coin_futures.rest_api.models.kline_candlestick_data_response_item import (
KlineCandlestickDataResponseItem,
)
from typing import Optional, Set, List
from typing_extensions import Self


class KlineCandlestickDataResponse(KlineCandlestickDataResponseItem):
class KlineCandlestickDataResponse(BaseModel):
"""
KlineCandlestickDataResponse
""" # noqa: E501
Expand Down
Loading