A command line trading application, optimized for low latency trading requests using websockets. It implements Deribit API, however the application uses a dependency-inversion pattern so that using another API is as simple as creating a C++ class derived from the common trading interface class.
- The application uses a multithreaded implementation for network requests and user interaction. At the time of testing, websocket requests were on average below 100us.
Deribit API Reference: https://docs.deribit.com/
demo.mp4
- Rename the file
api_key.json.sample
in the project-root directory toapi_key.json
. Add the client-id and client-secret from you Deribit API Key (found in the API section in the settings) - Make sure you have built the application as per the build section
- Run the built executable
client_trader
. - The commands provided in the application can be seen using
help
. The first step is to connect to the Deribit API usingderibit_connect
- Authorize to the Deribit API using
deribit_auth
(this will use the API credentials provided inapi_key.json
. Note: This step is recommended, however commands usingpublic/
API methods such asderibit_order_book
can be used without authorization) - Use the available commands to perform trading operations
- Placing buy and sell orders
- Edit and Cancel orders
- Get orderbook (
/public/get_order_book
) - View current positions
Stream realtime market data by subcribing to one or more channels. Channel names can be referred to using the API documentation.
The application supports Spot, Futures, Options and Perpetual trading as instruments. All supported symbols have been implemented.
The repository requires Boost and OpenSSL package which must be discoverable by CMake on your system using CMake's find_package
.
The following commands should be used from the project root to build the application.
cmake -B build
cmake --build build -j$(nproc) # speed-up compilation
An executable called client_trader
will be created in the project root.
A detailed analysis of profiling and benchmarking can be found in the Performance Report document.
The explanation of the code can be found in the Code Review document.