Skip to content

Web3 SQL Weekly #1-9 (Bytexplorers🔍)

@twinfin@twinfin9 charts

This is an all-in-one query dashboard of the 🔍Bytexplorer Web3 SQL Weekly Series


📚The series was super helpful for me in getting used to onchain queries and Dune. I often revert back here to find which table to use and how to structure the query. Hope you find it useful as well!

They are forks of @ilemi's queries from the blog series, and i updated the bonus questions and the deprecated queries. I added notes on what I have learned on the side.

Feedback welcomed😃 @twinFin22

Web3 SQL Weekly #7: Cohort Retention for Opensea and Other NFT Marketplaces

  • table: nft.trades

CTEs

  1. Get all seller/buyer addy and assign to a cohort : SELECT min(month) as cohort, user GROUP BY 2
  2. Get total size of cohort : SELECT count(*) as total_size , cohort GROUP BY 2
  3. For each month after the cohort month, find how many are still using : row_number() over (partition by cohort order by month asc) as months GROUP BY cohort, month
  4. Create {months : Retention%} dict per cohort and pivot the table using the key-pair

Web3 SQL Weekly #8: Analyzing Account Abstraction (ERC-4337)

  • table: erc4337_polygon.EntryPoint_v0_6_call_innerHandleOp
  • JOIN polygon.traces ON cardinality(t.trace_address) > 3
  • "it takes at least depth of 4 for user ops to be sent"
  • EntryPoint: Receives user ops and performs initial validation checks, and forwards user ops to the user's smart account contract.