Query editor
/* Metakey daily sales and number of transactions *//* query in progress. need to check/control for metakey versions; explore data and see if it checks out/look for edge cases *//* adapted from BAYC query by @rechase */WITHtoken AS (SELECTcall_tx_hash AS tx_hash,/* select the transaction hash when the address in place 5 indicates was the target contract; control for wrapped ether */ CASEWHEN addrs[7] = 0x0000000000000000000000000000000000000000 THEN 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 /* wrapped ether contract */ELSE addrs[7]END AS token_addressFROMopensea_ethereum.WyvernExchange_call_atomicMatch_ AS aWHEREaddrs[5] = 0x10DaA9f4c0F985430fdE4959adB2c791ef2CCF83 /* Metakey contract */)SELECTDATE_TRUNC('day', evt_block_time) AS DAY,SUM((om.price / CAST(POWER(10, erc.decimals) AS DOUBLE)) * p.price) AS usd_volume--,--COUNT(*) AS transactions /* ,AVG(om.price / 10^erc.decimals) AS "Avg_usd" */FROMopensea_ethereum.WyvernExchange_evt_OrdersMatched AS omINNER JOIN token ON token.tx_hash = om.evt_tx_hashINNER JOIN tokens.erc20 AS erc ON token.token_address = erc.contract_address /* swap? */INNER JOIN prices.usd AS p ON p.minute = DATE_TRUNC('minute', evt_block_time)AND token.token_address = p.contract_addressAND DATE_TRUNC('month', p.minute) >= CAST('2021-05-04' AS TIMESTAMP)WHEREp.blockchain = 'ethereum'AND erc.blockchain = 'ethereum'GROUP BY1ORDER BY1