Query editor
-- DTF Wallet 0x6fb7e0AAFBa16396Ad6c1046027717bcA25F821f-- alloy ERC-1155 Token ID 1000000000 0x4fDfc1B53Fd1D80d969C984ba7a8CE4c7bAaD442WITH addresses AS (SELECT * FROM query_2428525 -- DAO addresses),addresses_polygon AS (SELECT address FROM addresses WHERE blockchain = 'polygon'),sent_polygon AS (SELECTdate_trunc('week', evt_block_time) as week,"from" as address,- cast(sum(value) as INT256) as totalFROMaavegotchi_polygon.ForgeDiamond_evt_TransferSingle as tfrJOIN addresses_polygon ON tfr."from" = addresses_polygon.addressWHEREid = cast(1000000000 as uint256)AND evt_block_time >= CAST('2023-02-10' AS TIMESTAMP)GROUP BY 1, 2),received_polygon AS (SELECTdate_trunc('week', evt_block_time) as week,to as address,cast(sum(value) as INT256) as totalFROMaavegotchi_polygon.ForgeDiamond_evt_TransferSingle as tfrJOIN addresses_polygon ON tfr."to" = addresses_polygon.addressWHEREid = cast(1000000000 as uint256)AND evt_block_time >= CAST('2023-02-10' AS TIMESTAMP)GROUP BY 1, 2),-- ensure there is a week entry for every address, to avoid gaps in the graphsactive_weeks AS (SELECT DISTINCT weekFROM (SELECT week FROM sent_polygonUNION SELECT week FROM received_polygon)),active_addresses_polygon AS (SELECT DISTINCT addressFROM (SELECT address FROM sent_polygonUNION SELECT address FROM received_polygon)),placeholders_polygon AS (SELECTweek,address,cast(0 as INT256)FROM active_weeks, active_addresses_polygon -- CROSS JOIN for all combinations),