Query editor
-- User Properties: Wallet Type (research request C.14)-- One row per (blockchain, account) that ever held GMX (accounts and balance from query_9092856, GMX Balances).-- wallet_type, first match wins:-- zero_address the 0x00..00 address (mint / burn side of transfers)-- safe Safe proxy (spellbook safe.safes_all)-- erc4337 ERC-4337 smart account (spellbook account_abstraction_erc4337.account_deployed)-- contract any other contract (arbitrum / avalanche_c creation_traces)-- eoa_7702 EOA whose latest EIP-7702 delegation points to a contract (arbitrum.transactions authorization_list)-- eoa everything else-- Labels: all_labels = every label found for the account in labels.addresses (spellbook union of all label tables),-- GM / GLV pools (gmx_v2.markets_data, gmx_v2.glvs_data) and contract names (contracts.contract_mapping).-- final_label = first by priority: 1 GM / GLV pool, 2 CEX, 3 bridge, 4 other identifier labels (institution, dao,-- project wallet, ...), 5 decoded contract name, 6 other identifier labels (ENS, infrastructure), 7 contract_mapping name.-- Behaviour labels (persona / usage, e.g. 'DEX Trader') are kept in all_labels only.-- Changes vs 4766558 (labels logic named in the request):-- labels per (blockchain, account) (4766558 summed chains and joined on address only);-- institution labels are applied (4766558 joined the bridge labels twice);-- labels.cex_users is not counted as CEX (it labels users who withdrew from a CEX, not CEX wallets).-- Known issues:-- 1. EIP-7702: Dune has no authority column, so only delegations the EOA sent itself are found-- (authorization nonce = tx nonce + 1). Delegations sent by a relayer are missed.-- avalanche_c.transactions has no authorization_list column: no EIP-7702 on avalanche_c.-- 2. eoa = not found in any contract table, so an address where a contract is not deployed yet also lands here.-- 3. CEX and ENS labels of the same address on ethereum are applied to arbitrum / avalanche_c (as in 4766558 / 6973715).WITH holders AS (SELECT blockchain, account, is_zero_address, balanceFROM query_9092856), safes AS (SELECT DISTINCT blockchain, addressFROM safe.safes_allWHERE blockchain IN ('arbitrum', 'avalanche_c')), erc4337_accounts AS (SELECT DISTINCT blockchain, sender AS addressFROM account_abstraction_erc4337.account_deployedWHERE blockchain IN ('arbitrum', 'avalanche_c')), contracts AS (SELECT DISTINCT 'arbitrum' AS blockchain, address FROM arbitrum.creation_tracesUNION ALLSELECT DISTINCT 'avalanche_c' AS blockchain, address FROM avalanche_c.creation_traces)-- latest EIP-7702 delegation the EOA sent itself (arbitrum only), eip7702 AS (SELECT blockchain, address, delegate, delegated_atFROM (SELECT'arbitrum' AS blockchain, t."from" AS address, a.delegate, t.block_time AS delegated_at, ROW_NUMBER() OVER (PARTITION BY t."from" ORDER BY t.block_number DESC, t.index DESC) AS rnFROM arbitrum.transactions AS tCROSS JOIN UNNEST(t.authorization_list) AS a (chain_id, delegate, nonce, r, s, y_parity)WHERE t.block_date >= DATE '2025-05-01'