Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/with capacity as (-- Capacity Reset (Wall Up)select evt_block_time, high_,case when high_ = false then cast(capacity_ as double)/1e18else cast(capacity_ as double)/1e9 end as capacityfrom olympusdao_ethereum.OlympusRange_evt_WallUpwhere high_ = falseunion all-- Capacity Gone (Wall Down)select evt_block_time, high_,0 as capacityfrom olympusdao_ethereum.OlympusRange_evt_WallDownunion all-- Capacity Change due to Swap or Bondselect call_block_time, high_,case when high_ = false then cast(capacity_ as double)/1e18else cast(capacity_ as double)/1e9 end as capacityfrom olympusdao_ethereum.OlympusRange_call_updateCapacity)select * from capacityorder by 1 asc