Query editor
with badge_supply as (select--id,count(*) as num_mintedfrom erc1155_arbitrum.evt_transfersinglewhere contract_address = 0x1a697d4d9b12c53dc8cc89356ddce1b658851e01and "from" = 0x0000000000000000000000000000000000000000and evt_block_time > cast('2024-03-01' as timestamp)and id in (selectbytearray_to_int256(substring(data from 1 for 32)) as idfrom arbitrum.logswhere contract_address = 0x79cbc5ec7caa32705d4f96ba3d012babbb6a7344and block_time > cast('2024-05-01' as timestamp)and topic0 = 0x8c66ca490558bda081ce7acfcfa648206ba9b23166117f57f77dbb94881d0dce)--group by 1order by 1 desc)select'CU Single Staking' as label,count(*) as num_badge_delegated,cast(count(*) as double)/(select num_minted from badge_supply)*100 as pct_delegatedfrom arbitrum.transactionswhere to = 0x919951bc88ade76cc911f09bb50e81a91325aa21 -- CU single staking addressand substring(data from 1 for 4) = 0x1a300a5dand block_time > cast('2024-05-01' as timestamp)and successunion allselect'CU LP Staking' as label,count(*) as num_badge_delegated,cast(count(*) as double)/(select num_minted from badge_supply)*100 as pct_delegatedfrom arbitrum.transactionswhere to = 0x79cBc5EC7Caa32705D4f96BA3d012Babbb6a7344 -- CULP staking addressand substring(data from 1 for 4) = 0x1a300a5dand block_time > cast('2024-05-01' as timestamp)and successorder by 1 desc