MLDZMNffuser1
    Updated 2023-06-10
    select
    case
    when amount>0 and amount<=10 then 'a. < 10 SOL'
    when amount>10 and amount<=20 then 'b. 10-20 SOL'
    when amount>20 and amount<=30 then 'c. 20-30 SOL'
    when amount>30 and amount<=40 then 'd. 30-40 SOL'
    when amount>40 then 'e. > 40 SOL'
    end as bucket,
    count(distinct signers[0]) as users

    from solana.core.fact_transactions s
    left join solana.core.fact_transfers a on s.tx_id=a.tx_id

    where array_contains('Program log: Instruction: CompleteSwap'::variant, log_messages)
    and INSTRUCTIONS[0]:programId= '8guzmt92HbM7yQ69UJg564hRRX6N4nCdxWE5L6ENrA8P'
    and MINT in ('So11111111111111111111111111111111111111112')
    and (INNER_INSTRUCTIONS[1]:instructions[0]:parsed:info:destination = tx_to or
    tx_from = INNER_INSTRUCTIONS[1]:instructions[0]:parsed:info:destination )
    and s.BLOCK_TIMESTAMP>=current_date-{{Days_back}}
    and SUCCEEDED='TRUE'
    group by 1
    Run a query to Download Data