GithubHelp home page GithubHelp logo

masonwilie / ftxgateway Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 166 KB

Application and library that helps to prevent having to pay taker fees (and possibly collect maker fees) on the FTX crypto exchange

License: MIT License

CMake 0.13% C++ 96.03% C 3.85%

ftxgateway's Introduction

Description

This project is obviously not very useful anymore, but I thought it'd be interesting to put it out there anyways. The goal of this app is to just try to get around market taking fees by continuously joining the bid or ask, hoping to get taking. It works, but is slow (not the app itself, the strategy) and can potentially result in a worse price anyway considering that it exposes you to movement in the market (though if you believe that the price is a random walk then it's equally likely that you'd get a better price, not considering momentum which shouldn't play much of a factor considering that the exposure is still only seconds). If you are on an exchange that allows you to actually collect maker fees (some do if you hold a certain amount of their coin) or there are no maker fees, then this may actually be worth it.

Dependencies

Boost

OpenSSL

This project also depends on RapidJson and CPR, but they should automatically be available.

Platforms

Tested with GCC 9.4.0 on Ubuntu 20.04

Building

Starting in the root directory, run the following

$ mkdir build
$ cd build
$ cmake ..
$ make

This should generate an executable called FtxReduceMtFee

Running

To start the program, execute the following

$ ./FtxReduceMtFee "<api_key>" "<api_secret>" "<market>"

This should bring up a basic console. From there, enter a command.

s -- Send a sell order
b -- Send a buy order
q -- Quit

The next prompt will ask for a size (units are in whatever coin you are buying or selling)

This should send an order, and eventually the order will fill and information about the fill will be posted.

--- Fill ---
Original order price: 1181.4, Original market price: 1181.2, Fill price: 1181.2, slippage: 0, Times queued: 14

Here is a description of these values

Original order price -- Price of the first limit order placed
Original market price -- Price that the market order would have filled at
Fill price -- Price that you did fill at
Slippage -- Percentage of price improvement using this strategy (not including fees)
Times queued -- Number of orders/cancels placed to get this fill

Strategy

This application implements a pretty naive strategy of just repeatedly improving the BBO by one tick until the entire order is filled.

Issues

  • Executions are much slower than regular market orders, since this strategy requires the market price to move into your order
  • The final fill price can be worse than what it would have been if you were to just place a market order. But the fee reduction helps negate this.

ftxgateway's People

Contributors

masonwilie avatar

Watchers

 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.