Query editor
withLockup AS (SELECT*FROM(SELECTdate_trunc('month', "evt_block_time") as month,SUM(CAST(_value AS DECIMAL)) / POW(10, 18) as ethereum,0 as polygon,0 as arbitrumFROMdevprotocol_ethereum.Lockup_evt_LockedupGROUP BY1UNION ALLSELECTdate_trunc('month', "evt_block_time") as month,0 AS ethereum,SUM(CAST(_value AS DECIMAL)) / POW(10, 18) as polygon,0 as arbitrumFROMdevprotocol_polygon.Lockup_evt_LockedupGROUP BY1UNION ALLSELECTdate_trunc('month', "evt_block_time") as month,0 AS ethereum,0 as polygon,SUM(CAST(_value AS DECIMAL)) / POW(10, 18) as arbitrumFROMdevprotocol_arbitrum.Lockup_evt_LockedupGROUP BY1))SELECTmonth,SUM(ethereum) AS ethereum,SUM(polygon) AS polygon,SUM(arbitrum) AS arbitrumFROMLockupWHEREmonth >= CURRENT_TIMESTAMP - INTERVAL '{{In_Months}}' MONTHGROUP BYmonth