Closed cryptochassis closed 3 years ago
myself and @donzthefonz will get on this today/tomorrow, just incase someone else was thinking of doing it or are already doing it. With that said, i'm assuming this task could be broken down into a task per exchange since it requires concrete exchange implementations
@BroBan Cool. Please git pull develop branch, since the update https://github.com/crypto-chassis/ccapi/pull/108 that @donzthefonz needed was a bit larger than expected. As far as I know, no one else has started the coding part of this task yet. You can pick your favorite exchange. :)
Hi, the order update implmentaion of websocket api of Huobi and Huobi USDT Swap is needed.I can't find any codes of them.
@foonsun Yes. Just released okex, so working on huobi family right now.
great job! thanks
Waiting.
@foonsun https://github.com/crypto-chassis/ccapi/pull/138. I'd still need to run a couple of tests, though...:)
@foonsun huobi websocket order updates has been merged into develop branch and released into master branch. Working on huobi-usdt-swap now... :)
@foonsun huobi websocket order updates has been merged into develop branch and released into master branch. Working on huobi-usdt-swap now... :)
Thanks for your greate work! :)
@foonsun huobi-usdt-swap (and huobi-coin-swap) websocket order updates has been merged into develop branch and released into master branch. :)
great job!thanks
Is your feature request related to a problem? Please describe. Receiving execution reports on order and trade status in real time is important for high frequency trading.
Describe the solution you'd like In
include/ccapi_cpp/service/ccapi_execution_management_service.h
some skeleton code was copy/paste'd frominclude/ccapi_cpp/service/ccapi_market_data_service.h
which already support websocket api. To add support for a given exchange, we would override functionvoid logonToExchange(const WsConnection& wsConnection, const TimePoint& tp)
and functionvoid onTextMessage(wspp::connection_hdl hdl, const std::string& textMessage, const TimePoint& timeReceived)
in a concrete exchange implementation.logonToExchange
implementation, depending on the exchange, it might need to send messages to the websocket connection which can be achieved by calling its existingvoid send(wspp::connection_hdl hdl, std::string const& payload, wspp::frame::opcode::value op, ErrorCode& ec)
. It might also need to send requests to some restful API endpoint, which can be achieved by calling its existingvoid sendRequest(const std::string& host, const std::string& port, const http::request<http::string_body>& req, std::function<void(const beast::error_code&)> errorHandler, std::function<void(const http::response<http::string_body>&)> responseHandler, long timeoutMilliSeconds)
. In particular the implementation will need to take care of authentication.onTextMessage
, it would need to handle various text messages received from the websocket connection (protocol level and application level ping/pong/heartbeats have already been taken care of in the skeleton code). In particular, when a websocket message with data related to order updates (i.e. execution report) is received, the implementation needs to parse the websocket message using rapidjson, and create aEvent
with typeSUBSCRIPTION_DATA
which has oneMessage
with typeEXECUTION_MANAGEMENT_EVENTS
which has manyElement
s with each element having itsnameValueMap
containing the final results (We'd discuss how to standardize the keys in this map). TheEvent
is emitted via a call tothis->eventHandler(event);
.Event
s (e.g. create order). For other harder-to-test events (e.g. order matching), we'd have to rely on unit tests for quality assurance.