Query editor
-- -- DPI/ETH Uni v3 Analytics: https://info.uniswap.org/#/pools/0x9359c87b38dd25192c5f2b07b351ac91c90e6ca7-- -- DPI/ETH Uni v2 Analytics: https://v2.info.uniswap.org/pair/0x4d5ef58aac27d99935e5b6b4a6778ff292059991-- -- DPI/ETH Uni v3: https://etherscan.io/address/0x9359c87b38dd25192c5f2b07b351ac91c90e6ca7-- -- DPI/ETH Uni v2: https://etherscan.io/address/0x4d5ef58aac27d99935e5b6b4a6778ff292059991-- ----- PROMPT ------- -- In August 2021, the Index Coop incentived (via a staking contract) the movement of liquidity from Uniswap v2 -> Uniswap v3 in order-- -- to take advantage of the increased capital efficiency of Uniswap v3. We are interested in analyzing this liquidity migration. This-- -- exercise is intended to introduce you to a few of the important events associated with adding or removing liquidity on Uniswap, as well-- -- as some initial data checks (via UNIONs).-- -- There are links above to the Uniswap v2 and v3 DPI/ETH pool analytics pages - those are interesting to explore. There are also links-- -- to the specific pool address (etherscan).-- -- Below, I have built out simple queries for the mint and burn events on Uniswap v2 and v3 DPI/ETH pools. Minting is done when you add liquidity-- -- and burning is when you remove liquidity. We have to join onto "ethereum.transactions" to actually get the address that is performing the action ("from").-- -- LP = liquidity provider-- -- Explore the events, and try and answer the prompts at the bottom using UNION, INTERSECT, EXCEPT-- ----- WORK ------- -- DPI, ETH, FWB (DAO token) DPI/ETH exists, FWB/ETH exists, DPI/FWB doesn't exist --why doesn't it make sense to have a DPI/FWB pool?-- -- v3 events-- WITH v3_mint AS (SELECTt."from" AS lp_address,m.*FROM uniswap_v3."Pair_evt_Mint" mLEFT JOIN ethereum.transactions t ON m.evt_tx_hash = t.hashWHERE contract_address = '\x9359c87b38dd25192c5f2b07b351ac91c90e6ca7'),v3_burn AS (SELECTt."from" AS lp_address,m.*FROM uniswap_v3."Pair_evt_Burn" mLEFT JOIN ethereum.transactions t ON m.evt_tx_hash = t.hashWHERE contract_address = '\x9359c87b38dd25192c5f2b07b351ac91c90e6ca7'),-- v2 eventsv2_mint AS (SELECTt."from" AS lp_address,m.*FROM uniswap_v2."Pair_evt_Mint" mLEFT JOIN ethereum.transactions t ON m.evt_tx_hash = t.hashWHERE contract_address = '\x4d5ef58aac27d99935e5b6b4a6778ff292059991'AND date_trunc('day', evt_block_time) >= '2021-04-01'