Query editor
withlock AS (SELECTprovider,evt_block_time,value/1e18 AS value,DATE_FORMAT(evt_block_time, '%Y-%m-%d %H') as evt_block_time_hour,DATE_FORMAT(evt_block_time, '%Y-%m-%d') as evt_block_time_dayFROMopnx_ethereum.VotingEscrow_evt_DepositWHEREdeposit_type = 1OR deposit_type = 2GROUP BY1,2,3-- union all-- select "from" as provider,-- call_block_time as evt_block_time,-- _value/1e18 as value-- from opnx_ethereum.VotingEscrow_call_increase_amount a-- left join erc20_ethereum.evt_Transfer b-- on a.call_tx_hash = b.evt_tx_hash-- where a.call_success = true-- group by 1,2,3),unlocktime AS (SELECTprovider,max(locktime) as unlock_time_unixtime,from_unixtime(cast(max(locktime) AS double)) AS unlock_timeFROMopnx_ethereum.VotingEscrow_evt_DepositGROUP BYprovider),day_price as(selectDATE_FORMAT(block_time, '%Y-%m-%d') as day_time,sum(amount_usd) / sum(token_sold_amount) as day_pricefrom dex.tradeswhere block_date > date '2023-03-01'and blockchain = 'ethereum'and project_contract_address = 0x2cad29e9640b9bcfb1d8d25cf3e4bd05f55cce70 -- OX/WETH Pooland token_sold_symbol = 'OX'group by 1),hour_price as(selectDATE_FORMAT(block_time, '%Y-%m-%d %H') as hour_time,sum(amount_usd) / sum(token_sold_amount) as hour_pricefrom dex.tradeswhere block_date > date '2023-03-01'and blockchain = 'ethereum'