steven-sabol-dir-of-economyBlockchain txs copy
    Updated 2025-03-21
    -- forked from graham / Blockchain txs @ https://flipsidecrypto.xyz/graham/q/rnaIlai6VlXm/blockchain-txs

    with eth_games as (select
    date_trunc('month', block_timestamp::date) AS block_date,
    'ethereum' as blockchain,
    count(distinct tx_hash) as n_tx,
    count(distinct origin_from_address) as n_users
    from ethereum.core.fact_token_transfers a
    inner join (select distinct address, project_name from crosschain.core.dim_labels where blockchain = 'ethereum' and label_type = 'games') b
    on a.contract_address = b.address
    where block_date >= CURRENT_DATE - 720
    group by 1,2
    ),
    arb_games as (select
    date_trunc('month', block_timestamp::date) AS block_date,
    'arbitrum' as blockchain,
    count(distinct tx_hash) as n_tx,
    count(distinct origin_from_address) as n_users
    from arbitrum.core.fact_token_transfers a
    inner join (select distinct address, project_name from crosschain.core.dim_labels where blockchain = 'arbitrum' and label_type = 'games') b
    on a.contract_address = b.address
    where block_date >= CURRENT_DATE - 720
    group by 1,2
    ),
    ava_games as (select
    date_trunc('month', block_timestamp::date) AS block_date,
    'avalanche' as blockchain,
    count(distinct tx_hash) as n_tx,
    count(distinct origin_from_address) as n_users
    from avalanche.core.fact_token_transfers a
    inner join (select distinct address, project_name from crosschain.core.dim_labels where blockchain = 'avalanche' and label_type = 'games') b
    on a.contract_address = b.address
    where block_date >= CURRENT_DATE - 720
    group by 1,2
    ),
    base_games as (select
    Last run: about 1 month ago
    BLOCK_DATE
    BLOCKCHAIN
    N_TX
    N_USERS
    1
    2024-11-01 00:00:00.000arbitrum17219517091
    2
    2023-10-01 00:00:00.000polygon72427179115
    3
    2024-03-01 00:00:00.000arbitrum38098064703
    4
    2024-06-01 00:00:00.000ethereum4923712740
    5
    2024-09-01 00:00:00.000arbitrum10774315882
    6
    2023-06-01 00:00:00.000avalanche53383
    7
    2025-02-01 00:00:00.000bsc13948318149
    8
    2023-10-01 00:00:00.000bsc990597110787
    9
    2024-07-01 00:00:00.000base11877211748
    10
    2025-01-01 00:00:00.000polygon101183995612
    11
    2023-08-01 00:00:00.000polygon1172072197386
    12
    2024-04-01 00:00:00.000avalanche1056402
    13
    2024-02-01 00:00:00.000base346923211
    14
    2023-08-01 00:00:00.000avalanche28638
    15
    2023-06-01 00:00:00.000ethereum11271253820
    16
    2023-05-01 00:00:00.000bsc866024117873
    17
    2025-03-01 00:00:00.000ethereum324877984
    18
    2023-09-01 00:00:00.000base180501559
    19
    2023-12-01 00:00:00.000base558374232
    20
    2025-01-01 00:00:00.000base10562516411
    ...
    161
    8KB
    225s