Skip to content

ppl-call-me-tima/deribit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deribit - Order Execution and Management System

This is an implementation of an Order Execution and Management System which functions on WebSocket and is built on C++.

Steps (Linux)

  1. Generate Credentials: Create an account on https://test.deribit.com/ and generate your API credentials - client_id and client_secret.
  2. Clone this repository
    git clone https://github.com/ppl-call-me-tima/deribit.git
    cd deribit
  3. Install the websocketpp library and its dependencies
    sudo apt update
    sudo apt install libwebsocketpp-dev
    sudo apt install libssl-dev
    sudo apt install libboost-all-dev
  4. Install the nlohmann/json library.
    sudo apt install nlohmann-json3-dev
  5. Run the Makefile and upon completion, run the executable.
    make
    ./main

List of Commands

  1. show: Shows the metdata for the WebSocket connection along with incoming/outgoing messages along with the error logs if any.
  2. auth: Authenticates user which is required for private methods of the API.
    Parameters: client_id, client_secret
  3. buy: Executes a buy request of a particular instrument, amount, type along with a label.
    Parameters: instrument_name, amount, type, label
  4. sell: Executes a sell request of a particular instrument, amount, type along with a label.
    Parameters: instrument_name, amount, type, label
  5. cancel: Cancels an order with a particular order ID.
    Parameters: order_id
  6. cancel all: Cancels all the currnet open orders.
  7. edit: Edits the amount or price for a current opened order with a particular order ID.
    Placeholders: order_id, amount, price
  8. orders: Shows the information of all the current opened orders.
  9. orderbook: Shows the orderbook for a particular instrument upto a specified depth.
    Parameters: instrument_name, depth
  10. positions: Shows the current position of the user for a particular currency.
    Parameters: currency
  11. subscribe: Subscribes to a particular instrument channel.
    Parameters: channel, interval
  12. unsubscribe: Unsubsribe from a particular instrument channel.
    Paramters: channel, interval
  13. tgl: Toggles the continuous incoming of responses of the subscribed channel.
  14. quit: Close the WebSocket connection.

About

deribit api testing

Topics

Resources

Stars

Watchers

Forks