Query editor
WITH transfers AS((SELECT(bytearray_to_int256(SUBSTR(data, 65, 32))/1e+18) as value,topic1 as walletFROM polygon.logsWHERE contract_address = 0x9a818e78991df787bd706f228c9e99cf81e10cffAND tx_hash <> 0xee0221f1a9f0fcf2b0683841a1264455c79912e5ecfc03088163fe69c9029000)UNION ALL-- web store contract(SELECT(bytearray_to_int256(SUBSTR(data, 65, 32))/1e+18) as value,topic1 as walletFROM polygon.logsWHERE contract_address = 0xc9f7dd5dca7848798210008e8493f385f0771893)UNION ALL-- chest sale in ETH(SELECT(bytearray_to_int256(SUBSTR(data, 65, 32))/1e+18) as value,topic1 as walletFROM ethereum.logsWHERE contract_address = 0x011C1a01012f952cFf47d050CA23704612Ce0ae8)UNION ALL(SElECT(CAST(value AS double)/1e+18) as value,"from" as walletFROM erc20_polygon.evt_TransferWHEREcontract_address = 0x2bC07124D8dAc638E290f401046Ad584546BC47bAND "to" = 0xc6b891970fde366e8c8b1f81e38f9cd5a9f65d15 )UNION ALL(SElECT(CAST(value AS double)/1e+18) as value,"from" as walletFROM erc20_polygon.evt_TransferWHEREcontract_address = 0x2bC07124D8dAc638E290f401046Ad584546BC47bAND "to" = 0xc6b891970fde366e8c8b1f81e38f9cd5a9f65d15))SELECT DISTINCT(wallet), SUM(value) as total_spentFROM transfersGROUP BY walletORDER BY total_spent DESC