crypto-chassis / ccapi

A header-only C++ library for interacting with crypto exchanges. Bindings for Python, Java, C#, Go, and Javascript are provided.
https://discord.gg/b5EKcp9s8T
MIT License
574 stars 199 forks source link

Support websocket api to receive order updates (i.e. execution report) #81

Closed cryptochassis closed 3 years ago

cryptochassis commented 3 years ago

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 from include/ccapi_cpp/service/ccapi_market_data_service.h which already support websocket api. To add support for a given exchange, we would override function void logonToExchange(const WsConnection& wsConnection, const TimePoint& tp) and function void onTextMessage(wspp::connection_hdl hdl, const std::string& textMessage, const TimePoint& timeReceived) in a concrete exchange implementation.

BroBan commented 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

cryptochassis commented 3 years ago

@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. :)

cryptochassis commented 3 years ago

Reference implementation: https://github.com/crypto-chassis/ccapi/blob/develop/include/ccapi_cpp/service/ccapi_execution_management_service_ftx.h

foonsun commented 3 years ago

Hi, the order update implmentaion of websocket api of Huobi and Huobi USDT Swap is needed.I can't find any codes of them.

cryptochassis commented 3 years ago

@foonsun Yes. Just released okex, so working on huobi family right now.

foonsun commented 3 years ago

great job! thanks

foonsun commented 3 years ago

Waiting.

cryptochassis commented 3 years ago

@foonsun https://github.com/crypto-chassis/ccapi/pull/138. I'd still need to run a couple of tests, though...:)

cryptochassis commented 3 years ago

@foonsun huobi websocket order updates has been merged into develop branch and released into master branch. Working on huobi-usdt-swap now... :)

foonsun commented 3 years ago

@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! :)

cryptochassis commented 3 years ago

@foonsun huobi-usdt-swap (and huobi-coin-swap) websocket order updates has been merged into develop branch and released into master branch. :)

foonsun commented 3 years ago

great job!thanks