Query editor
-- Query 12: Stablecoin vs Non-Stablecoin Bridge Volume (Monthly)-- Section 4B (Why Stablecoins?) — what share of all bridging is stablecoins?---- Approach:-- Compare total bridge volume against stablecoin-only bridge volume by month.-- Shows whether stablecoins dominate bridging and whether that share is growing.---- Methodology:-- - "Stablecoin" is defined by token symbol match after joining tokens.erc20-- - "All bridging" uses the full bridges_evms.flows table (no token filter)-- - Both exclude Agglayer (inflated data)-- - 12-month window for trend visibility---- Chart: Stacked area chart (stablecoin vs non-stablecoin volume),-- or line chart with stablecoin % overlayWITH all_bridges AS (SELECTDATE_TRUNC('month', deposit_block_date) AS month,SUM(amount_usd) AS total_volume_usd,COUNT(*) AS total_txsFROM bridges_evms.flowsWHERE deposit_block_date >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '12' MONTH)AND amount_usd > 0AND bridge_name != 'Agglayer'GROUP BY 1),-- 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.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')),stablecoin_bridges AS (SELECTDATE_TRUNC('month', b.deposit_block_date) AS month,SUM(b.amount_usd) AS stablecoin_volume_usd,COUNT(*) AS stablecoin_txsFROM bridges_evms.flows bINNER JOIN stablecoin_tokens tON b.deposit_token_address = t.contract_addressAND b.deposit_chain = t.blockchainWHERE b.deposit_block_date >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '12' MONTH)AND b.amount_usd > 0AND b.bridge_name != 'Agglayer'GROUP BY 1)SELECTa.month,