DrsimonUntitled Query
    Updated 2022-11-05
    WITH tx1 AS
    (SELECT
    DATE_TRUNC('month', block_timestamp) as week,
    count(DISTINCT TX_HASH) as num_tx ,
    'near' as laybel
    FROM NEAR.core.fact_transactions
    WHERE week >= '2022-01-01'
    GROUP BY 1
    order by WEEK desc) ,
    tx2 AS
    (SELECT
    DATE_TRUNC('month', block_timestamp) as week,
    count(DISTINCT TX_hash) as num_tx ,
    'polygon' as laybel
    FROM polygon.core.fact_transactions
    WHERE week >= '2022-01-01'
    GROUP BY 1
    order by WEEK desc) ,
    tx3 AS
    (SELECT
    DATE_TRUNC('month', block_timestamp) as week,
    count(DISTINCT TX_HASH) as num_tx ,
    'ethereum' as laybel
    FROM ethereum.core.fact_transactions
    WHERE week >= '2022-01-01'
    GROUP BY 1
    order by WEEK desc) ,
    total as
    (select week as month, num_tx , laybel from tx1
    UNION all
    select week as month, num_tx , laybel from tx2
    UNION all
    select week as month, num_tx , laybel from tx3)
    Run a query to Download Data