Pine AnalyticsMonad 3 copy copy
    Updated 2025-03-21
    with tab1 as (
    SELECT
    address
    FROM monad.testnet.dim_contracts
    ), tab2 as (
    select
    to_address as contract,
    count(distinct FROM_ADDRESS) as wallets,
    count(*) as tranactions

    from monad.testnet.fact_transactions
    where to_address in (select * from tab1)
    group by 1
    order by 2 desc
    )

    select
    case when wallets = 1 then 'a/ 1 Wallet'
    when wallets < 10 then 'b/ 2-9 Wallets'
    when wallets < 100 then 'c/ 10-99 Wallets'
    when wallets < 1000 then 'd/ 100-999 Wallets'
    when wallets < 10000 then 'e/ 1K-9,999 Wallets'
    else 'f/ 10k+ Wallets' end as Contract_wallet_group,
    count(*) as contracts

    from tab2
    group by 1



    Last run: 28 days ago
    CONTRACT_WALLET_GROUP
    CONTRACTS
    1
    a/ 1 Wallet476690
    2
    e/ 1K-9,999 Wallets2116
    3
    d/ 100-999 Wallets5723
    4
    b/ 2-9 Wallets135246
    5
    f/ 10k+ Wallets440
    6
    c/ 10-99 Wallets39002
    6
    158B
    19s