Skip to content

Commit

Permalink
Merge pull request #331 from crypto-chassis/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
cryptochassis authored Dec 2, 2022
2 parents 0ead317 + 073ba9c commit 79b2080
Show file tree
Hide file tree
Showing 52 changed files with 2,774 additions and 794 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
* Code closely follows Bloomberg's API: https://www.bloomberg.com/professional/support/api-library/.
* It is ultra fast thanks to very careful optimizations: move semantics, regex optimization, locality of reference, lock contention minimization, etc.
* Supported exchanges:
* Market data: coinbase, gemini, kraken, kraken-futures, bitstamp, bitfinex, bitmex, binance-us, binance, binance-usds-futures, binance-coin-futures, huobi, huobi-usdt-swap, huobi-coin-swap, okx, erisx, kucoin, kucoin-futures, ftx, ftx-us, deribit, gateio, gateio-perpetual-futures, cryptocom, bybit, ascendex.
* Execution Management: coinbase, gemini, kraken, kraken-futures, bitstamp, bitfinex, bitmex, binance-us, binance, binance-margin, binance-usds-futures, binance-coin-futures, huobi, huobi-usdt-swap, huobi-coin-swap, okx, erisx, kucoin, ftx, ftx-us, deribit, gateio, gateio-perpetual-futures, cryptocom, bybit, ascendex.
* Market data: coinbase, gemini, kraken, kraken-futures, bitstamp, bitfinex, bitmex, binance-us, binance, binance-usds-futures, binance-coin-futures, huobi, huobi-usdt-swap, huobi-coin-swap, okx, erisx, kucoin, kucoin-futures, ftx, ftx-us, deribit, gateio, gateio-perpetual-futures, cryptocom, bybit, bybit-derivatives, ascendex, bitget, bitget-futures, bitmart.
* Execution Management: coinbase, gemini, kraken, kraken-futures, bitstamp, bitfinex, bitmex, binance-us, binance, binance-margin, binance-usds-futures, binance-coin-futures, huobi, huobi-usdt-swap, huobi-coin-swap, okx, erisx, kucoin, ftx, ftx-us, deribit, gateio, gateio-perpetual-futures, cryptocom, bybit, bybit-derivatives, ascendex, bitget.
* FIX: coinbase, gemini, ftx, ftx-us.
* A spot market making application is provided as an end-to-end solution for liquidity providers.
* A single order execution application is provided as an end-to-end solution for executing large orders.
Expand Down
2 changes: 2 additions & 0 deletions app/user_specified_cmake_include.cmake.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ endif()
#
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_ASCENDEX)
#
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_BITGET)
#
# find_package(ZLIB REQUIRED)
# link_libraries(ZLIB::ZLIB)

