Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/WITHliqudity_additions AS(SELECTdate_trunc('week', evt_block_time) AS week,COUNT(tx."from") as minters,COUNT(distinct(tx."from")) as unique_minters,arbitrary(evt_tx_hash),SUM(cast(amount0 AS DOUBLE)/1e6) AS USDC_added,SUM(CAST(amount1 AS DOUBLE)/1e18) AS ETH_addedFROM uniswap_v2_ethereum.Pair_evt_Mint AS mLEFT JOIN ethereum.transactions tx ON m.evt_tx_hash = tx.hashWHERE contract_address = {{pair_address}}AND evt_block_time > TIMESTAMP '{{startdate}}'GROUP BY 1),liqudity_removes AS(SELECTdate_trunc('week', evt_block_time) AS week,arbitrary(evt_tx_hash),(COUNT(distinct(tx."from"))*-1) as unique_burners,(COUNT(tx."from")*-1) as burners,SUM(cast(amount0 AS DOUBLE)/-1e6) AS USDC_removed,SUM(CAST(amount1 AS DOUBLE)/-1e18) AS ETH_removedFROM uniswap_v2_ethereum.Pair_evt_Burn AS bLEFT JOIN ethereum.transactions tx ON b.evt_tx_hash = tx.hashWHERE contract_address = {{pair_address}}AND evt_block_time > TIMESTAMP '{{startdate}}'GROUP BY 1),--- after this line for answering bonus_question I wrote queries seperately than merged themmain1 as(withtable1 as (SELECTevt_block_time AS time_,tx."from" as users,tx.hash AS hashFROM uniswap_v2_ethereum.Pair_evt_Mint AS mLEFT JOIN ethereum.transactions tx ON m.evt_tx_hash = tx.hashWHERE contract_address = {{pair_address}}AND evt_block_time > TIMESTAMP '{{startdate}}' ) --table1select * from table1 wherehash in (Select max(hash) FROM table1 group by users) -- -- by this line, we are selecting users who has made 2 or more transactions),main2 as (SELECTevt_block_time AS time_,tx."from" as users,tx.hash AS hashFROM uniswap_v2_ethereum.Pair_evt_Mint AS m