The DCA Automator creates smart contracts in Ethereum that deposit periodically an amount of ETH or ERC20 tokens in a liquidity pool.
Start by downloading the project.
$ git clone https://github.com/fabiodmferreira/dca-automator.git
$ cd dca-automator
Enter smart contracts directory.
$ cd smart-contracts
Install dependencies
$ npm install
Set INFURA_ID
in your system environment variables or create the .env
with next content.
INFURA_ID=<your infura node id>
Run the Buidler's testing network.
npm run launch-node
On a new terminal, go to smart-contracts
directory and deploy the contracts.
npm run deploy-contracts
The deploy scripts added the contracts addresses and the ABI files to client/src/contracts
and keeper/contracts
, so they can interact with the contracts deployed.
Make sure you have Metamask installed.
Enter client directory.
$ cd client
Install dependencies.
$ npm install
Run the client server.
$ npm start
It will popup a tab in your browser with the url http://localhost:3000
. Here you will have to connect with your metamask account and you will be able to create your smart contracts that will deposit tokens in Aave liquidity pools.
Note: Metamask may popup an invalid nonce error the first time you sign a transaction. Reset your account in Metamask settings (Settings > Advanced > Reset Account
) to fix this issue. The nonce cached will be reset.
The keeper is a daemon service that inspects for dca contracts that allow to transfer tokens to the liquidity pools.
Enter keeper directory.
$ cd keeper
Install dependencies.
$ npm install
Run the keeper.
$ npm start