Expand Down
6 changes: 6 additions & 0 deletions binding/user_specified_cmake_include.cmake.example
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ include_guard(DIRECTORY)
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_CRYPTOCOM)
#
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_BYBIT)
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_BYBIT_DERIVATIVES)
#
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_ASCENDEX)
#
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_BITGET)
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_BITGET_FUTURES)
#
# add_compile_definitions(CCAPI_ENABLE_EXCHANGE_BITMART)
#
# add_compile_definitions(CCAPI_ENABLE_LOG_TRACE)
#
# add_compile_definitions(CCAPI_ENABLE_LOG_DEBUG)
Expand Down
124 changes: 86 additions & 38 deletions include/ccapi_cpp/ccapi_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,21 @@
#ifndef CCAPI_EXCHANGE_NAME_BYBIT
#define CCAPI_EXCHANGE_NAME_BYBIT "bybit"
#endif
// #ifndef CCAPI_EXCHANGE_NAME_BYBIT_USDT_PERPETUAL
// #define CCAPI_EXCHANGE_NAME_BYBIT_USDT_PERPETUAL "bybit-usdt-perpetual"
// #endif
// #ifndef CCAPI_EXCHANGE_NAME_BYBIT_INVERSE_PERPETUAL
// #define CCAPI_EXCHANGE_NAME_BYBIT_INVERSE_PERPETUAL "bybit-inverse-perpetual"
// #endif
#ifndef CCAPI_EXCHANGE_NAME_BYBIT_DERIVATIVES
#define CCAPI_EXCHANGE_NAME_BYBIT_DERIVATIVES "bybit-derivatives"
#endif
#ifndef CCAPI_EXCHANGE_NAME_ASCENDEX
#define CCAPI_EXCHANGE_NAME_ASCENDEX "ascendex"
#endif
#ifndef CCAPI_EXCHANGE_NAME_BITGET
#define CCAPI_EXCHANGE_NAME_BITGET "bitget"
#endif
#ifndef CCAPI_EXCHANGE_NAME_BITGET_FUTURES
#define CCAPI_EXCHANGE_NAME_BITGET_FUTURES "bitget-futures"
#endif
#ifndef CCAPI_EXCHANGE_NAME_BITMART
#define CCAPI_EXCHANGE_NAME_BITMART "bitmart"
#endif
#ifndef CCAPI_LAST_PRICE
#define CCAPI_LAST_PRICE "LAST_PRICE"
#endif
Expand Down Expand Up @@ -284,15 +290,21 @@
#define CCAPI_WEBSOCKET_BYBIT_CHANNEL_TRADE "trade.{symbol}"
#define CCAPI_WEBSOCKET_BYBIT_CHANNEL_BOOK_TICKER "bookticker.{symbol}"
#define CCAPI_WEBSOCKET_BYBIT_CHANNEL_DEPTH "orderbook.40.{symbol}"
// #define CCAPI_WEBSOCKET_BYBIT_USDT_PERPETUAL_CHANNEL_TRADE "trade"
// #define CCAPI_WEBSOCKET_BYBIT_USDT_PERPETUAL_CHANNEL_ORDER_BOOK_L2_25 "orderBookL2_25"
// #define CCAPI_WEBSOCKET_BYBIT_USDT_PERPETUAL_CHANNEL_ORDER_BOOK_L2_200 "orderBookL2_200"
// #define CCAPI_WEBSOCKET_BYBIT_INVERSE_PERPETUAL_CHANNEL_TRADE "trade"
// #define CCAPI_WEBSOCKET_BYBIT_INVERSE_PERPETUAL_CHANNEL_ORDER_BOOK_L2_25 "orderBookL2_25"
// #define CCAPI_WEBSOCKET_BYBIT_INVERSE_PERPETUAL_CHANNEL_ORDER_BOOK_L2_200 "orderBookL2_200"
#define CCAPI_WEBSOCKET_BYBIT_DERIVATIVES_CHANNEL_TRADE "publicTrade.{symbol}"
#define CCAPI_WEBSOCKET_BYBIT_DERIVATIVES_CHANNEL_ORDERBOOK "orderbook.{depth}.{symbol}"
#define CCAPI_WEBSOCKET_ASCENDEX_CHANNEL_TRADES "trades"
#define CCAPI_WEBSOCKET_ASCENDEX_CHANNEL_BBO "bbo"
#define CCAPI_WEBSOCKET_ASCENDEX_CHANNEL_DEPTH "depth"
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_TRADES "trade"
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS "books"
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS1 "books1"
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS5 "books5"
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS15 "books15"
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_TRADES "trade"
#define CCAPI_WEBSOCKET_BITMART_CHANNEL_TRADE "spot/trade"
#define CCAPI_WEBSOCKET_BITMART_CHANNEL_PUBLIC_DEPTH5 "spot/depth5"
#define CCAPI_WEBSOCKET_BITMART_CHANNEL_PUBLIC_DEPTH20 "spot/depth20"
#define CCAPI_WEBSOCKET_BITMART_CHANNEL_PUBLIC_DEPTH50 "spot/depth50"
#ifndef CCAPI_CHANNEL_ID
#define CCAPI_CHANNEL_ID "channelId"
#endif
Expand Down Expand Up @@ -397,6 +409,9 @@
#ifndef CCAPI_EM_POSITION_COST
#define CCAPI_EM_POSITION_COST "COST"
#endif
#ifndef CCAPI_EM_POSITION_ENTRY_PRICE
#define CCAPI_EM_POSITION_ENTRY_PRICE "ENTRY_PRICE"
#endif
#ifndef CCAPI_EM_PARTY_ID
#define CCAPI_EM_PARTY_ID "PARTY_ID"
#endif
Expand Down Expand Up @@ -634,15 +649,21 @@
#ifndef CCAPI_BYBIT_URL_REST_BASE
#define CCAPI_BYBIT_URL_REST_BASE "https://api.bybit.com"
#endif
// #ifndef CCAPI_BYBIT_USDT_PERPETUAL_URL_REST_BASE
// #define CCAPI_BYBIT_USDT_PERPETUAL_URL_REST_BASE "https://api.bybit.com"
// #endif
// #ifndef CCAPI_BYBIT_INVERSE_PERPETUAL_URL_REST_BASE
// #define CCAPI_BYBIT_INVERSE_PERPETUAL_URL_REST_BASE "https://api.bybit.com"
// #endif
#ifndef CCAPI_BYBIT_DERIVATIVES_URL_REST_BASE
#define CCAPI_BYBIT_DERIVATIVES_URL_REST_BASE "https://api.bybit.com"
#endif
#ifndef CCAPI_ASCENDEX_URL_REST_BASE
#define CCAPI_ASCENDEX_URL_REST_BASE "https://ascendex.com"
#endif
#ifndef CCAPI_BITGET_URL_REST_BASE
#define CCAPI_BITGET_URL_REST_BASE "https://api.bitget.com"
#endif
#ifndef CCAPI_BITGET_FUTURES_URL_REST_BASE
#define CCAPI_BITGET_FUTURES_URL_REST_BASE "https://api.bitget.com"
#endif
#ifndef CCAPI_BITMART_URL_REST_BASE
#define CCAPI_BITMART_URL_REST_BASE "https://api-cloud.bitmart.com"
#endif
// end: exchange REST urls

