Code Monkey home page Code Monkey logo

defiarb's Introduction

Defi arbitrage bot (BSC)

Flash loan arbitrage bot for BSC

The bot is not profitable as-is

Installation

The project relies on a PostgreSQL database to keep trusted tokens and LPs lists

From binary

  1. Download the binary
  2. Run chmod +x defiarb
  3. Copy the file in a $PATH directory (eg. /usr/bin)
  4. [Customize configuration](#Config file)

From source

  1. Clone the repo

    git clone ...

  2. Install dependencies

    go get ./...

  3. [Customize configuration](#Config file)

Config file

Copy config.example.json and edit it according to your needs:

  • NodeUrl: bsc node URL
  • ContractAddress: bsc node URL
  • Db: PostgreSQL db config
    • Host: DB host (default localhost)
    • Port: DB port
    • DbName: DB name
    • User: Username
    • Password: Password

Smart contract

The arbitrage smart contract is in contracts/flash_loans, deploy it with truffle migrate and add the resulting address in config.json.

Usage

Before starting the arbitrage bot the database should be updated:

  1. Update trusted tokens from trustwallet list with command updateTokens
  2. Update LP tokens list for desired exchanges with command scan [EXCHANGE_1 ... EXCHANGE_n] (this command may take a long time to complete)
  3. Run the arbitrage bot with run command

Help

Run defiarb --help for command list and defiarb [COMMAND] --help for detailed command help

Write example config file

defiarb writeconfig [CONFIG_FILE.json]

Update token list

defiarb updateTokens

Update LP tokens

defiarb scan [EXCHANGE_1 ... EXCHANGE_n]

Run arbitrage bot

defiarb run

Contributing

The project was meant as a learning project, so it is not regularly maintained but any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

defiarb's People

Contributors

niccolocastelli avatar

Watchers

 avatar

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.