Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::algo::rest_api::SpotAlgoApi Class Reference

#include <spot_algo_api.hpp>

Public Member Functions

 SpotAlgoApi (std::shared_ptr< common::RestClient > client)
common::RestApiResponse< CancelAlgoOrderSpotAlgoResponse > cancel_algo_order_spot_algo (const CancelAlgoOrderSpotAlgoParams &params={}) const
 Cancel Spot Algo Order (TRADE).
template<class CompletionToken>
auto async_cancel_algo_order_spot_algo (const CancelAlgoOrderSpotAlgoParams &params, CompletionToken &&token) const
 Asynchronous cancel_algo_order_spot_algo().
common::RestApiResponse< QueryCurrentAlgoOpenOrdersSpotAlgoResponse > query_current_algo_open_orders_spot_algo (const QueryCurrentAlgoOpenOrdersSpotAlgoParams &params={}) const
 Query Current Spot Algo Open Orders (USER_DATA).
template<class CompletionToken>
auto async_query_current_algo_open_orders_spot_algo (const QueryCurrentAlgoOpenOrdersSpotAlgoParams &params, CompletionToken &&token) const
 Asynchronous query_current_algo_open_orders_spot_algo().
common::RestApiResponse< QueryHistoricalAlgoOrdersSpotAlgoResponse > query_historical_algo_orders_spot_algo (const QueryHistoricalAlgoOrdersSpotAlgoParams &params={}) const
 Query Historical Spot Algo Orders (USER_DATA).
template<class CompletionToken>
auto async_query_historical_algo_orders_spot_algo (const QueryHistoricalAlgoOrdersSpotAlgoParams &params, CompletionToken &&token) const
 Asynchronous query_historical_algo_orders_spot_algo().
common::RestApiResponse< QuerySubOrdersSpotAlgoResponse > query_sub_orders_spot_algo (const QuerySubOrdersSpotAlgoParams &params) const
 Query Spot Sub Orders (USER_DATA).
template<class CompletionToken>
auto async_query_sub_orders_spot_algo (const QuerySubOrdersSpotAlgoParams &params, CompletionToken &&token) const
 Asynchronous query_sub_orders_spot_algo().
common::RestApiResponse< TimeWeightedAveragePriceSpotAlgoResponse > time_weighted_average_price_spot_algo (const TimeWeightedAveragePriceSpotAlgoParams &params) const
 Time-Weighted Spot Average Price(Twap) New Order (TRADE).
template<class CompletionToken>
auto async_time_weighted_average_price_spot_algo (const TimeWeightedAveragePriceSpotAlgoParams &params, CompletionToken &&token) const
 Asynchronous time_weighted_average_price_spot_algo().
common::RestApiResponse< VolumeParticipationResponse > volume_participation (const VolumeParticipationParams &params) const
 Volume Participation (VP) New Order (TRADE).
template<class CompletionToken>
auto async_volume_participation (const VolumeParticipationParams &params, CompletionToken &&token) const
 Asynchronous volume_participation().

Constructor & Destructor Documentation

◆ SpotAlgoApi()

binance::algo::rest_api::SpotAlgoApi::SpotAlgoApi ( std::shared_ptr< common::RestClient > client)
explicit

Member Function Documentation

◆ cancel_algo_order_spot_algo()

common::RestApiResponse< CancelAlgoOrderSpotAlgoResponse > binance::algo::rest_api::SpotAlgoApi::cancel_algo_order_spot_algo ( const CancelAlgoOrderSpotAlgoParams & params = {}) const
nodiscard

Cancel Spot Algo Order (TRADE).

DELETE /sapi/v1/algo/spot/order.

Cancel an open TWAP or VP algo order

Weight(IP): 1

Security Type: TRADE

Notes:

  • Either algoId or clientAlgoId must be sent.

See https://developers.binance.com/en/docs/catalog/advanced-trading-algo-trading/api/rest-api/spot-algo#cancel-algo-order-spot-algo

◆ async_cancel_algo_order_spot_algo()

template<class CompletionToken>
auto binance::algo::rest_api::SpotAlgoApi::async_cancel_algo_order_spot_algo ( const CancelAlgoOrderSpotAlgoParams & params,
CompletionToken && token ) const
inline

Asynchronous cancel_algo_order_spot_algo().

Completes with void(std::exception_ptr, common::RestApiResponse<CancelAlgoOrderSpotAlgoResponse>).

◆ query_current_algo_open_orders_spot_algo()

common::RestApiResponse< QueryCurrentAlgoOpenOrdersSpotAlgoResponse > binance::algo::rest_api::SpotAlgoApi::query_current_algo_open_orders_spot_algo ( const QueryCurrentAlgoOpenOrdersSpotAlgoParams & params = {}) const
nodiscard

Query Current Spot Algo Open Orders (USER_DATA).

GET /sapi/v1/algo/spot/openOrders.

Get all open Spot TWAP and VP algo orders

Weight(IP): 1

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/advanced-trading-algo-trading/api/rest-api/spot-algo#query-current-algo-open-orders-spot-algo