// start: exchange WS urls
Expand Down Expand Up @@ -739,15 +760,21 @@
#ifndef CCAPI_BYBIT_URL_WS_BASE
#define CCAPI_BYBIT_URL_WS_BASE "wss://stream.bybit.com"
#endif
// #ifndef CCAPI_BYBIT_USDT_PERPETUAL_URL_WS_BASE
// #define CCAPI_BYBIT_USDT_PERPETUAL_URL_WS_BASE "https://api.bybit.com"
// #endif
// #ifndef CCAPI_BYBIT_INVERSE_PERPETUAL_URL_WS_BASE
// #define CCAPI_BYBIT_INVERSE_PERPETUAL_URL_WS_BASE "https://api.bybit.com"
// #endif
#ifndef CCAPI_BYBIT_DERIVATIVES_URL_WS_BASE
#define CCAPI_BYBIT_DERIVATIVES_URL_WS_BASE "wss://stream.bybit.com"
#endif
#ifndef CCAPI_ASCENDEX_URL_WS_BASE
#define CCAPI_ASCENDEX_URL_WS_BASE "wss://ascendex.com"
#endif
#ifndef CCAPI_BITGET_URL_WS_BASE
#define CCAPI_BITGET_URL_WS_BASE "wss://ws.bitget.com"
#endif
#ifndef CCAPI_BITGET_FUTURES_URL_WS_BASE
#define CCAPI_BITGET_FUTURES_URL_WS_BASE "wss://ws.bitget.com"
#endif
#ifndef CCAPI_BITMART_URL_WS_BASE
#define CCAPI_BITMART_URL_WS_BASE "wss://ws-manager-compress.bitmart.com"
#endif
// end: exchange WS urls

// start: exchange FIX urls
Expand Down Expand Up @@ -961,18 +988,12 @@
#ifndef CCAPI_BYBIT_API_SECRET
#define CCAPI_BYBIT_API_SECRET "BYBIT_API_SECRET"
#endif
// #ifndef CCAPI_BYBIT_USDT_PERPETUAL_API_KEY
// #define CCAPI_BYBIT_USDT_PERPETUAL_API_KEY "BYBIT_USDT_PERPETUAL_API_KEY"
// #endif
// #ifndef CCAPI_BYBIT_USDT_PERPETUAL_API_SECRET
// #define CCAPI_BYBIT_USDT_PERPETUAL_API_SECRET "BYBIT_USDT_PERPETUAL_API_SECRET"
// #endif
// #ifndef CCAPI_BYBIT_INVERSE_PERPETUAL_API_KEY
// #define CCAPI_BYBIT_INVERSE_PERPETUAL_API_KEY "BYBIT_INVERSE_PERPETUAL_API_KEY"
// #endif
// #ifndef CCAPI_BYBIT_INVERSE_PERPETUAL_API_SECRET
// #define CCAPI_BYBIT_INVERSE_PERPETUAL_API_SECRET "BYBIT_INVERSE_PERPETUAL_API_SECRET"
// #endif
#ifndef CCAPI_BYBIT_DERIVATIVES_API_KEY
#define CCAPI_BYBIT_DERIVATIVES_API_KEY "BYBIT_DERIVATIVES_API_KEY"
#endif
#ifndef CCAPI_BYBIT_DERIVATIVES_API_SECRET
#define CCAPI_BYBIT_DERIVATIVES_API_SECRET "BYBIT_DERIVATIVES_API_SECRET"
#endif
#ifndef CCAPI_ASCENDEX_API_KEY
#define CCAPI_ASCENDEX_API_KEY "ASCENDEX_API_KEY"
#endif
Expand All @@ -982,6 +1003,33 @@
#ifndef CCAPI_ASCENDEX_API_ACCOUNT_GROUP
#define CCAPI_ASCENDEX_API_ACCOUNT_GROUP "ASCENDEX_API_ACCOUNT_GROUP"
#endif
#ifndef CCAPI_BITGET_API_KEY
#define CCAPI_BITGET_API_KEY "BITGET_API_KEY"
#endif
#ifndef CCAPI_BITGET_API_SECRET
#define CCAPI_BITGET_API_SECRET "BITGET_API_SECRET"
#endif
#ifndef CCAPI_BITGET_API_PASSPHRASE
#define CCAPI_BITGET_API_PASSPHRASE "BITGET_API_PASSPHRASE"
#endif
#ifndef CCAPI_BITGET_FUTURES_API_KEY
#define CCAPI_BITGET_FUTURES_API_KEY "BITGET_FUTURES_API_KEY"
#endif
#ifndef CCAPI_BITGET_FUTURES_API_SECRET
#define CCAPI_BITGET_FUTURES_API_SECRET "BITGET_FUTURES_API_SECRET"
#endif
#ifndef CCAPI_BITGET_FUTURES_API_PASSPHRASE
#define CCAPI_BITGET_FUTURES_API_PASSPHRASE "BITGET_FUTURES_API_PASSPHRASE"
#endif
#ifndef CCAPI_BITMART_API_KEY
#define CCAPI_BITMART_API_KEY "BITMART_API_KEY"
#endif
#ifndef CCAPI_BITMART_API_SECRET
#define CCAPI_BITMART_API_SECRET "BITMART_API_SECRET"
#endif
#ifndef CCAPI_BITMART_API_MEMO
#define CCAPI_BITMART_API_MEMO "BITMART_API_MEMO"
#endif
// end: exchange API credentials

