Day 8 (12 Days of Dune): Diversity of liquidity sources in USDC/WETH?
How concentrated are the LP positions in the pair? Are the holders contracts or wallets?
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.
Web3 Data Degens is a reader-supported publication. Posts are free, but I greatly appreciate your paid support as well :)
Welcome to day 8!
You can find the full explanation below (premiering with a live watch party at 9 am EST today).
Here are the main concepts:
Yesterday, we looked at just Mint and Burn events to get the total supply of the pair. Those events are actually just Transfer events to and from the 0x000.. address! So we can use the Transfer event for total supply calculations in the future.
All transfer events have the same signature (0xddf252…), so we (at Dune) have generalized them into an “erc20_ethereum.evt_Transfer” table that contains transfers for every single erc20 token on the chain. This is probably one of the tables you’ll use the most. It exists in erc721 and erc1155 (NFTs) forms as well, and also across all chains.
We calculate the balances of LP tokens similarly to the total supply, and then divide by the total supply to get the percentage of liquidity held.
We also added a LEFT JOIN on creation_traces to identify the holder address as a contract or an eoa/wallet. This is because some addresses with a high concentration of liquidity are actually “staking” contracts that reward LPs for providing liquidity to the pool. This is also known as “yield farming”. Our third top LP of USDC/WETH is the staking rewards Uniswap contract (at 9.3% of total liquidity).
Altogether you should get the charts below. The query is on Dune here.
Remember, if you found this question hard make sure to come to our office hours (2 PM EST) in our discord! Details are at the top of the email.
Tomorrow, we’ll be covering the question:
What is the percent liquidity of USDC or WETH held in this pair versus all other pairs?
As always, feel free to reach out to me here or on Twitter with any questions you might have.