piperA vs B: Number of Transactions by Minute
    Updated 2022-06-30
    /*
    Twitter: @der_piper
    Discrod: piper#6707

    A vs B

    Compare transaction volume for BSC vs. Arbitrum over the past 7 days and create a simple
    visualization to display both. Highlight any interesting points of comparison that you see.
    */

    WITH bsc AS (
    SELECT
    DATE_TRUNC('minute', block_timestamp) AS date,
    COUNT(tx_hash) as number_of_transactions,
    SUM(bnb_value) AS total_number_of_bnb,
    AVG(bnb_value) AS average_number_of_bnb,
    'BSC' AS chain
    FROM
    bsc.core.fact_transactions
    WHERE
    date BETWEEN '2022-06-23' AND '2022-06-30'
    GROUP BY date
    ORDER BY date ASC
    ),
    arb AS (
    SELECT
    DATE_TRUNC('minute', block_timestamp) AS date,
    COUNT(tx_hash) as number_of_transactions,
    SUM(eth_value) AS total_number_of_eth,
    AVG(eth_value) AS average_number_of_eth,
    'Arbitrum' AS chain
    FROM
    arbitrum.core.fact_transactions
    WHERE
    date BETWEEN '2022-06-23' AND '2022-06-30'
    GROUP BY date
    Run a query to Download Data