#define CCAPI_HTTP_PORT_DEFAULT "80"
Expand Down Expand Up @@ -1011,8 +1059,8 @@
#ifndef CCAPI_FIX_PROTOCOL_VERSION_DERIBIT
#define CCAPI_FIX_PROTOCOL_VERSION_DERIBIT "FIX.4.4"
#endif
#ifndef CCAPI_BYBIT_API_RECEIVE_WINDOW_MILLISECONDS
#define CCAPI_BYBIT_API_RECEIVE_WINDOW_MILLISECONDS 5000
#ifndef CCAPI_BYBIT_BASE_API_RECEIVE_WINDOW_MILLISECONDS
#define CCAPI_BYBIT_BASE_API_RECEIVE_WINDOW_MILLISECONDS 5000
#endif

#ifndef CCAPI_OKX_API_BROKER_CODE
Expand Down
68 changes: 68 additions & 0 deletions include/ccapi_cpp/ccapi_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,21 @@
#ifdef CCAPI_ENABLE_EXCHANGE_BYBIT
#include "ccapi_cpp/service/ccapi_market_data_service_bybit.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BYBIT_DERIVATIVES
#include "ccapi_cpp/service/ccapi_market_data_service_bybit_derivatives.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_ASCENDEX
#include "ccapi_cpp/service/ccapi_market_data_service_ascendex.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET
#include "ccapi_cpp/service/ccapi_market_data_service_bitget.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET_FUTURES
#include "ccapi_cpp/service/ccapi_market_data_service_bitget_futures.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITMART
#include "ccapi_cpp/service/ccapi_market_data_service_bitmart.h"
#endif
#endif
// end: enable exchanges for market data

Expand Down Expand Up @@ -165,9 +177,21 @@
#ifdef CCAPI_ENABLE_EXCHANGE_BYBIT
#include "ccapi_cpp/service/ccapi_execution_management_service_bybit.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BYBIT_DERIVATIVES
#include "ccapi_cpp/service/ccapi_execution_management_service_bybit_derivatives.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_ASCENDEX
#include "ccapi_cpp/service/ccapi_execution_management_service_ascendex.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET
#include "ccapi_cpp/service/ccapi_execution_management_service_bitget.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET_FUTURES
#include "ccapi_cpp/service/ccapi_execution_management_service_bitget_futures.h"
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITMART
#include "ccapi_cpp/service/ccapi_execution_management_service_bitmart.h"
#endif
#endif
// end: enable exchanges for execution management

