Query editor
WITH staking_events AS (SELECTDATE_TRUNC('day', sm.evt_block_time) AS date,sm."to" as staker,sm.evt_tx_hash,CAST(sm.value AS DECIMAL(38,0)) / 1e18 as stprove_amount,CAST(prove_tx.value AS DECIMAL(38,0)) / 1e18 as prove_amountFROM erc20_ethereum.evt_Transfer smJOIN erc20_ethereum.evt_Transfer ipt ON sm.evt_tx_hash = ipt.evt_tx_hashJOIN erc20_ethereum.evt_Transfer prove_tx ON sm.evt_tx_hash = prove_tx.evt_tx_hashWHERE sm.contract_address = 0x59A2d7b0421bA13F57bF012f46C58ab5a65B1d3CAND sm."from" = 0x0000000000000000000000000000000000000000AND ipt.contract_address = 0x04ece2a2c3ea68356274f37c096258c7a9e72fa1AND ipt."to" = 0x4eac32f0a25ea9d7f22d1aa40735cb761c672bd6AND prove_tx.contract_address = 0x6bef15d938d4e72056ac92ea4bdd0d76b1c4ad29AND prove_tx."to" = 0x04ece2a2c3ea68356274f37c096258c7a9e72fa1),unstaking_cooldown AS (SELECTDATE_TRUNC('day', evt_block_time) AS date,"from" as staker,evt_tx_hash,CAST(value AS DECIMAL(38,0)) / 1e18 as stprove_burnedFROM erc20_ethereum.evt_TransferWHERE contract_address = 0x59A2d7b0421bA13F57bF012f46C58ab5a65B1d3CAND "to" = 0x0000000000000000000000000000000000000000AND "from" != 0x0000000000000000000000000000000000000000),withdrawals_completed AS (SELECTDATE_TRUNC('day', evt_block_time) AS date,"to" as staker,evt_tx_hash,CAST(value AS DECIMAL(38,0)) / 1e18 as prove_withdrawnFROM erc20_ethereum.evt_TransferWHERE contract_address = 0x6bef15d938d4e72056ac92ea4bdd0d76b1c4ad29AND "from" = 0x04ece2a2c3ea68356274f37c096258c7a9e72fa1AND "to" != 0x04ece2a2c3ea68356274f37c096258c7a9e72fa1AND "to" != 0x0000000000000000000000000000000000000000),daily_prices AS (SELECTDATE_TRUNC('day', block_time) as date,AVG(CASEWHEN token_bought_address = 0x6bef15d938d4e72056ac92ea4bdd0d76b1c4ad29THEN amount_usd / NULLIF(token_bought_amount, 0)WHEN token_sold_address = 0x6bef15d938d4e72056ac92ea4bdd0d76b1c4ad29THEN amount_usd / NULLIF(token_sold_amount, 0)END) as daily_avg_priceFROM dex.tradesWHERE project_contract_address IN (0x7aed0a7bf286abc736959fd42acc27d80b0507d6d3053755359ae459ac27743f, -- PROVE/USDC0xf6d500fc33e0865ff1c1c6c58a2c9e247db2e5df007c080f6664a9375f374ff1, -- PROVE/USDT0xc76cdb74d781e219e8c8855a99584dd2e4580046 -- PROVE/WETH)AND blockchain = 'ethereum'AND (token_bought_address = 0x6bef15d938d4e72056ac92ea4bdd0d76b1c4ad29OR token_sold_address = 0x6bef15d938d4e72056ac92ea4bdd0d76b1c4ad29)AND amount_usd > 100GROUP BY 1