Query editor
-- DAO Wallet (crafting) 0xb208f8BB431f580CC4b216826AFfB128cd1431aBWITH addresses AS (SELECT * FROM query_2428525 -- DAO addresses),addresses_polygon AS (SELECT address FROM addresses WHERE blockchain = 'polygon'),sent_polygon AS (SELECTdate_trunc('month', evt_block_time) as month,"from" as address,- cast(sum(value) as INT256) as totalFROMaavegotchi_polygon.KEK_evt_Transfer as tfrJOIN addresses_polygon ON tfr."from" = addresses_polygon.addressGROUP BY 1, 2),received_polygon AS (SELECTdate_trunc('month', evt_block_time) as month,to as address,cast(sum(value) as INT256) as totalFROMaavegotchi_polygon.KEK_evt_Transfer as tfrJOIN addresses_polygon ON tfr."to" = addresses_polygon.addressGROUP BY 1, 2),-- ensure there is a month entry for every address, to avoid gaps in the graphsactive_months AS (SELECT DISTINCT monthFROM (SELECT month FROM sent_polygonUNION SELECT month FROM received_polygon)),active_addresses_polygon AS (SELECT DISTINCT addressFROM (SELECT address FROM sent_polygonUNION SELECT address FROM received_polygon)),placeholders_polygon AS (SELECTmonth,address,cast(0 as INT256)FROM active_months, active_addresses_polygon -- CROSS JOIN for all combinations),months_polygon AS (SELECTmonth,address,'KEK' as token,sum(total) as month_change,'polygon' as blockchain