Expand Down Expand Up @@ -357,10 +381,26 @@ class Session {
this->serviceByServiceNameExchangeMap[CCAPI_MARKET_DATA][CCAPI_EXCHANGE_NAME_BYBIT] =
std::make_shared<MarketDataServiceBybit>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BYBIT_DERIVATIVES
this->serviceByServiceNameExchangeMap[CCAPI_MARKET_DATA][CCAPI_EXCHANGE_NAME_BYBIT_DERIVATIVES] =
std::make_shared<MarketDataServiceBybitDerivatives>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_ASCENDEX
this->serviceByServiceNameExchangeMap[CCAPI_MARKET_DATA][CCAPI_EXCHANGE_NAME_ASCENDEX] =
std::make_shared<MarketDataServiceAscendex>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET
this->serviceByServiceNameExchangeMap[CCAPI_MARKET_DATA][CCAPI_EXCHANGE_NAME_BITGET] =
std::make_shared<MarketDataServiceBitget>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET_FUTURES
this->serviceByServiceNameExchangeMap[CCAPI_MARKET_DATA][CCAPI_EXCHANGE_NAME_BITGET_FUTURES] =
std::make_shared<MarketDataServiceBitgetFutures>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITMART
this->serviceByServiceNameExchangeMap[CCAPI_MARKET_DATA][CCAPI_EXCHANGE_NAME_BITMART] =
std::make_shared<MarketDataServiceBitmart>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#endif
#ifdef CCAPI_ENABLE_SERVICE_EXECUTION_MANAGEMENT
#ifdef CCAPI_ENABLE_EXCHANGE_COINBASE
Expand Down Expand Up @@ -468,10 +508,26 @@ class Session {
this->serviceByServiceNameExchangeMap[CCAPI_EXECUTION_MANAGEMENT][CCAPI_EXCHANGE_NAME_BYBIT] =
std::make_shared<ExecutionManagementServiceBybit>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BYBIT_DERIVATIVES
this->serviceByServiceNameExchangeMap[CCAPI_EXECUTION_MANAGEMENT][CCAPI_EXCHANGE_NAME_BYBIT_DERIVATIVES] =
std::make_shared<ExecutionManagementServiceBybitDerivatives>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_ASCENDEX
this->serviceByServiceNameExchangeMap[CCAPI_EXECUTION_MANAGEMENT][CCAPI_EXCHANGE_NAME_ASCENDEX] =
std::make_shared<ExecutionManagementServiceAscendex>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET
this->serviceByServiceNameExchangeMap[CCAPI_EXECUTION_MANAGEMENT][CCAPI_EXCHANGE_NAME_BITGET] =
std::make_shared<ExecutionManagementServiceBitget>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITGET_FUTURES
this->serviceByServiceNameExchangeMap[CCAPI_EXECUTION_MANAGEMENT][CCAPI_EXCHANGE_NAME_BITGET_FUTURES] =
std::make_shared<ExecutionManagementServiceBitgetFutures>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#ifdef CCAPI_ENABLE_EXCHANGE_BITMART
this->serviceByServiceNameExchangeMap[CCAPI_MARKET_DATA][CCAPI_EXCHANGE_NAME_BITMART] =
std::make_shared<MarketDataServiceBitmart>(this->internalEventHandler, sessionOptions, sessionConfigs, this->serviceContextPtr);
#endif
#endif
#ifdef CCAPI_ENABLE_SERVICE_FIX
#ifdef CCAPI_ENABLE_EXCHANGE_COINBASE
Expand Down Expand Up @@ -575,6 +631,18 @@ class Session {
"unsupported exchange fields: " + toString(unsupportedExchangeFieldSet));
return;
}
for (const auto& subscription : subscriptionList) {
auto exchange = subscription.getExchange();
if (exchange == CCAPI_EXCHANGE_NAME_BYBIT_DERIVATIVES) {
const auto& instrumentType = subscription.getInstrumentType();
std::vector<std::string> instrumentTypeList = {"usdt-contract", "usdc-contract", "usdc-options"};
if (std::find(instrumentTypeList.begin(), instrumentTypeList.end(), instrumentType) == instrumentTypeList.end()) {
this->onError(Event::Type::SUBSCRIPTION_STATUS, Message::Type::SUBSCRIPTION_FAILURE,
"unsupported exchange instrument types: " + toString(instrumentType) + ". Allowed values: " + toString(instrumentTypeList) + ".");
return;
}
}
}
CCAPI_LOGGER_TRACE("subscriptionListByExchangeMap = " + toString(subscriptionListByExchangeMap));
for (auto& subscriptionListByExchange : subscriptionListByExchangeMap) {
auto exchange = subscriptionListByExchange.first;
Expand Down
Loading

0 comments on commit 79b2080

Please sign in to comment.