Flash loan arbitrage bot for BSC
The bot is not profitable as-is
The project relies on a PostgreSQL database to keep trusted tokens and LPs lists
- Download the binary
- Run
chmod +x defiarb
- Copy the file in a $PATH directory (eg.
/usr/bin
) - [Customize configuration](#Config file)
-
Clone the repo
git clone ...
-
Install dependencies
go get ./...
-
[Customize configuration](#Config file)
Copy config.example.json
and edit it according to your needs:
NodeUrl
: bsc node URLContractAddress
: bsc node URLDb
: PostgreSQL db configHost
: DB host (default localhost)Port
: DB portDbName
: DB nameUser
: UsernamePassword
: Password
The arbitrage smart contract is in contracts/flash_loans
, deploy it with truffle migrate
and add the resulting address in config.json
.
Before starting the arbitrage bot the database should be updated:
- Update trusted tokens from trustwallet list with command
updateTokens
- Update LP tokens list for desired exchanges with command
scan [EXCHANGE_1 ... EXCHANGE_n]
(this command may take a long time to complete) - Run the arbitrage bot with
run
command
Run defiarb --help
for command list and defiarb [COMMAND] --help
for detailed command help
defiarb writeconfig [CONFIG_FILE.json]
defiarb updateTokens
defiarb scan [EXCHANGE_1 ... EXCHANGE_n]
defiarb run
The project was meant as a learning project, so it is not regularly maintained but any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request