# Auction Bot
Client software for a running an auction bot on the kava blockchain. Currently tested against kava-testnet-8000.
Note this is highly experimental software that requires a funded hot wallet to use. Running this software requires advanced technical skills and involves risks which are outside of the control of Kava Labs. Any use of this open source Apache 2.0 licensed software is done at your own risk and on a “AS IS” basis, without warranties or conditions of any kind, and any and all liability of Kava Labs for damages arising in connection to the software is excluded. Please exercise extreme caution!
- NodeJS - tested against version 10.x+
- yarn - tested against version 1.22.4
# How Auctions Work
Currently, this bot can be configured to participate in collateral auctions. Collateral auctions occur when a user's CDP has fallen below the required collateralization ratio and is liquidated. When this occurs, the kava protocol will initiate a collateral auction. An example collateral auction looks like:
In this example auction, a lot of 10 BNB is being sold for a maximum bid of 94.5$ USDX.
Collateral auctions have two phases, forward and reverse. In the forward phase, bidders bid increasing amounts of USDX in exchange for the entire
lot. Once the max bid is reached, the auction switches to the reverse phase. In the reverse phase, bidders bid decreasing lots of collateral (BNB in the example) they are willing to receive in exchange for
max_bid. In the example, the
max_bid is 94.5$ USDX for 10 BNB. At a current price of ~$16/BNB, the
max_bid represents a considerable profit opportunity. Thus, a more competitive auction would expect to have
max_bid reached and the final lot to be closer to 6 BNB, with the 4 remaining BNB returned to the original CDP holder.
# Standalone Server Setup
To run an auction bot, you need to acquire some USDX that will be used for bidding and load that USDX onto an account that your server has access to the mnemonic of. Practice extreme care in securing your server.
.env file in
kava-tools/scripts (see example) :
This file configures what kind of collateral auctions the bot will bid on and what profit margins the bot will attempt to make.
systemd file to run the auction process. An example with user
ubuntu is as follows (note that the
nodejs process is at
/usr/bin/nodejs, this may be different depending on how you install node ):
Run the auction process
To view the logs of the auction process:
# How it works
At the specified crontab frequency, the auction client will query the kava blockchain for ongoing auctions. Using the configured parameters, it will bid on auctions if they meet the requirements. For purposes of determining margin, the client queries the Binance v3 exchange API for the current spot price of the collateral asset. If Binance is not responding, CoinGecko is used as a backup.