Day 1 (12 Days of Dune): Finding all pairs for ERC20 tokens in Uniswap v2
Covering the basics of ERC20 tokens and the Uniswap v2 factory contract
(if you missed the original course announcement, read that first)
Welcome to day 1!
We’ll be answering questions and covering more beginner-focused concepts during office hours at 2pm EST, so join us in the #12-days-of-dune discord channel. You’ll need to earn the course NFT and connect to the Dune guild.
Today, we covered an example transaction of a pair being created from the factory, the basics of the ERC20 token USDC, and a few queries exploring pair creation trends. You can find the full explanation below, and the query is on Dune here.
This first query is very short, so focus on understanding how the contracts map to the tables we queried. If you don’t understand, check out the quickstart dashboard and click through different function and event examples (highlighted as blue text in tables). Looking through the dashboard and etherscan will be the easiest way to get an intuition for the EVM <> Dune table relationships.
SQL-wise, you’ll need to understand how SELECT, FROM, WHERE, and COUNT(*) work. If you get lost in the SQL, check out the tutorials on all concepts here. The easiest way to pick up SQL concepts is to fork the query and change things one line at a time.
Tomorrow, we’ll be covering the question:
“How many swaps per week, and what are the total volumes of these swaps (in USD) for USDC/WETH?
As always, feel free to reach out to me here or on Twitter with any questions you might have.