This bot was created for autocompounding the JEWEL-ONE Farm (PID 0).
You can use this code and extend it for your own personal use. This is not production ready code. Please be very careful with your private key and never push it to a public repository. It's advised that you use an account that doesn't have all your funds attached to it.
- You have a computer that runs 24/7 with Node JS installed
- MAC users
- Install node via brew (click here to learn how to install brew
brew install node
- Windows users
- Install node.js (from here).
- Linux users
sudo apt install nodejs
- MAC users
- You have money in the OpenSwap 100% validator or single staking oSwap LP pool earning oSwap as a reward
- You have Harmony ONE to pay gas fees in your wallet
Open a terminal and run the following to download and install pre-requesites for running the bot:
git clone https://github.com/FrescoFlacko/dfk-autocompounder.git
cd dfk-autocompounder
npm install
- copy env_sample to a new file (.env) and enter your Polygon RPC URL and the private key of the account that currently has its LP in the oSwap farm
cp env_sample .env
- make sure that the
.env
file is in the.gitignore
file (it is by default, see Environment Variables below) - Optional: if you would like to keep the bot running on your system if you close your terminal or get disconnected, you can use tmux
tmux new -s openswap
to start a new tmux session.- use
ctrl+b d
to leave the session running but exit. - use
tmux attach
to reconnect to the openswap session.
- use
Now you're ready to run the openswap auto compounding bot, go to your dfk-autocompounder
folder and run:
node index
To update any recent changes to the bot, run the following command. Then verify the env_example matches your .env file post upgrade (things may be added or moved still):
git pull
Copy env_sample to .env & fill in with your settings. Here's our notes:
- RPC_URL="https://a.api.s0.t.hmny.io"
- Can get a list of RPC URL's from https://api.hmny.io/
- PRIVATE_KEY=XXXXXXXXXXXXXXXXXXXXXXXXX
- Your Harmony ONE Wallet Private Key (Export from wallet)
- JEWEL_TOKEN_ADDRESS="0x72Cb10C6bfA5624dD07Ef608027E366bd690048F"
- This is the address for Jewel Token
- WONE_TOKEN_ADDRESS="0xcf664087a5bb0237a0bad6742852ec6c8d69a27a"
- This is the address for Wrapped ONE Token
- WALLET_ADDRESS="0xXXXXX"
- Your harmony wallet address
- FARM_PID=0
- Farm PID - Get from vfat.tools pool
- MASTERGARDENER_CONTRACT = "0xDB30643c71aC9e2122cA0341ED77d09D5f99Fs924"
- Contract for interacting with the Garden
- UNISWAP_FACTORY_ADDRESS="0x24ad62502d1C652Cc7684081169D04896aC20f30"
- Contract for swapping / adding liquidity
- Inspired by @easy-node-one project oswap_single_lp_bot