Skip to content

Latest commit

 

History

History
103 lines (55 loc) · 7.46 KB

File metadata and controls

103 lines (55 loc) · 7.46 KB

PoolTogether v5 Prize Claimer Bot - GitHub Actions

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 Prize Claimer 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 / deploy this bot


Installation:

Watch the 1-minute video, or:

  1. Fork this repository
  2. Set your environment variables
  3. Enable automated workflows
  4. View logs
  5. (Optional) Change Chain or Reward Recipient

Note: This process is essentially the same for the Draw Auction and Liquidator bots as well.


1. Fork this repository

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:

Fork / deploy this bot

2. Set your environment variables

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: BASE_MAINNET_JSON_RPC_URL, ARBITRUM_MAINNET_JSON_RPC_URL, OPTIMISM_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/

3. Enable automated workflows

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.

4. View logs

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.

5. (Optional) Change Chain, Minimum Profit Threshold (in USD$) or Reward Recipient:

In the .github/workflows/cron.yml file you can update the following variables: CHAIN_ID, MIN_PROFIT_THRESHOLD_USD, and/or REWARD_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/
MIN_PROFIT_THRESHOLD_USD: This is in $USD, so 0.1 would be $0.10 per transaction
REWARD_RECIPIENT: Any typical account address, if left blank this will default to the relayer account set by the CUSTOM_RELAYER_PRIVATE_KEY variable.

Lastly:

The Prize Claimer bot's relayer account needs to be stocked with ETH to pay gas fees to send transactions. We recommend keeping less than $100 in value on the relayer at a time in case your private key were to get compromised.