Query editor
/* get token balance of wallet */WITH wallet_list as (SELECT * FROM (VALUES-- add the addresses here that you want to query(0x7063E83dF5349833A21f744398fD39D42fbC00f8)) a (address)),calendar(month) as(values(timestamp '2022-10-01 00:00'),(timestamp '2022-11-01 00:00'),(timestamp '2022-12-01 00:00'),(timestamp '2023-01-01 00:00'),(timestamp '2023-02-01 00:00'),(timestamp '2023-03-01 00:00'),(timestamp '2023-04-01 00:00'),(timestamp '2023-05-01 00:00'),(timestamp '2023-06-01 00:00'),(timestamp '2023-07-01 00:00'),(timestamp '2023-08-01 00:00'),(timestamp '2023-09-01 00:00'),(timestamp '2023-10-01 00:00'),(timestamp '2023-11-01 00:00')),newcal as(select * from calendarunionselect distinct date_trunc('month',evt_block_time) as monthfrom erc20_ethereum.evt_transferwhere "from" IN (SELECT address FROM wallet_list)and evt_block_time >= timestamp '2023-12-01'),dist_symbs as(select distinct symbol as symbolFROM erc20_ethereum.evt_transfer JOIN tokens.erc20 USING (contract_address) -- join tokens.erc20 to get the token symbol and decimalswhere "to" IN (SELECT address FROM wallet_list)or "from" IN (SELECT address FROM wallet_list)),crossjoin as(select month, symbolfrom newcal n cross join dist_symbs ds),getLatestTokenPrice as (SELECT symbol, price FROM prices.usd_latestWHERE contract_address in (select distinct contract_address FROM erc20_ethereum.evt_transfer JOIN tokens.erc20 USING (contract_address) where "from" IN (0x7063E83dF5349833A21f744398fD39D42fbC00f8) or "to" IN (0x7063E83dF5349833A21f744398fD39D42fbC00f8))AND blockchain = 'ethereum' -- if you are querying token of another chain you'll need to edit this),symbs(symbol,contract_address) as(values('X7R',0x70008F18Fc58928dcE982b0A69C2c21ff80Dca54),('X7DAO',0x7105E64bF67ECA3Ae9b123F0e5Ca2b83b2eF2dA0)),backupusd1 as