kimkimUSDC spending distribution of Solana users by day
    Updated 2022-08-03
    with usd_use as (
    select
    BLOCK_TIMESTAMP::date as date,
    INSTRUCTION:accounts[7] as users,
    sum(inner_instruction:instructions[1]:parsed:info:amount)/1e6 as daily_usd_use
    from solana.core.fact_events
    where block_timestamp >= '2022-01-01' and block_timestamp < CURRENT_DATE
    and succeeded = 'TRUE'
    group by 1,2
    ),

    T1 as (
    select
    date,
    users,
    (daily_usd_use) as value_use
    from usd_use
    )

    SELECT
    date,
    CASE
    WHEN value_use <100 then 'Under 100 USDC [average Solona user] '
    WHEN value_use >=100 and value_use <1000 then 'between 100 USDC and 1000 USDC '
    WHEN value_use >=1000 and value_use <10000 then 'between 1000 USDC and 10000 USDC '
    WHEN value_use >=10000 and value_use <100000 then 'between 10000 USDC and 100000 USDC '
    WHEN value_use >=100000 and value_use <1000000 then 'between 100000 USDC and 1000000 USDC '
    WHEN value_use >=1000000 then 'Above 1 million USDC [whales Solona user] '
    end as category,
    count(category)
    from T1
    where category is not null
    group by 1,2
    Run a query to Download Data