Query editor
-- Squid x Legion community sale tracker (single query -> full dashboard)-- Tracks the LEGION leg only (on-chain USDC). Legion = HALF of the sale.-- Legion goal = $500K (half of $1M total target)-- Legion hard cap = $1.125M (half of $2.25M total hard cap) = allocatable ceiling-- USDC: 0xA0b86991c6218b36c1d19D4a2e9Eb0Ce3606eB48-- Squid sale contract: 0x2906E3651ad3499021EBa53B24D20bD977F19A96-- Legion distributor (refunds/settlement): 0x17c61f4a7f41b96eb9c0d8805255b8411387c63bWITH investors AS (SELECT "from" AS address, MIN(evt_block_time) AS first_timeFROM erc20_ethereum.evt_TransferWHERE contract_address = 0xA0b86991c6218b36c1d19D4a2e9Eb0Ce3606eB48AND "to" = 0x2906E3651ad3499021EBa53B24D20bD977F19A96AND evt_block_time >= TIMESTAMP '2026-06-01'GROUP BY "from"),deposits AS (SELECT evt_block_time AS block_time, "from" AS address,CAST(value AS DOUBLE) / 1e6 AS usdc_amountFROM erc20_ethereum.evt_TransferWHERE contract_address = 0xA0b86991c6218b36c1d19D4a2e9Eb0Ce3606eB48AND "to" = 0x2906E3651ad3499021EBa53B24D20bD977F19A96AND evt_block_time >= TIMESTAMP '2026-06-01'),refunds_direct AS (SELECT e.evt_block_time AS block_time, e."to" AS address,CAST(e.value AS DOUBLE) / 1e6 AS usdc_amountFROM erc20_ethereum.evt_Transfer eJOIN investors i ON e."to" = i.addressWHERE e.contract_address = 0xA0b86991c6218b36c1d19D4a2e9Eb0Ce3606eB48AND e."from" = 0x2906E3651ad3499021EBa53B24D20bD977F19A96AND e.evt_block_time >= TIMESTAMP '2026-06-01'AND e.evt_block_time >= i.first_time),refunds_distributor AS (SELECT e.evt_block_time AS block_time, e."to" AS address,CAST(e.value AS DOUBLE) / 1e6 AS usdc_amountFROM erc20_ethereum.evt_Transfer eJOIN investors i ON e."to" = i.addressWHERE e.contract_address = 0xA0b86991c6218b36c1d19D4a2e9Eb0Ce3606eB48AND e."from" = 0x17c61f4a7f41b96eb9c0d8805255b8411387c63bAND e.evt_block_time >= TIMESTAMP '2026-06-01'AND e.evt_block_time >= i.first_time),all_refunds AS (SELECT * FROM refunds_directUNION ALLSELECT * FROM refunds_distributor),hours AS (SELECT date_trunc('hour', block_time) AS hour,SUM(usdc_amount) AS gross_deposits,CAST(0 AS DOUBLE) AS gross_refunds,COUNT(*) AS deposit_count,CAST(0 AS BIGINT) AS refund_countFROM depositsGROUP BY 1UNION ALLSELECT date_trunc('hour', block_time) AS hour,CAST(0 AS DOUBLE) AS gross_deposits,SUM(usdc_amount) AS gross_refunds,