Query editor
select token, sum(amount) as total_amount from ( selectcasewhen topic1 = 0x000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7 then 'USDT'when topic1 = 0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 then 'USDC'when topic1 = 0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f then 'DAI'when topic1 = 0x000000000000000000000000853d955acef822db058eb8505911ed77f175b99e then 'FRAX'end as token,casewhen topic1 IN (0x000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7, 0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)then bytearray_to_int256(bytearray_substring(topic2,5,32))/1e6else bytearray_to_int256(bytearray_substring(topic2,5,32))/1e18end as amountfrom ethereum.logswhere topic0 = 0x3bb7428b25f9bdad9bd2faa4c6a7a9e5d5882657e96c1d24cc41c1d6c1910a98and contract_address = 0x7d655c57f71464B6f83811C55D84009Cd9f5221Cand topic1 IN (0x000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7, 0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f, 0x000000000000000000000000853d955acef822db058eb8505911ed77f175b99e)and block_time between timestamp '2022-09-07' and timestamp '2022-09-23') total_stablesgroup by 1order by 2 desc