Query editor
-- SDMC vault performance — single-row snapshot for counter widgets.-- Aggregates raw deposit-only flows across all chains, then computes:-- - deposits_24h : USDC deposited in the last 24 hours-- - avg_deposit : average deposit transaction size-- - largest_deposit: biggest single deposit-- - top10_share_pct: share of TVL held by the 10 largest wallets---- ADDING A NEW VAULT: extend the `IN (...)` filters for each chain CTE.WITH eth AS (SELECTCAST("from" AS VARCHAR) AS depositor,CAST(value AS DOUBLE)/1e6 AS amount,evt_block_time AS tsFROM erc20_ethereum.evt_TransferWHERE contract_address = 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48AND evt_block_time >= CAST('2026-05-17' AS timestamp)AND "to" IN (0xcee063f8148901037323c1c3a3763b8a5c7c36fb)),b AS (SELECTCAST("from" AS VARCHAR) AS depositor,CAST(value AS DOUBLE)/1e6 AS amount,evt_block_time AS tsFROM erc20_base.evt_TransferWHERE contract_address = 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913AND evt_block_time >= CAST('2026-05-17' AS timestamp)AND "to" IN (0x3ed40ee069214f350a36764b4f38cffbe3c6d8a7)),s AS (SELECTfrom_owner AS depositor,CAST(amount AS DOUBLE)/1e6 AS amount,block_time AS tsFROM tokens_solana.transfersWHERE token_mint_address = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'AND block_time >= CAST('2026-05-17' AS timestamp)AND to_token_account IN ('4cCFi2gvm5eKtyBUfWDsjHRwTWUti2FVW8nAYh5KuLEU')),deposits AS (SELECT depositor, amount, ts FROM ethUNION ALL SELECT depositor, amount, ts FROM bUNION ALL SELECT depositor, amount, ts FROM s),totals AS (SELECTSUM(amount) AS total,SUM(CASE WHEN ts >= NOW() - INTERVAL '24' HOUR THEN amount END) AS d24,AVG(amount) AS avg_amt,MAX(amount) AS max_amtFROM deposits),per_wallet AS (SELECT depositor, SUM(amount) AS total_depositedFROM depositsGROUP BY depositor),top10 AS (SELECT SUM(total_deposited) AS top10_sumFROM (