Skip to content

lightcycleresearch/ftx-websocket-rest-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

ftx websocket cpp with fixes

Fixes required locking the websocketpp version and updating boost installation location

External

Build and Run

References

  1. Build container
    docker build -t ftxcc - < ./Dockerfile
  2. Open bash shell to container
    docker run -it -v $(pwd):/ftxcc -w /ftxcc/bin ftxcc /bin/bash
  3. cmake and build
    cmake ..
    make
  4. Run the websocket
    cd ./src/example/ws_test

Example Output

Within container:

root@xxxxxxxxxxxx:/ftxcc/bin# ./src/example/ws_test

msg: "{\"type\": \"error\", \"code\": 400, \"msg\": \"Not logged in\"}"
msg: "{\"type\": \"subscribed\", \"channel\": \"orderbook\", \"market\": \"BTC-PERP\"}"
msg: "{\"type\": \"subscribed\", \"channel\": \"ticker\", \"market\": \"BTC-PERP\"}"
msg: "{\"channel\": \"ticker\", \"market\": \"BTC-PERP\", \"type\": \"update\", \"data\": {\"bid\": 41570.0, \"ask\": 41571.0, \"bidSize\": 2.339, \"askSize\": 2.8949, \"last\": 41576.0, \"time\": 1644041458.39259}}"
...
msg: "{\"channel\": \"orderbook\", \"market\": \"BTC-PERP\", \"type\": \"partial\", \"data\": {\"time\": 1644041458.6191204, \"checksum\": 886602363, \"bids\": [[41570.0, 2.339], [41569.0, 1.2517]," ...
...

Configure

  1. Add your API keys to the clients
  2. Run the examples:
    ./src/example/rest_test
    ./src/example/ws_test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors