Set up your environment with the example repo
Fork this repo and then runnpm install -g frog
and npm install
to get all your packages. If you don’t have npm set up, then go download node js first. Once installations are finished, try running npm run dev
and it should take you to a localhost environment at http://localhost:5173/api.
Next, you’ll need to get a Dune API key from your user settings and set it in an .env
file. With that done, you’ll be able to run the frame - click “See From Your Followers” in your localhost environment.
Explaining the Dune API function
We call the Dune API in the/api/dune.ts
file in the getRecommendations(fid)
function defined here.
Below is the main API call, which makes a FILTER call on an existing result set. Using filters, we get our results in 20-30ms instead of reruning the whole query (which may take 10-20 seconds).