├── README.md └── analyst ├── answers.md ├── basic_practice.md └── diagrams └── tx_explained.jpg /README.md: -------------------------------------------------------------------------------- 1 | # web3-data-practice 2 | This repo is for practice questions for on-chain data analysis, engineering, and science in Web3. 3 | 4 | The organization of this repo will probably change a lot as we figure it out, but we'll start simple with just one folder and questions list 5 | 6 | The personal tg group I'm running for this requires you to apply [here](https://ilemi.pallet.com/talent), but feel free to talk in the discussions tab. I'll livestream every Sunday at 10 EST to go over weekly questions and other web3 data stuff - follow along on [twitter](https://twitter.com/andrewhong5297) and [youtube](https://www.youtube.com/channel/UCYG9WSr8G4khYLaxP9tLCkQ) for updates! :) 7 | 8 | ``` 9 | analyst 10 | | 11 | | basic_practice.md 12 | | answers.md 13 | ``` 14 | -------------------------------------------------------------------------------- /analyst/answers.md: -------------------------------------------------------------------------------- 1 | go to github discussions first :) -------------------------------------------------------------------------------- /analyst/basic_practice.md: -------------------------------------------------------------------------------- 1 | ### Data Analyst Practice Questions: 2 | 3 | It is my opinion that you should be able to answer all of these questions to be a competent web3 analyst. 4 | 5 | Some notes before you get started: 6 | 7 | 1. These questions assume you already have some SQL background. 8 | 2. Bonus questions (and some hints) are within the toggles. 9 | 3. “Using `x.table` ” just means this is the existing Dune table you should use (if you’re using Dune). All queries are to be made on Ethereum mainnet tables. 10 | 11 | 17 | 18 | 1. calculate the total ETH transfer value by block in the last week using `ethereum.transactions` and `ethereum.traces`. Why are the values different? 19 | - bonus question: can you figure out what was the cause of the largest difference between tables where traces > txs value? 20 | 2. look at an [example transaction](https://etherscan.io/tx/0xfa8aac1b4d50952f7cc711cd3959c05968ade2e538639c9555c5aa0d0fa6e76d) (of a token swap) using only `ethereum.transactions` and `ethereum.traces` tables. Don’t worry about understanding the protocol, just answer the following questions: 21 | - [diagram explaining every part of a tx on etherscan](https://github.com/andrewhong5297/web3-data-practice/blob/main/analyst/diagrams/tx_explained.jpg) 22 | - bonus question: how much gas was used in this swap? 23 | - hint on how gas breaks down 24 | - [reading resource](https://www.blocknative.com/blog/eip-1559-fees#:~:text=The%20New%20Terminology%20of%20EIP%2D1559%20Transactions&text=Instead%20of%20a%20singular%20Gas,is%20paid%20directly%20to%20miners.) 25 | - bonus question: how many contracts were involved? 26 | - bonus question: how do you remove double counts of proxy contracts? hint: lookup delegate calls (don’t confuse `type` and `call_type`!) 27 | - bonus question: how many of these contracts are under the same namespace on Dune (i.e. uniswap, mirror, aave)? 28 | 3. find all the new DEX pairs created in the first month the [Uniswap V2 factory was deployed](https://docs.uniswap.org/protocol/V2/reference/smart-contracts/factory). 29 | - Bonus question: find each pair’s DEX volume, grouped by month. 30 | 4. how can you figure out quickly which logs or functions to look at? Try and find the Uniswap V2 Pair contract for USDC/ETH. Run the analysis across `ethereum.logs`, `ethereum.transactions`, and `ethereum.traces`. 31 | - I have a list of utility queries out there somewhere with the answer to this one. Wonder if you can find them? 🙂 32 | - bonus question: given some namespace in `ethereum.contracts`, can you figure out what order users usually call functions in? 33 | - bonus question: you'll notice that there are more LP transfer events than total minting + burning events. Why are LP tokens being transferred so often (hint: yield farming)? 34 | 5. what’s an ERC20 token standard and how can you find a `transfer` event or function call? 35 | - hint: keccak256 hash for transfer event `Transfer(address,address,uint256)` 36 | - [https://emn178.github.io/online-tools/keccak_256.html](https://emn178.github.io/online-tools/keccak_256.html) 37 | - bonus question: look at the COMP token, and examine the distribution of delegations. 38 | - compare this delegation across governance proposals (look for the Governor Bravo and Alpha contracts). Were there any periods of large voting power swings? 39 | 6. how can you calculate ERC20 balances (use **USDC**) using events? Who are the top 100 holders? Use `ethereum.logs` and then `erc20.ERC20_evt_Transfer` table. 40 | - bonus question: how many times are there `approval` calls before a `transfer` call? 41 | - bonus question: calculate rebase for stETH? 42 | - bonus bonus question: why does Curve work but Uniswap doesn't for ETH/stETH rebase balances? 43 | 7. how do you find someone’s LP balance and historical change in representation in the Uniswap v2 USDC/ETH pool? 44 | - bonus question: find the top 100 holders of USDC by adding raw balances (from last question) and liquidity pair balances together. 45 | - bonus bonus question: can you generalize this to all USDC pairs in Uniswap? hint: find all pairs that have USDC as either token0 or token1 first. 46 | - bonus question: find the top 100 holders of USDC across as many wrappers as you can! Who holds the most # of unique wrappers? hint: has to do with how wrappers manage symbols ;) 47 | 8. Figure out LP impermanent loss from USDC/ETH pool! hint: check their balances over time versus their share of USDC or ETH in the pool. 48 | 9. What’s the historical DEX trading share of USDC/ETH by DEX protocol (not incl aggregators) using `dex.trades`? 49 | - bonus question: find the inflection points where shares drastically changed. What were the governance proposals that went through during that time? 50 | 10. what are the top 100 NFT contracts spent the most gas to mint (before April 25th, 2022) using any combination of tables? 51 | - bonus question: same question but filter for failed transactions only 52 | 11. how to calculate the floor price of NFTs based on recent sales (using just OpenSea data)? 53 | - bonus question: which collection has the maximum difference when you use daily sale minimum versus percentile? 54 | - bonus question: how do trends compare using 1 day, 1 week, and 1 month averages? 55 | - bonus question: fractional trading price as NFT token value? 56 | 12. NFT trading share over time of BAYC (by the marketplace) using `nft.trades`? 57 | -------------------------------------------------------------------------------- /analyst/diagrams/tx_explained.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andrewhong5297/web3-data-practice/56fc9a4c9dadac92ecc1a571487249f70a3c9e40/analyst/diagrams/tx_explained.jpg --------------------------------------------------------------------------------