◆ async_query_current_algo_open_orders_spot_algo()

template<class CompletionToken>
auto binance::algo::rest_api::SpotAlgoApi::async_query_current_algo_open_orders_spot_algo ( const QueryCurrentAlgoOpenOrdersSpotAlgoParams & params,
CompletionToken && token ) const
inline

◆ query_historical_algo_orders_spot_algo()

common::RestApiResponse< QueryHistoricalAlgoOrdersSpotAlgoResponse > binance::algo::rest_api::SpotAlgoApi::query_historical_algo_orders_spot_algo ( const QueryHistoricalAlgoOrdersSpotAlgoParams & params = {}) const
nodiscard

Query Historical Spot Algo Orders (USER_DATA).

GET /sapi/v1/algo/spot/historicalOrders.

Get all historical Spot TWAP and VP algo orders

Weight(IP): 1

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/advanced-trading-algo-trading/api/rest-api/spot-algo#query-historical-algo-orders-spot-algo

◆ async_query_historical_algo_orders_spot_algo()

template<class CompletionToken>
auto binance::algo::rest_api::SpotAlgoApi::async_query_historical_algo_orders_spot_algo ( const QueryHistoricalAlgoOrdersSpotAlgoParams & params,
CompletionToken && token ) const
inline

◆ query_sub_orders_spot_algo()

common::RestApiResponse< QuerySubOrdersSpotAlgoResponse > binance::algo::rest_api::SpotAlgoApi::query_sub_orders_spot_algo ( const QuerySubOrdersSpotAlgoParams & params) const
nodiscard

Query Spot Sub Orders (USER_DATA).

GET /sapi/v1/algo/spot/subOrders.

Get respective sub orders for a specified algoId

Weight(IP): 1

Security Type: USER_DATA

See https://developers.binance.com/en/docs/catalog/advanced-trading-algo-trading/api/rest-api/spot-algo#query-sub-orders-spot-algo

◆ async_query_sub_orders_spot_algo()

template<class CompletionToken>
auto binance::algo::rest_api::SpotAlgoApi::async_query_sub_orders_spot_algo ( const QuerySubOrdersSpotAlgoParams & params,
CompletionToken && token ) const
inline

Asynchronous query_sub_orders_spot_algo().

Completes with void(std::exception_ptr, common::RestApiResponse<QuerySubOrdersSpotAlgoResponse>).

◆ time_weighted_average_price_spot_algo()

common::RestApiResponse< TimeWeightedAveragePriceSpotAlgoResponse > binance::algo::rest_api::SpotAlgoApi::time_weighted_average_price_spot_algo ( const TimeWeightedAveragePriceSpotAlgoParams & params) const
nodiscard

Time-Weighted Spot Average Price(Twap) New Order (TRADE).

POST /sapi/v1/algo/spot/newOrderTwap.

Place a new spot TWAP order with Algo service.

Weight(UID): 3000

Security Type: TRADE

Notes:

  • Total Algo open orders max allowed: 20 orders.

See https://developers.binance.com/en/docs/catalog/advanced-trading-algo-trading/api/rest-api/spot-algo#time-weighted-average-price-spot-algo

◆ async_time_weighted_average_price_spot_algo()

template<class CompletionToken>
auto binance::algo::rest_api::SpotAlgoApi::async_time_weighted_average_price_spot_algo ( const TimeWeightedAveragePriceSpotAlgoParams & params,
CompletionToken && token ) const
inline

◆ volume_participation()

common::RestApiResponse< VolumeParticipationResponse > binance::algo::rest_api::SpotAlgoApi::volume_participation ( const VolumeParticipationParams & params) const
nodiscard

Volume Participation (VP) New Order (TRADE).

POST /sapi/v1/algo/spot/newOrderVp.

Place a new spot VP (Volume Participation) order with Algo service. A VP order automatically slices the total quantity over time, targeting a percentage of the market volume.

Weight(UID): 3000

Security Type: TRADE

Notes:

  • VP orders do not accept price or timeInForce; pricing is determined algorithmically based on market volume.
  • urgency controls the participation rate: LOW = passive, MEDIUM = neutral, HIGH = aggressive.
  • Receiving "success": true does not guarantee execution; use the query order endpoints (GET /sapi/v1/algo/spot/openOrders or GET /sapi/v1/algo/spot/historicalOrders) to check the final status.
  • You need to enable the Spot Trading permission for the API key requesting this endpoint.
  • Base URL: https://api.binance.com

See https://developers.binance.com/en/docs/catalog/advanced-trading-algo-trading/api/rest-api/spot-algo#volume-participation

◆ async_volume_participation()

template<class CompletionToken>
auto binance::algo::rest_api::SpotAlgoApi::async_volume_participation ( const VolumeParticipationParams & params,
CompletionToken && token ) const
inline

Asynchronous volume_participation().

Completes with void(std::exception_ptr, common::RestApiResponse<VolumeParticipationResponse>).