Crypto grid trading liquidity bot for beginners.
lqbot
is a very simple grid trading bot, with the main goal to provide liquidity to a market with little risk.
The bot currently only supports kucoin, but could be easily adapted for other exchanges.
It allows you to place a limit order and whenever that limit order is filled, it will automatically create a counter-order.
A counter order of a buy-order is a sell-order at price + x%
, a counter-order of a sell-order is a buy-order at price -x%
.
As long as the price moves up and down, you make profitable trades. If the price permanently increased, you'll end up with respective tokens sold, if the price permanently decreased you'll end up with respective tokens bought.
Make sure you have node.js and yarn installed.
git clone https://github.com/longpass/lqbot
cd lqbot
yarn
Copy config.json.sample
to config.json
and edit it.
The configuration file is pretty self-explanatory:
{
"market": "NIM/BTC",
"max_spread": 0.01,
"demo": false,
"kucoin": {
"apiKey": "<api-key>",
"secret": "<api-secret>",
"password": "<api-password>"
}
}
market
: the market you'd like the bot to operate on.max_spread
: This basically defines thex
as described in System section.0.01
equalsx = 1%
demo
: If set to true, no trades will be performed. All demo trades will be considered filled on next iteration.apiKey
,secret
,password
: Details for accessing the KuCoin API.
Display all orders currently monitored by the bot as well as their current status.
Add a new buy or sell order at with given amount at given price. The order will be placed on the exchange and added to the list of bot-monitored trades.
Cancel the order with the given id. The order will no longer be monitored by the bot. You can see all possible order ids using ./index.js status
.
Go through all currently monitored orders and check if any of them was filled. Create new orders if necessary.
Once you are happy with the configuration of your bot and have a bunch of orders set up, you'll want to persist it.
For this, configure a cronjob that regularly (suggested is every 5 minutes) runs ./index.js run
.
You can do this easily by invoking:
./persist.sh