GYZQ分钱包tx level
    Updated 2023-11-15
    with all_w as (SELECT DISTINCT CONTRACt as wlt
    from external.tokenflow_starknet.decoded_traces
    where
    CHAIN_ID = 'mainnet'
    and
    FUNCTION = 'constructor'
    and
    CLASS_HASH = '0x03530cc4759d78042f1b543bf797f5f3d647cde0388c33734cf91b7f7b9314a9'),

    x as
    (SELECT DISTINCT contract, count(DISTINCT tx_hash) as txs
    from external.tokenflow_starknet.decoded_transactions
    where
    CHAIN_ID = 'mainnet'
    and CONTRACT in (SELECT DISTINCT wlt from all_w )
    group by 1
    )
    SELECT count(DISTINCT contract) as wallets, case
    when txs = 1 then 'A) Only 1 Transaction'
    when txs > 1 and txs < 11 then 'B) Between 2~10 Transactions'
    when txs > 10 and txs < 31 then 'C) Between 11~30 Transactions'
    when txs > 30 and txs < 61 then 'D) Between 31~60 Transactions'
    when txs > 60 then 'E) More than 60 Transactions' end as "Activity rate"
    from x
    GROUP by 2




    Run a query to Download Data