My first test project on Aptos! Simple Bot to Restake tokens every 24h on PCS. Thus creating compound interest.
- Call the function to receive all rewards (every 24h)
- Get the account's current balance of CAKE tokens
- Swap all CAKE rewards received to APT tokens
- Add appropriate amounts of tokens to the LP
- Get the account's balance of LP tokens
- Deposit the LP tokens into the LP farm
You will need to create a file called .env in the root directory, copy the text in .env.example and fill in the variables
You could run it on your desktop just using Node.js in your terminal. However, on a production environment, it is recommended to use something like PM2 to run the processes to ensure robust uptime and management.
## Because we want to run with PM2
## So we need to transpile to JS
npm install
cd src
npx tsc
pm2 start src/index.js -n "APT"
pm2 save