The bot's purpose is to accumulate tokens over time
It is a market maker bot working in futures markets, making multiple post only limit orders above and below current price
It listens to websocket live stream of trades, and updates its orders continuously
If there is a long position, it creates reentry bids below pos price, and reduce-only asks above pos price:
reentry_bid_price = pos_price * (1 - grid_spacing * (1 + (position_margin / wallet_balance) * grid_coefficient))
If there is a short position, it creates reentry asks above pos price, and reduce-only closing bids below pos price:
reentry_ask_price = pos_price * (1 + grid_spacing * (1 + (position_margin / wallet_balance) * grid_coefficient))
In hedge mode, stop loss works like this:
if diff(liq_price, last_price) < stop_loss_liq_diff:
if available margin:
enter opposite side
else:
close same side at a loss
In both cases liq price will be pushed away
- Python == 3.8.x
- requirements.txt dependencies
pip install -r requirements.txt
- Add your api key and secret in file api-keys.json
-
python3 start_bot.py {account_name} {symbol} {path/to/config.json}
Example:
python3 start_bot.py binance_01 XMRUSDT live_configs/binance_default.json
Modify command with exchange and user_name in docker-compose.yml and start
with docker-compose up -d
(-d for background run). All code and files generated are in original git folder.
For graceful stopping of the bot, set do_long
and do_shrt
both to false
, and bot will continue as normal, opening
no new positions, until all existing positions are closed.
https://github.com/enarjord/passivbot/wiki
- Repository of settings and their backtesting results: https://github.com/JohnKearney1/PassivBot-Configurations
Released freely without conditions. Anybody may copy, distribute, modify, use or misuse for commercial, non-commercial, educational or non-educational purposes, censor, claim as one's own or otherwise do whatever without permission from anybody.
A backtester is included
- go to
backtest_configs/{config_name}.hjson
and adjust it - run with
python3 backtest.py path_to_config.hjson
Will use numba's just in time compiler by default to speed up backtesting, add argument --nojit
to disable numba:
python3 backtest.py backtest_configs/{config_name}.hjson --nojit
See wiki for more info on backtesting
-
XMR:
49gUQ1jasDK23tJTMCvP4mQUUwndeLWAwSgdCFn6ovmRKXZAjQnVp2JZ2K4UuDDdYMNam1HE8ELZoWdeJPRfYEa9QSEK6XZ
-
Nano:
nano_1nf3knbhapee5ruwg7i8sqekx3zmifdeijr8495t9kgp3uyunik7b9cuyhf5
-
EOS:
nbt4rhnhpjan
-
XLM:
GDSTC6KQR6BCTA7BH45B3MTSY52EVZ4UZTPZEBAZHJMJHTUQQ5SM57S7
-
USDT TRC20 (Binance):
TJr3KYY8Bz7wRU7QLwoYQHk88LcaBJqQN5