Query editor
withbase AS (SELECT"from",address /* , *//* case when `from`='0x5f799f365fa8a2b60ac0429c48b153ca5a6f0cf8' then 'GMX' *//* when `from`=lower('0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9') then 'Uniswap' *//* end as label */FROMarbitrum.tracesWHERE"from" IN (0x5f799f365fa8a2b60ac0429c48b153ca5a6f0cf8,0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9,0x87209dc4B76b14B67BC5E5e5c0737E7d002a219c,0x59eE12714dFCFC300344f0256A4308c1C48E56ED,0xf87BC5535602077d340806D71f805EA9907a843D,0xc35DADB65012eC5796536bD9864eD8773aBc74C4,0x1F98431c8aD98523631AE4a59f267346ea31F984,0x5fFc120734cE00002B43919d27E70D881f02f8eF,0x57ff9294b05065b88cb3ec148beedfb50eda3127,0x079a889eB69013d451EcF45377258948116e2b3e,0x1D7C6783328C145393e84fb47a7f7C548f5Ee28d,0x7EeAC6CDdbd1D0B8aF061742D41877D7F707289a) /* uniswap */AND "type" = 'create'AND NOT address IS NULL),label_addresses_arbone_dataset as (select *from labels.addresseswhere blockchain in ( 'arbitrum') and label_type='identifier' and category !='institution'),labels_list AS (SELECT DISTINCTaddress,case when namespace = 'uniswap_v2' then 'uniswap' else namespace end AS label,'arbitrum.contracts' as flagFROMarbitrum.contracts-- where address not in (select distinct address from base)UNION ALLselect distinctaddress,name as label ,'labels-address' as flagfrom label_addresses_arbone_datasetwhereaddress not in (select distinct address from arbitrum.contracts) -- label.addresses has arbitrum.contracts as well , so here we only take addresses that are in labels.addresses but not in arbitrum.contracts to return any other contracts unaccounted for. we us arbigrum.contracts initially as it has cleaner naming of contract names