clone this repository to easily spin-up a farcaster bot that tracks a token.
currently supports erc20, some tweaks are needed to track erc721 and erc1155.
this repository was started for pointsbot, meaning that i tried to generalize it as much as possible, but you'll need to adapt the code a lil bit for whatever token you wanna track.
- catch "swap" events on a given uniswap pool and publishes it on farcaster (example cast) - by default the swap events tracked are between your token and $weth, but easy to replace $weth with something else
- catch direct "transfer" events between two addresses and publishes it on farcaster - publish only if one of the two addresses involved own a farcaster account
- publishes on farcaster hourly updates about token stats (market cap, volumes 24h, holders) (example cast)
- publishes updates every 2 hour about the top holders on farcaster (example cast)
- install packages with
bun install
(if u don't usebun
, u can still usenpm
oryarn
) - setup local env with
cp .env.tpl .env
and then populate your.env
- update src/constants/index.ts accordingly with your token details (address, symbol and decimals) - you can find those on https://etherscan.io/token/YOUR_TOKEN_ADDRESS
- deploy it somewhere - i used railway and created a simple service connected to my github repository, so that at each push it triggers a new deployment.
- go here to get airstack api key - airstack is used to get the leaderboard of holders on farcaster
- go here to get dextools api key - dextools is used to get token stats
- go here to get a farcaster signer uuid and api key - ofc used to publish casts on farcaster, you'll likely need to create a new account for your bot
- go here to get alchemy rpc url
- go here to setup your webhook - check this gist to understand how to structure the graphql query in order to filter the right events sent through your webhook
- add support erc721 and/or erc1155