Code Monkey home page Code Monkey logo

bybitmakertrader's Introduction

How it works

Bybit Maker Trader in USDT Perpetual Market

  1. 50 limit order per each side from current price (short limit order to upper side / long limit order to down side)
  2. If limit order is filled, user gets 0.025 % from filled order amount.
  3. If open positions are off balance (one side being less than 25 %) :
  1. clear all open positions (short, long)
  2. start rebalancing to 50% 50%

Logic

  • Added base http api, base websocket API classes
  • Subscribed kline data to get current price
  • Used PostOnly option for placing order to ensure it does not pay any taker fee
  • Sends ping every 15 mins for websocket connection
  • API Request limit considered, it waits certain amount of time when API call is blocked -> up down 40 recommended (i think 35 is also fair enough)
  • Get active orders using API to make sure it recognizes previous orders even before program startup
  1. Place limit orders when the current price reaches (start_gap + order_gap), (down - middle - up) side
  2. If order is filled or cancelled, it checks current price and then cancel or place short&long orders based on the current price
  3. Check open positions to check if the positions are out of balance (less than 25 %)
  4. If so, either clear all positions (method 1) or rebalance to 50 % : 50 % (method 2)
  • rebalancing method 1: Program stops in case of clearing all positions
  • rebalancing method 2: all active orders are canceled when the program starts clearing positions (idk, just.. bybit does that)

bybitmakertrader's People

Contributors

taekhyang avatar taekhyangkim avatar

Stargazers

 avatar Ft avatar  avatar

Watchers

 avatar

Forkers

sfex11

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.