Git Product home page Git Product logo

gamma-ray's Introduction

license

Gamma Ray

WARNING: The author of this software will not be responsible for your losses on the market, use at your own discretion.

Introduction

Gamma Ray is a high frequnecy market maker trading bot for crypto currency markets written in C++. It is able to consistantly update maker orders under 100 micro seconds.

This program is aimes to be a starting point for developing your own market maker algorithms, and it comes with 3 existing strategies for you to get started:

  • Top, which tries to post 1 tick better than the existing best bid and ask prices in the orderbook, given a minimum spread contraint.
  • Mid, which post bid/ask orders with a fixed spread.
  • Avellaneda Stoikov, which is a high frequency market maker framework with a proper model, for more information you may read the paper here. A jupyter notebook doc/AS model calibration.ipynb is provided giving a sample method to calibrate model parameters.

As of now this program only supports one exchange: Bitmex, more exchanges may be added in the future depend on user request.

Build Instructions

This program is tested on Ubuntu 18, other Linux distributions may differ from this instruction.

Install dependencies

# install dependent packages
sudo apt-get update
sudo apt-get -y install build-essential doxygen graphviz ninja-build libboost-all-dev libssl-dev libcpprest-dev

# install cmake 3.18
wget https://github.com/Kitware/CMake/releases/download/v3.18.0-rc1/cmake-3.18.0-rc1.tar.gz && tar -xzvf cmake-3.18.0-rc1.tar.gz && cd cmake-3.18.0-rc1
./bootstrap && make
sudo make install
cd .. && rm -rf cmake-3.18.0-rc1
source

# install poco
git clone -b master https://github.com/pocoproject/poco.git
cd poco
mkdir cmake-build && cd cmake-build
cmake ..
sudo cmake --build . --target install
cd ../.. && rm -rf poco

Build

git clone --recurse-submodules https://github.com/hello2all/gamma-ray
cd gamma-ray

mkdir release
cd release

cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
ninja

Configuration

A sample configuration sample-config.json is provided, after editing according to your parameters this config file is required to be renamed to gamma-ray.json and copied into the same directory as the executable.

cp ./sample-config.json ./release/gamma-ray.json

A brief explaination of configurable parameteres:

  • websocketUrl: Websocket API end point
  • httpUrl: REST API end point
  • apiKey: API key
  • apiSecret: API secret
  • contract: trading pair, currently supports only perpetual contracts such as BTCUSD, ETHUSD etc.
  • quotingMode: quoting strategy, you can choose from Mid, Top and AvellanedaStoikov.
  • size: order size/quantity
  • quotingModeParam: quoting strategy specific parameters
  • pairs: how many price levels of bid ask pairs will be posted
  • priceInterval: price difference between price levels
  • sizeIncrement: size difference between price levels
  • skewFactor: for each executed order size, mid price will move one tick against the executed side
  • tradesPerMinute: safety feature, maximum orders can be executed before stop quoting, not yet implemented

Run

With gamma-ray.json config file in the same directory with the executable

./release/main

Deployment

For the best latency, this bot should be deployed on AWS eu-west-1c.

Donations❤️

This project is still evolving and need your help to grow. If you find this project useful, please consider support the development of this project by donating using the following addresses. Testing HFT strategies replies on trading on live markets due to many technical constrains, which can be costly. Your contribution will keep this project free and open to the public.

BTC: 3BMEXLjaNku2Sh73s2i1DZVTgKpDrzTSwk

ETH: 0x9DFe1C3E906Ec27121e7921953CEdA5AaB558306

Donators will have early access to new features and your feature requests will be prioritised.

Join the community

If you have questions or would like to contribute to the project, join our Discord channel. It's gonna be a sausage party, I promise :p

https://discord.gg/ZAG6aCXfCs

gamma-ray's People

Contributors

hello2all avatar mlake avatar prgtrdr avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.