Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/-- 1000000002 Geode Common 0x000000000000000000000000000000000000000000000000000000003b9aca02-- 1000000003 Geode Uncommon 0x000000000000000000000000000000000000000000000000000000003b9aca03-- 1000000004 Geode Rare 0x000000000000000000000000000000000000000000000000000000003b9aca04-- 1000000005 Geode Legendary 0x000000000000000000000000000000000000000000000000000000003b9aca05-- 1000000006 Geode Mythical 0x000000000000000000000000000000000000000000000000000000003b9aca06-- 1000000007 Geode Godlike 0x000000000000000000000000000000000000000000000000000000003b9aca07select '0x' || substr(topic4,27,40) as owner, topic4, bytearray_to_uint256(substr(data,1,32)) as geode,COUNT(*) as count_geodefrom polygon."logs"where contract_address = 0x4fdfc1b53fd1d80d969c984ba7a8ce4c7baad442--and topic4 = '0x000000000000000000000000680800f9e4a4bf3d61856beb12f58f0f62c99257'and topic2 = '0x0000000000000000000000000000000000000000000000000000000000000000'and (substr(data,1,32) = '0x000000000000000000000000000000000000000000000000000000003b9aca02'or substr(data,1,32) = '0x000000000000000000000000000000000000000000000000000000003b9aca03'or substr(data,1,32) = '0x000000000000000000000000000000000000000000000000000000003b9aca04'or substr(data,1,32) = '0x000000000000000000000000000000000000000000000000000000003b9aca05'or substr(data,1,32) = '0x000000000000000000000000000000000000000000000000000000003b9aca06'or substr(data,1,32) = '0x000000000000000000000000000000000000000000000000000000003b9aca07')group by bytearray_to_uint256(substr(data,1,32)),topic3order by count_geode desc