java-defi-bot is an application that aims to do beneficial actions on the Ethereum blockchain for the DeFi ecosystem while earning a profit for the user. These actions include maintaining the DAI peg, providing liquidity and liquidating undercollateralized assets.
- Java such as Oracle Java
$ echo $JAVA_HOME
C:\Program Files\Java\jdk-14.0.1
-
Connection to Ethereum Network
Alternatives:
-
Ethereum Wallet as keystore file including password from services such as MyEtherWallet
$ mvn -version
Apache Maven 3.6.3
mvn install
- Update the configuration file
./config.properties
infuraProjectId=
password=
wallet=
transactionsRequireConfirmation=true
playSoundOnTransaction=true
uniswapBuyProfitPercentage=0.5
uniswapSellProfitPercentage=0.5
minimumEthereumReserveUpperLimit=0.20
minimumEthereumReserveLowerLimit=0.10
minimumEthereumNecessaryForSale=1.0
minimumDaiNecessaryForSaleAndLending=250.0
minimumFlipAuctionProfit=50.0
minimumGasPrice=1000000000
maximumGasPrice=30000000000
testProperty=true
Make sure to never commit your config.properties
file!
- Make git stop tracking your config file
git update-index --skip-worktree ./config.properties
- Make git start tracking your config file again
git update-index --no-skip-worktree ./config.properties
mvn clean compile assembly:single
- All Tests
mvn clean test
- Unit Tests
mvn clean test -DskipITs
- Integration Tests
mvn clean failsafe:integration-test
- Either just run it in the IDE of your choice
- or execute the compiled application
java -jar java-defi-bot-0.1-jar-with-dependencies.jar
and make sure it has access to theconfig.properties
file
You will find the logs in ./logs
.
- sells DAI, if DAI > $1.00 on Oasis
oasis.checkIfSellDaiIsProfitableThenDoIt(balances);
- buys DAI, if DAI < $1.00 on Oasis
oasis.checkIfBuyDaiIsProfitableThenDoIt(balances);
- sells DAI, if DAI > $1.00 on Uniswap
uniswap.checkIfSellDaiIsProfitableThenDoIt(balances);
- buys DAI, if DAI < $1.00 on Uniswap
uniswap.checkIfBuyDaiIsProfitableThenDoIt(balances);
- earns interest on Compound, if there has been no market action for a while
compoundDai.lendDai(balances);
- bids on flip auctions, if the auctions offer cheaper ETH
flipper.checkIfThereAreProfitableFlipAuctions(balances);
Feel free to open merge requests.
- Code Style: Google Java Format
- Linting: Sonarlint
- Add new smart contracts: web3j
- Logging: SLF4J + logback is used as defined in
./src/main/resources/logback.xml
- Update Maven Dependencies:
mvn versions:use-latest-versions
- Show updatable dependencies:
mvn versions:display-dependency-updates
- Show unused dependencies:
mvn dependency:analyze
- MakerDAO Documentation
- Web3j Documentation
- Compound Documentation
- DAI Stats
- ETH Gas Station
- DAI Peg: DAI Descipher
- DAI Peg: DAI Stablecoin
- Loanscan
- Flip auctions
This project is licensed under the MIT License - see the LICENSE file for details