barsik_tezikStarknet tx count by sectors
    Updated 2023-11-25
    with accs as (
    SELECT
    DISTINCT CONCAT('0x', LTRIM(CONTRACT, '0x')) as addr,
    CONTRACT as addr0
    from
    external.tokenflow_starknet.decoded_traces
    where
    CHAIN_ID = 'mainnet'
    and FUNCTION = 'constructor'
    ),
    tb1 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 addr0
    from
    accs
    )
    group by
    1
    )
    select
    case
    when txs < 10 then 'A'
    when txs >= 10
    and txs < 20 then 'B'
    when txs >= 20
    and txs < 50 then 'C'
    when txs >= 50
    and txs < 100 then 'D'
    Run a query to Download Data