pimi1356-HdnUm3 Kamino Finance: USDH and Other transactions
    Updated 2022-10-10
    with alll as (
    select date_trunc('{{date_range}}', block_timestamp) as date,
    count (distinct tx_id) as TX_Count,
    count (distinct signers[0]) as Users_Count
    from solana.core.fact_transactions
    where succeeded = 'TRUE'
    and instructions[0]:programId = '6LtLpnUFNByNXLyCoK9wA2MykKAmQNZKBdY8s47dehDc'
    group by 1
    order by 1),
    usdh as (
    select date_trunc('{{date_range}}', block_timestamp) as date,
    count (distinct tx_id) as TX_Count,
    count (distinct signers[0]) as Users_Count
    from solana.core.fact_transactions
    where (inner_instructions[1]:instructions[0]:parsed:info:mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX'
    or inner_instructions[0]:instructions[0]:parsed:info:mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX'
    or pre_token_balances[0]:mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX'
    or pre_token_balances[1]:mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX')
    and succeeded = 'TRUE'
    and instructions[0]:programId = '6LtLpnUFNByNXLyCoK9wA2MykKAmQNZKBdY8s47dehDc'
    group by 1
    order by 1
    )
    select 'All transaction' as type, date as datee, TX_Count as TX, Users_Count as users
    from alll
    UNION
    select 'USDH transaction', date,TX_Count, Users_Count
    from usdh









    Run a query to Download Data