raymanodbswaps 90d
    Updated 2024-09-02
    -- forked from BlockTracker / swaps over time @ https://flipsidecrypto.xyz/BlockTracker/q/vJtYtCfcbYNC/swaps-over-time


    --For more insights and detail of analysis please check out our dashboard: https://sociocrypto.gitlab.io/Green-Routes/

    with
    total_txns as (
    SELECT
    'avalanche' as chain,
    date_trunc('day', block_timestamp) as date,
    count(DISTINCT tx_hash) as n_txs
    FROM avalanche.core.fact_transactions
    WHERE block_timestamp >= CURRENT_DATE -90
    GROUP BY date
    UNION
    SELECT
    'bsc' as chain,
    date_trunc('day', block_timestamp) as date,
    count(DISTINCT tx_hash) as n_txs
    FROM bsc.core.fact_transactions
    WHERE date >= CURRENT_DATE -90
    GROUP BY date
    UNION
    SELECT
    'ethereum' as chain,
    date_trunc('day', block_timestamp) as date,
    count(DISTINCT tx_hash) as n_txs
    FROM ethereum.core.fact_transactions
    WHERE date >= CURRENT_DATE -90
    GROUP BY date
    UNION
    SELECT
    'blast' as chain,
    date_trunc('day', block_timestamp) as date,
    count(DISTINCT tx_hash) as n_txs
    FROM blast.core.fact_transactions
    QueryRunArchived: QueryRun has been archived