|
Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
|
DerivativesTradingOptions REST API client. More...
#include <rest_api.hpp>
Static Public Member Functions | |
| static RestApi | from_config (common::RestApiConfig config) |
| A client for config.base_path, production when it is not set. | |
| static RestApi | production (common::RestApiConfig config) |
| A client for production (Derivatives Trading Options REST API). | |
| static RestApi | testnet (common::RestApiConfig config) |
| A client for the testnet. | |
DerivativesTradingOptions REST API client.
Cheap to copy: copies share one common::RestClient (connection pool and executor).
Every endpoint has a blocking form (name(params)) and an asynchronous form (async_name(params, token)) that accepts any Asio completion token.
|
explicit |
Throws common::ConfigError if the configuration is invalid.
|
staticnodiscard |
A client for config.base_path, production when it is not set.
|
staticnodiscard |
A client for production (Derivatives Trading Options REST API).
|
staticnodiscard |
A client for the testnet.
|
nodiscardnoexcept |
|
inlinenodiscard |
Calls an endpoint the SDK does not wrap yet. T may be boost::json::value.
|
inlinenodiscard |
Like send_request, but signed (adds timestamp and signature).
|
inline |
|
inline |
|
inlinenodiscard |
Account Funding Flow (USER_DATA).
GET /eapi/v1/bill.
Query account funding flows.
Weight(IP): 1
Security Type: USER_DATA
Notes:
|
inline |
Asynchronous account_funding_flow().
|
inlinenodiscard |
Option Margin Account Information (USER_DATA).
GET /eapi/v1/marginAccount.
Get current account information.
Weight(IP): 3
Security Type: USER_DATA
|
inline |
Asynchronous option_margin_account_information().
|
inlinenodiscard |
Check Server Time.
GET /eapi/v1/time.
Test connectivity to the Rest API and get the current server time.
Weight(IP): 1
|
inline |
Asynchronous check_server_time().
|
inlinenodiscard |
Exchange Information.
GET /eapi/v1/exchangeInfo.
Current exchange trading rules and symbol information
Weight(IP): 1
|
inline |
Asynchronous exchange_information().
|
inlinenodiscard |
Historical Exercise Records.
GET /eapi/v1/exerciseHistory.
Get historical exercise records.
Weight(IP): 3
|
inline |
Asynchronous historical_exercise_records().
|
inlinenodiscard |
Index Price.
GET /eapi/v1/index.
Get spot index price for option underlying.
Weight(IP): 1
|
inline |
Asynchronous index_price().
|
inlinenodiscard |
Kline/Candlestick Data.
GET /eapi/v1/klines.
Kline/candlestick bars for an option symbol. Klines are uniquely identified by their open time.
Weight(IP): 1
Notes:
|
inline |
Asynchronous kline_candlestick_data().
|
inlinenodiscard |
Open Interest.
GET /eapi/v1/openInterest.
Get open interest for specific underlying asset on specific expiration date.
Weight(IP): 0
|
inline |
Asynchronous open_interest().
|
inlinenodiscard |
Option Mark Price.
GET /eapi/v1/mark.
Option mark price and greek info.
Weight(IP): 5
|
inline |
Asynchronous option_mark_price().
|
inlinenodiscard |
Order Book.
GET /eapi/v1/depth.
Check orderbook depth on specific symbol
| Weight: limit | weight |
|---|---|
| 5, 10, 20, 50 | 1 |
| 100 | 5 |
| 500 | 10 |
| 1000 | 20 |
|
inline |
Asynchronous order_book().
|
inlinenodiscard |
Recent Block Trades List.
GET /eapi/v1/blockTrades.
Get recent block trades
Weight(IP): 5
|
inline |
Asynchronous recent_block_trades_list().
|
inlinenodiscard |
Recent Trades List.
GET /eapi/v1/trades.
Get recent market trades
Weight(IP): 5
|
inline |
Asynchronous recent_trades_list().
|
inlinenodiscard |
Test Connectivity.
GET /eapi/v1/ping.
Test connectivity to the Rest API.
Weight(IP): 1
|
inline |
Asynchronous test_connectivity().
|
inlinenodiscard |
24hr Ticker Price Change Statistics
GET /eapi/v1/ticker.
24 hour rolling window price change statistics.
Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
|
inline |
Asynchronous ticker24hr_price_change_statistics().
|
inlinenodiscard |
Accept Block Trade Order (TRADE).
POST /eapi/v1/block/order/execute.
Accept a block trade order
Weight(IP): 5
Security Type: TRADE
|
inline |
Asynchronous accept_block_trade_order().
|
inlinenodiscard |
Query Block Trade Details (USER_DATA).
GET /eapi/v1/block/order/execute.
Query block trade details; returns block trade details from counterparty's perspective.
Weight(IP): 5
Security Type: USER_DATA
|
inline |
Asynchronous query_block_trade_details().
|
inlinenodiscard |
Account Block Trade List (USER_DATA).
GET /eapi/v1/block/user-trades.
Gets block trades for a specific account.
Weight(IP): 5
Security Type: USER_DATA
|
inline |
Asynchronous account_block_trade_list().
|
inlinenodiscard |
Cancel Block Trade Order (TRADE).
DELETE /eapi/v1/block/order/create.
Cancel a block trade order.
Weight(IP): 5
Security Type: TRADE
|
inline |
Asynchronous cancel_block_trade_order().
|
inlinenodiscard |
Extend Block Trade Order (TRADE).
PUT /eapi/v1/block/order/create.
Extends a block trade expire time by 30 mins from the current time.
Weight(IP): 5
Security Type: TRADE
|
inline |
Asynchronous extend_block_trade_order().
|
inlinenodiscard |
New Block Trade Order (TRADE).
POST /eapi/v1/block/order/create.
Send in a new block trade order.
Weight(IP): 5
Security Type: TRADE
|
inline |
Asynchronous new_block_trade_order().
|
inlinenodiscard |
Query Block Trade Order (TRADE).
GET /eapi/v1/block/order/orders.
Check block trade order status.
Weight(IP): 5
Security Type: TRADE
|
inline |
Asynchronous query_block_trade_order().
|
inlinenodiscard |
Auto-Cancel All Open Orders (Kill-Switch) Heartbeat (TRADE).
POST /eapi/v1/countdownCancelAllHeartBeat.
This endpoint resets the time from which the countdown will begin to the time this messaged is received. It should be called repeatedly as heartbeats. Multiple heartbeats can be updated at once by specifying the underlying symbols as a list (ex. BTCUSDT,ETHUSDT) in the underlyings parameter.
Weight(IP): 10
Security Type: TRADE
Notes:
|
inline |
Asynchronous auto_cancel_all_open_orders().
|
inlinenodiscard |
Get Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE).
GET /eapi/v1/countdownCancelAll.
This endpoint returns the auto-cancel parameters for each underlying symbol. Note only active auto-cancel parameters will be returned, if countdownTime is set to 0 (ie. countdownTime has been turned off), the underlying symbol and corresponding countdownTime parameter will not be returned in the response.
Weight(IP): 1
Security Type: TRADE
Notes:
|
inline |
Asynchronous get_auto_cancel_all_open_orders().
|
inlinenodiscard |
Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE).
POST /eapi/v1/countdownCancelAll.
This endpoint sets the parameters of the auto-cancel feature which cancels all open orders (both market maker protection and non market maker protection order types) of the underlying symbol at the end of the specified countdown time period if no heartbeat message is sent. After the countdown time period, all open orders will be cancelled. The auto-cancel feature can be turned off by setting countdownTime to 0.
Weight(IP): 1
Security Type: TRADE
Notes:
|
inline |
Asynchronous set_auto_cancel_all_open_orders().
|
inlinenodiscard |
Get Market Maker Protection Config (TRADE).
GET /eapi/v1/mmp.
Get config for MMP.
Weight(IP): 1
Security Type: TRADE
|
inline |
Asynchronous get_market_maker_protection_config().
|
inlinenodiscard |
Reset Market Maker Protection Config (TRADE).
POST /eapi/v1/mmpReset.
Reset MMP, start MMP order again.
Weight(IP): 1
Security Type: TRADE
|
inline |
Asynchronous reset_market_maker_protection_config().
|
inlinenodiscard |
Set Market Maker Protection Config (TRADE).
POST /eapi/v1/mmpSet.
Set config for MMP. Market Maker Protection(MMP) is a set of protection mechanism for option market maker, this mechanism is able to prevent mass trading in short period time. Once market maker's account branches the threshold, the Market Maker Protection will be triggered. When Market Maker Protection triggers, all the current MMP orders will be canceled, new MMP orders will be rejected. Market maker can use this time to reevaluate market and modify order price.
Weight(IP): 1
Security Type: TRADE
|
inline |
Asynchronous set_market_maker_protection_config().
|
inlinenodiscard |
Account Trade List (USER_DATA).
GET /eapi/v1/userTrades.
Get trades for a specific account and symbol. Only supports querying trades in the past 3 months; a startTime/endTime outside that window returns -6073 SEARCH_WINDOW_RESTRICTED.
Weight(IP): 5
Security Type: USER_DATA
|
inline |
Asynchronous account_trade_list().
|
inlinenodiscard |
Cancel All Option Orders By Underlying (TRADE).
DELETE /eapi/v1/allOpenOrdersByUnderlying.
Cancel all active orders on specified underlying.
Weight(IP): 5
Security Type: TRADE
|
inline |
Asynchronous cancel_all_option_orders_by_underlying().
|
inlinenodiscard |
Cancel all Option orders on specific symbol (TRADE).
DELETE /eapi/v1/allOpenOrders.
Cancel all active order on a symbol.
Weight(IP): 1
Security Type: TRADE
|
inline |
Asynchronous cancel_all_option_orders_on_specific_symbol().
|
inlinenodiscard |
Cancel Multiple Option Orders (TRADE).
DELETE /eapi/v1/batchOrders.
Cancel multiple orders.
Weight(IP): 5
Security Type: TRADE
Notes:
|
inline |
Asynchronous cancel_multiple_option_orders().
|
inlinenodiscard |
Place Multiple Orders (TRADE).
POST /eapi/v1/batchOrders.
Send multiple option orders.
Weight(IP): 5
Security Type: TRADE
Notes: Some parameters are mandatory depending on the order type as follows:
| Type | Mandatory parameters |
|---|---|
| LIMIT | timeInForce, quantity, price |
|
inline |
Asynchronous place_multiple_orders().
|
inlinenodiscard |
Cancel Option Order (TRADE).
DELETE /eapi/v1/order.
Cancel an active order.
Weight(IP): 1
Security Type: TRADE
Notes:
|
inline |
Asynchronous cancel_option_order().
|
inlinenodiscard |
New Order (TRADE).
POST /eapi/v1/order.
Send a new order.
Weight(IP): 0
Security Type: TRADE
Notes: Some parameters are mandatory depending on the order type as follows:
| Type | Mandatory parameters |
|---|---|
| LIMIT | timeInForce, quantity, price |
|
inline |
Asynchronous new_order().
|
inlinenodiscard |
Query Single Order (TRADE).
GET /eapi/v1/order.
Check an order status.
Weight(IP): 1
Security Type: TRADE
Notes:
|
inline |
Asynchronous query_single_order().
|
inlinenodiscard |
Option Position Information (USER_DATA).
GET /eapi/v1/position.
Get current position information.
Weight(IP): 5
Security Type: USER_DATA
|
inline |
Asynchronous option_position_information().
|
inlinenodiscard |
Query Current Open Option Orders (USER_DATA).
GET /eapi/v1/openOrders.
Query current all open orders, status: ACCEPTED PARTIALLY_FILLED
Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
Security Type: USER_DATA
|
inline |
Asynchronous query_current_open_option_orders().
|
inlinenodiscard |
Query Option Order History (TRADE).
GET /eapi/v1/historyOrders.
Query all finished orders within 5 days, finished status: CANCELLED FILLED REJECTED.
Weight(IP): 3
Security Type: TRADE
|
inline |
Asynchronous query_option_order_history().
|
inlinenodiscard |
TradFi Options Contract (USER_DATA).
POST /eapi/v1/stock/contract.
Sign TradFi Options agreement contract
Weight(IP): 50
Security Type: USER_DATA
|
inline |
Asynchronous tradfi_options_contract().
|
inlinenodiscard |
User Commission (USER_DATA).
GET /eapi/v1/commission.
Get account commission.
Weight(IP): 5
Security Type: USER_DATA
|
inline |
Asynchronous user_commission().
|
inlinenodiscard |
User Exercise Record (USER_DATA).
GET /eapi/v1/exerciseRecord.
Get account exercise records.
Weight(IP): 5
Security Type: USER_DATA
|
inline |
Asynchronous user_exercise_record().
|
inlinenodiscard |
Close User Data Stream (USER_STREAM).
DELETE /eapi/v1/listenKey.
Close out a user data stream.
Weight(IP): 1
Security Type: USER_STREAM
|
inline |
Asynchronous close_user_data_stream().
|
inlinenodiscard |
Keepalive User Data Stream (USER_STREAM).
PUT /eapi/v1/listenKey.
Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.
Weight(IP): 1
Security Type: USER_STREAM
|
inline |
Asynchronous keepalive_user_data_stream().
|
inlinenodiscard |
Start User Data Stream (USER_STREAM).
POST /eapi/v1/listenKey.
Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
Weight(IP): 1
Security Type: USER_STREAM
|
inline |
Asynchronous start_user_data_stream().