Participate in the liquidation on DDEX to earn money 💰💰💰
Margin positions will be liquidated if the collateral rate too low. When a liquidation occurs, the borrowers' assets are sold off in a form of a dutch auction to repay the loan. This bot help you bid the auction when profitable.
The bot uses an arbitrage strategy: Sell collateral on DDEX immediately after receive it from an auction. For example:
- An auction sell 10ETH at price 160USDT
- The bot buy 10ETH
- The bot sell 10ETH on ddex at price 170USDT
- Earn 10*170-10*160=100USDT
You need to prepare some asset(e.g. ETH, USDT, DAI) in your DDEX spot trading balance.
In order to run this container you'll need docker installed.
Replace /your/file/path
with your local directory.
docker run -it --rm -v /your/file/path:/workingDir --name=auctionBidder hydroprotocolio/liquidation_bot:latest /bin/main
If you want to test on ropsten
docker run -it --rm -v /your/file/path:/workingDir --name=auctionBidder --env NETWORK=ropsten hydroprotocolio/liquidation_bot:latest /bin/main
The bot try to fill every current auction when new block listened. It also records your profit and loss and show free trading balance of the address you use.
/your/file/path
- Where liquidation history, config and logs stored
-
/your/file/path/auctionBidderSqlite
- Your bid history is recorded in sqlite file -
/your/file/path/config.json
- Bot parameters -
/your/file/path/log.%Y%m%D
- Logs
The bot will ask for the following parameters for the first run:
-
PRIVATE_KEY
- Private key of the account to join liquidation -
ETHEREUM_NODE_URL
- Ethereum node url. Get a free node at infura. -
MARKETS
- Which markets' auction I am interested in. Separated by commas.e.g. ETH-USDT,ETH-DAI
-
MIN_AMOUNT_VALUE_USD
- I don't want to participate the auction unless its USD value greater than Xe.g. 100
-
PROFIT_MARGIN
- I don't want to bid unless the profit margin greater than Xe.g. 0.01
(0.01 means 1%) -
GAS_PRICE_LEVEL
-e.g. fast, super-fast or flash-boy
will use FAST gas price from ethgasstation plus0Gwei
,10Gwei
and25Gwei
respectively to send transactions -
MAX_SLIPPAGE
- Don't arbitrage if the slippage greater than Xe.g. 0.05
(0.05 means 5%)
Edit /your/file/path/config.json
and restart bot to adjust parameters.
- Fork it (https://github.com/hydroprotocol/liquidation_bot/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
This project is licensed under the Apache-2.0 License - see the LICENSE file for details