Query editor
-- SELECT * FROM contracts.ethereum limit 10-- select namespace, name, address, factory-- from ethereum.contracts-- where address = 0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2fwith gho_supply_changes_ as (SELECT *,case when "from" = 0x0000000000000000000000000000000000000000 then cast(value as double)when to = 0x0000000000000000000000000000000000000000 then -cast(value as double)end as change, case when "from" = 0x0000000000000000000000000000000000000000 then cast(value as double) END AS minted, case when to = 0x0000000000000000000000000000000000000000 then cast(value as double) END AS burnedFROM gho_ethereum.GhoToken_evt_TransferWHERE ("from" = 0x0000000000000000000000000000000000000000) or (to = 0x0000000000000000000000000000000000000000)),gho_supply_changes as (SELECT date_Trunc('day', evt_block_time) as dt,sum(change)/pow(10,18) as supply_change,sum(minted)/pow(10,18) as minted,sum(burned)/pow(10,18) as burned,-sum(burned)/pow(10,18) as burned_negative,count(minted) as mints,count(burned) as burnsFROM gho_supply_changes_GROUP BY date_Trunc('day', evt_block_time)ORDER BY date_Trunc('day', evt_block_time) desc),gho_velocity as (SELECTdt,daily_sends,SUM(daily_sends) OVER (ORDER BY dtROWS BETWEEN 6 PRECEDING AND CURRENT ROW) as weekly_sendsFROM (SELECTdate_Trunc('day', evt_block_time) as dt,SUM(value) as daily_sendsFROM gho_ethereum.GhoToken_evt_TransferGROUP BY date_Trunc('day', evt_block_time)) tORDER BY dt),result as (SELECT gho_supply_changes.*,sum(gho_supply_changes.supply_change) over(order by gho_supply_changes.dt) as total_supply,cast(gho_velocity.daily_sends as double) / pow(10,18) as daily_volume,cast(gho_velocity.weekly_sends as double) / pow(10,18) as weekly_volume-- ,(cast(gho_velocity.daily_sends as double)/ pow(10,18))FROM gho_supply_changesLEFT JOIN gho_velocityON gho_velocity.dt = gho_supply_changes.dtorder by dt desc)SELECT *,