SocioAnalyticaDistribution of Users by Number of mint
    Updated 2024-10-10
    with all_txns as (
    SELECT
    block_timestamp,
    tx_id
    FROM cosmos.core.fact_msg_attributes
    WHERE msg_type = 'message'
    AND ATTRIBUTE_KEY = 'module'
    AND
    ATTRIBUTE_VALUE = 'bank'
    AND TX_SUCCEEDED
    AND block_timestamp :: date >= '2024-01-17'
    )

    SELECT
    CASE when n_mint = 1 then '1 mint'
    when n_mint <= 10 then '1-10 mint'
    when n_mint <= 100 then '10-100 mint'
    when n_mint <= 1000 then '100-1k mint'
    when n_mint <= 10000 then '1k-10k mint'
    when n_mint <= 100000 then '10k-100k mint'
    else '> 100k mint' end as dm,
    count(user) as n_user
    FROM (
    SELECT
    ATTRIBUTE_VALUE as user,
    count(DISTINCT b.tx_id) as n_mint
    from cosmos.core.fact_msg_attributes a
    JOIN all_txns b ON a.tx_id = b.tx_id
    WHERE msg_type = 'tx' and ATTRIBUTE_KEY = 'fee_payer'
    AND a.block_timestamp :: date >= '2024-01-17'
    GROUP BY 1
    )
    GROUP BY 1

    Auto-refreshes every 3 hours
    QueryRunArchived: QueryRun has been archived