Categorygithub.com/CapsLock-Studio/binance-premium-bot
repositorypackage
0.0.0-20221115035502-c49ec9914b6e
Repository: https://github.com/capslock-studio/binance-premium-bot.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

binance-premium-bot

:warning: This bot is for test only! :warning:

It helps you create double-side contract order to generate funding fee without loss(delta neutral strategy). It's possible to make incredible APR(>500%) in crypto even in :bear: market.

Use it at your own risk!!!

Roadmap

  • (binance) perp delta neutral hedge mode
  • (binance) reduce mode
  • (binance) arbitrage mode
  • http server
  • yaml config
  • managed service for whitelist users
  • Notify messages via webhook
  • persistent storage for http mode
  • position protection
  • (binance + ftx) perp delta neutral hedge mode
  • (binance + ftx) perp reduce mode
  • binance spot & perp delta neutral hedge mode
  • ftx spot & perp delta neutral hedge mode

Sorry, FTX had been rugpull

What you should prepare first

  1. Binance API Key & Secret, you can learn how to create here
  2. golang 1.19 or docker

How to build and use

For executable binary

go build

./binance-premium-bot --help

Build your own docker image

docker build . -t binance-premium-bot

docker run -it --rm binance-premium-bot --help

Run docker image from github registry

docker run --pull always -ti --rm ghcr.io/capslock-studio/binance-premium-bot:main --help

If you think building your own binary and docker image is too hard for you

Just check this and download the latest binary

Usage

Usage of ./binance-premium-bot:
  -apiKey string
    	binance api key
  -apiSecret string
    	binance api secret
  -arbitrage
    	use arbitrage mode
  -before float
    	change direction before n minutes (default 480)
  -config string
    	yaml config for multi-assets
  -difference float
    	BUSD & USDT difference (default 0.05)
  -leverage int
    	futures leverage (default 10)
  -quantity float
    	quantity per order
  -reduce
    	use reduce mode
  -serve
    	serve in http mode
  -store string
    	store data in sqlite (default "/tmp/data.db")
  -symbol string
    	binance future symbol
  -threshold float
    	minimum threshold
  -total float
    	total quantity
  -webhook string
    	notify via webhook

Example (docker for example)

docker run --pull always -it --rm ghcr.io/capslock-studio/binance-premium-bot:main -total 0.002 -quantity 0.001 -symbol BTC -apiKey XXX -apiSecret XXX

Auto arbitrage mode

Arbitrage mode is a mode can find a chance to arbitrage between USDT & BUSD perpetual. You have to set -arbitrage flag and let bot run automatically. :smile:

Here are some backtest result(real data).

NOTE: Binance taker fee is excluded

#CURRENCYPOSITIONBUYSELLPROFIT
1LDOBUSDLONG1.607000001.60500000-0.12445550715619177%
1LDOUSDTSHORT1.603000001.609000000.37290242386575545%
21000SHIBUSDTSHORT0.011144090.011191100.4200659452600737%
21000SHIBBUSDLONG0.011181000.01115740-0.2110723548877592%
3DOTBUSDLONG6.559000006.55468499-0.06578762006403427%
3DOTUSDTSHORT6.547000006.564295940.2634850737701558%
4CVXBUSDLONG4.783000004.76850647-0.3030217436755216%
4CVXUSDTSHORT4.762718414.787000000.5072402339669978%
5LDOBUSDSHORT1.620000001.61500000-0.30959752321982137%
5LDOUSDTLONG1.613567301.622000000.5226122269582547%

Use config file

Now I've provided a more efficient way to run your own bot! You can just create a yaml file and use -config flag.

For example

apiKey: ""
apiSecret: ""
leverage: 10
differece: 0.005
settings:
- symbol: LDO
  quantity: 10
  total: 1000
- symbol: LUNA2
  quantity: 10
  total: 1000

Serve in http mode

There is another convenient way to run your bot, you can use -serve flag to run a simple server expose to port 8080.

Some magic happend like this

./binance-premium-bot -serve

Then, you can use curl to create a hedge bot.

For WAVES as example

curl -X POST -H 'X-USER: XXX' -H 'Content-Type: application/json' -d '{"symbol": "WAVES", "quantity": 0.0001, "total": 0.0001}' http://localhost:8080

And you'll get an uuid, once you want to stop your bot, you just need to call DELETE method.

For example, your POST api get an uuid 2563fbb8-3492-4eda-b4db-5d1941c10742, you want remove your bot you have to make a DELETE request.

curl -H 'X-USER: XXX' -X DELETE http://localhost:8080/2563fbb8-3492-4eda-b4db-5d1941c10742

Done!