Query editor
-- Query 11: Time-to-First-Action After Bridging-- Section 4 (Post-Bridge Behavior) — how quickly do users act after bridging?---- Approach:-- Reuses the same bridge receipts + first action detection as Query 10,-- but measures the time delta between bridge arrival and first action.-- Buckets into time ranges to show urgency of post-bridge behavior.---- Time buckets: <5 min, 5-30 min, 30 min-1h, 1-6h, 6-24h-- Users who take no action within 24h are excluded (they're "Hold / Other"-- from Query 10 — including them would distort the time distribution).---- Scoping (same as Query 10):-- - Destination chains: Base, Arbitrum, Optimism, Polygon, BNB Chain (top EVM destinations)-- - Bridge data: last 3 months-- - Sample: 50K most recent bridge events per chain-- - Partition pruning buffer: 4 months on joined tables (1 month buffer-- ensures edge-case matches for bridge events near the 3-month boundary-- whose post-bridge action falls up to 24h later)---- Chart: Bar chart (time bucket on X, tx count on Y, grouped by action type)-- FIX: tokens.erc20 contains duplicate rows per token (same contract_address + blockchain-- with slightly different metadata). Joining bridges_evms.flows directly against tokens.erc20-- causes a fan-out join, multiplying each bridge row by the number of duplicates and inflating-- COUNT(*), SUM(amount_usd), AVG(), and APPROX_PERCENTILE(). Deduplicating into a CTE first-- ensures a 1:1 join so each bridge transaction is counted exactly once.WITH stablecoin_tokens AS (SELECT DISTINCT contract_address, blockchainFROM tokens.erc20WHERE symbol IN ('USDC', 'USDC.e', 'USDbC', 'USDT', 'USDT0','DAI', 'BUSD', 'TUSD', 'FRAX', 'LUSD','USDP', 'PYUSD', 'GHO', 'USDe', 'USDS', 'crvUSD')),bridge_receipts AS (SELECTb.recipient AS wallet,b.withdrawal_chain AS chain,b.withdrawal_block_time AS bridge_time,b.bridge_name,b.amount_usd,ROW_NUMBER() OVER (PARTITION BY b.withdrawal_chainORDER BY b.withdrawal_block_time DESC) AS rnFROM bridges_evms.flows bINNER JOIN stablecoin_tokens tON b.deposit_token_address = t.contract_addressAND b.deposit_chain = t.blockchainWHERE b.deposit_block_date >= CURRENT_DATE - INTERVAL '3' MONTHAND b.amount_usd > 0AND b.bridge_name != 'Agglayer'AND b.withdrawal_chain IN ('base', 'arbitrum', 'optimism', 'polygon', 'bnb')),sampled_receipts AS (SELECT wallet, chain, bridge_time, bridge_name, amount_usd