Query editor
/* Migration success :)There are some cases such as unnest/sequence and array/json functions the migrator won't take care of for you(but we have examples of in the docs linked below!)If you're still running into issues, check out the doc examples https://dune.com/docs/reference/dune-v2/query-engine/or reach out to us in the Dune discord in the #dune-sql channel.*//* !Bytea parameter warning: Make sure to change \x to 0x in the parameters, bytea types are native now (no need for quotes or lower or \x)' */SELECTCOUNT(DISTINCT minter) AS num_mintersFROM(SELECTminter,num_mintedFROM(SELECTet."from" AS minter,COUNT(et."from") AS num_minted,AVG(CAST(et.value AS DOUBLE) - CASEWHEN CAST(et.value AS DOUBLE) IS NULL THEN 0ELSE CAST(et.value AS DOUBLE)END) AS total_eth_paidFROMarbitrum.transactions AS etLEFT JOIN (SELECT*FROMerc721_arbitrum.evt_TransferWHEREcontract_address = 0xa3AaCc343614b71f6e5fD12bD9A5b17587F0DAAdAND "from" = 0x0000000000000000000000000000000000000000) AS transfers ON et.hash = transfers.evt_tx_hashLEFT JOIN (SELECT*FROMarbitrum.tracesWHERE"from" = 0xa3AaCc343614b71f6e5fD12bD9A5b17587F0DAAdAND "success") AS refunds ON et.hash = refunds.tx_hashAND et."from" = refunds."to"WHEREet."to" = 0xa3AaCc343614b71f6e5fD12bD9A5b17587F0DAAdAND et.successAND CAST(et.value AS DOUBLE) > 0GROUP BY1) AS mints) AS minters