DISCLAIMER: These bots are meant for intermediates & experts to run and modify to their liking. There is a lot of prerequisite knowledge about blockchains, private keys, swaps, and GitHub infrastructure that should be known before running a bot. If anyone ever asks you for your private key do not give it to them. Nobody from Generation Software, Pooltime, or PoolTogether will ever ask you for your private key.
This repo contains two simple scripts (index.ts and .github/workflows/cron.yml) to run the Generation Software PoolTogether v5 Liquidator bot using GitHub Actions.
You can simply fork this repo, enter your own custom environment variables in your newly-forked GitHub Repository's Settings (Settings
-> Secrets and variables
-> Actions
-> New repository secret
), and enable automated workflow runs.
Note: You require your own GitHub account to fork this repository and run the GitHub Actions.
- Fork this repository
- Set your environment variables
- Enable automated workflows
- View logs
- (Optional) Change Chain or Reward Recipient
Note: This process is essentially the same for the Prize Claimer and Draw Auction bots as well.
Start by forking this bot to your own new repository - this essentially deploys your very own copy of the bot. You can give it a custom name if you like:
Once the repository has been forked you can update your Secrets
(under Settings
) to point to your own API keys. Each bot requires 2 secrets: a private key which will send transactions on your bot's behalf, and a RPC URL such as one from Infura or Alchemy.
JSON_RPC_URL
: We will need JSON_RPC_URLs for each network you want to use. The following are required for each network you want the bot to run against: ETHEREUM_MAINNET_JSON_RPC_URL
, BASE_MAINNET_JSON_RPC_URL
, ARBITRUM_MAINNET_JSON_RPC_URL
, OPTIMISM_MAINNET_JSON_RPC_URL
, SCROLL_MAINNET_JSON_RPC_URL
, GNOSIS_MAINNET_JSON_RPC_URL
.
CUSTOM_RELAYER_PRIVATE_KEY
: We recommend creating a brand new EVM account and only sending a small amount of ETH (less than $100) to it for relaying your bot transactions. In the rare case that the account gets compromised you will only lose whatever ETH is currently in it.
COVALENT_API_KEY
: a Covalent API key is needed to assist the bot in looking up dollar values of tokens. You can register for a free API key here: https://www.covalenthq.com/platform/auth/register/
By default, GitHub does not enable automated workflows for newly forked repositories. Navigate to the Actions
tab to enable workflows on your newly forked repository:
Click 'I understand my workflows, go ahead and enable them'
Important! Click the little 'Enable workflow' button in the top-right corner
You should see the success message above.
To see if the bot is working correctly, check the logs under Actions
. You may need to wait 5 - 10 minutes for the first scheduled task to show up. Following that, the bot will attempt to run every 5 minutes. However, GitHub may throttle the amount of runs based on how overloaded GitHub Actions is at that time.
Click the name of the run to see the logs. For instance, one of my runs is simply named "Cronjob". I can open that up, then click on the "Run bot" line to see the outcome of the bot.
In the .github/workflows/cron.yml file you can update the following variables: CHAIN_ID
, MIN_PROFIT_THRESHOLD_USD
, and/or SWAP_RECIPIENT
. This will allow you to change which chain you are running the bot against, how much profit you want to make per transaction, and who (which EVM EOA account) receives the profits earned.
CHAIN_ID
: Simply the chain ID. You can find most chain ID's on https://chainlist.org/
SWAP_RECIPIENT
: Any typical account address, if left blank this will default to the relayer account set by the CUSTOM_RELAYER_PRIVATE_KEY
variable.
The Liquidator bot's relayer account needs to be stocked with ETH (to pay gas fees for transactions) and WETH to liquidate. We recommend keeping less than $100 in value on the relayer at a time in case your private key were to get compromised.