Automated bot to purchase 0.25 AVAX worth of HERESY tokens daily via Trader Joe (LFJ.gg) on Avalanche.
- Daily TWAP Purchase: Executes a time-weighted average price swap of 0.25 AVAX → HERESY every 24 hours.
- Heroku-Ready: One-click deploy to Heroku with scheduler integration.
- Zero Slippage Tolerance: Accepts any output to guarantee execution.
- Simple Configuration: Use environment variables for all secrets and addresses.
- Git
- Python 3.8+
- Heroku CLI (for deployment)
-
Clone the repository
git clone https://github.com/wrathtank/AD_HeresyTWAP.git cd AD_HeresyTWAP -
Install dependencies
pip install -r requirements.txt
-
Create a
.envfile at the project root:AVAX_RPC_URL=https://api.avax.network/ext/bc/C/rpc BOT_PRIVATE_KEY=0xYOUR_PRIVATE_KEY WAVAX_ADDRESS=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7 HERESY_ADDRESS=0x432d38F83a50EC77C409D086e97448794cf76dCF JOE_ROUTER=0x60ae616a2155ee3d9a68541ba4544862310933d4
-
Deploy to Heroku
heroku create adheresytwap git push heroku main
-
Configure environment variables on Heroku
heroku config:set AVAX_RPC_URL="https://api.avax.network/ext/bc/C/rpc" \ BOT_PRIVATE_KEY="0xYOUR_PRIVATE_KEY" \ WAVAX_ADDRESS="0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7" \ HERESY_ADDRESS="0x432d38F83a50EC77C409D086e97448794cf76dCF" \ JOE_ROUTER="0x60ae616a2155ee3d9a68541ba4544862310933d4" \ --app adheresytwap
-
Test the bot
heroku run python buy_heresy.py --app adheresytwap
-
Schedule daily execution
- In the Heroku Dashboard, under Resources, add Heroku Scheduler.
- Create a new job:
- Command:
python buy_heresy.py - Frequency: Daily
- Next due: pick your preferred UTC time
- Command:
Once scheduled, the bot will run daily and print a log line:
🔄 Swap TX → https://snowtrace.io/tx/<txHash>
You can verify each transaction on SnowTrace.
Feel free to open issues or pull requests for improvements or bug fixes.
Credit: Developed by The City, LLC.