Query editor
-- ARB Airdrop Sybil Detection Training Data (FILTERED VERSION)-- Snapshot date was Feb 6, 2023-- We analyze behavior from Jan 1, 2022 to Feb 6, 2023WITH arb_recipients AS (-- Get all ARB airdrop recipientsSELECT DISTINCT recipient AS wallet_addressFROM arbitrum_arbitrum.TokenDistributor_evt_HasClaimed),funding_sources_raw AS (-- Get all ETH funding eventsSELECTt.to AS wallet_address,t."from" AS funding_source,t.value / 1e18 AS initial_eth_amount,t.block_time AS funding_time,t.block_number AS funding_block,ROW_NUMBER() OVER (PARTITION BY t.to ORDER BY t.block_time ASC) AS rnFROM arbitrum.traces tINNER JOIN arb_recipients r ON t.to = r.wallet_addressWHERE t.value > 0AND t."from" != t.toAND t.success = trueAND t.block_time < TIMESTAMP '2023-02-06' -- Before snapshotAND t.call_type = 'call'),funding_sources AS (-- Keep only first funding per walletSELECTwallet_address,funding_source,initial_eth_amount,funding_time,funding_blockFROM funding_sources_rawWHERE rn = 1),transaction_patterns AS (-- Analyze transaction behaviorSELECTt."from" AS wallet_address,COUNT(*) AS tx_count,COUNT(DISTINCT t.to) AS unique_recipients,AVG(t.gas_price / 1e9) AS avg_gas_price_gwei,STDDEV(t.gas_price / 1e9) AS gas_price_std_dev,MIN(t.block_time) AS first_tx_time,MAX(t.block_time) AS last_tx_time,COUNT(DISTINCT DATE_TRUNC('day', t.block_time)) AS active_days,EXTRACT(HOUR FROM MIN(t.block_time)) AS first_tx_hourFROM arbitrum.transactions tINNER JOIN arb_recipients r ON t."from" = r.wallet_addressWHERE t.block_time >= TIMESTAMP '2022-01-01'AND t.block_time < TIMESTAMP '2023-02-06'GROUP BY 1),contract_interactions AS (