Query editor
with day_supply AS (SELECTDATE_TRUNC('day', call_block_time) AS day,max(output_0)/ 1e18 AS total_supplyFROM opnx_ethereum.OpenExchangeToken_call_totalSupplygroup by DATE_TRUNC('day', call_block_time)),day_lasted_supply as(SELECTmax(output_0)/ 1e18 AS day_lasted_supplyFROM opnx_ethereum.OpenExchangeToken_call_totalSupply),day_price as(selectDATE_TRUNC('day', block_time) AS day,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),day_address_base as(SELECTaddress as address,day,sum(value) as cumulative_balancefrom(SELECTto AS address,DATE_TRUNC('day', evt_block_time) AS day,SUM(value / 1e18) AS valueFROM erc20_ethereum.evt_TransferWHEREcontract_address = 0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6fand "from" not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)and to not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)and DATE_TRUNC('day', evt_block_time) > date '2023-03-01'GROUP BY to , DATE_TRUNC('day', evt_block_time)union allSELECT"from" AS address,DATE_TRUNC('day', evt_block_time) AS day,-1 * SUM(value / 1e18) AS valueFROM erc20_ethereum.evt_TransferWHEREcontract_address = 0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6fand "from" not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)and to not in (0x28901cf869d94c9d892fbd86c8e57b801e8fdd87)