par_rn $Dust Distribution
    Updated 2022-12-02
    WITH holders AS (
    SELECT
    block_timestamp,
    post_balance.value:owner AS wallet,
    post_balance.value:mint AS token,
    post_balance.value:uiTokenAmount:uiAmount AS amount,
    ROW_NUMBER() OVER (PARTITION BY wallet, token ORDER BY block_timestamp DESC) AS rank
    FROM solana.core.fact_transactions,
    LATERAL FLATTEN(input => post_token_balances) post_balance
    WHERE SUCCEEDED = 'True'
    AND post_balance.value:owner = wallet
    AND post_balance.value:mint = 'DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ'
    AND block_timestamp >= '2022-01-01'
    ORDER BY 1,2,4
    )

    select
    type,
    count(distinct(wallet)) as total
    from (
    select
    distinct wallet,
    case when amount < 10 then 'Hold < 10 $DUST'
    when amount < 375 and amount >=10 then '10 < Hold < 375 $DUST'
    when amount < 1000 and amount >=375 then '375 < Hold < 1k $DUST'
    when amount < 10000 and amount >=1000 then '1k < Hold < 10k $DUST'
    when amount >=10000 then 'Hold > 10k $DUST'
    end as type
    FROM holders
    where amount IS NOT NULL
    and rank = 1
    AND amount != ''
    )
    group by type
    order by type
    Run a query to Download Data