Giter VIP home page Giter VIP logo

liquidation_bot's Introduction

DDEX Liquidation Bot

Participate in the liquidation on DDEX to earn money ๐Ÿ’ฐ๐Ÿ’ฐ๐Ÿ’ฐ

Getting Started

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

Prerequisites

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.

Run Container

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

Screen Snapshot

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.

Volumes

  • /your/file/path - Where liquidation history, config and logs stored
Useful File Locations
  • /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

Parameters

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 X e.g. 100

  • PROFIT_MARGIN - I don't want to bid unless the profit margin greater than X e.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 plus 0Gwei, 10Gwei and 25Gwei respectively to send transactions

  • MAX_SLIPPAGE - Don't arbitrage if the slippage greater than X e.g. 0.05 (0.05 means 5%)

Edit /your/file/path/config.json and restart bot to adjust parameters.

Contributing

  1. Fork it (https://github.com/hydroprotocol/liquidation_bot/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

This project is licensed under the Apache-2.0 License - see the LICENSE file for details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.