nimasadjadiMint Burn Rate on Hubble
    Updated 2022-10-09
    with total_users as (select count(distinct signers[0]) from solana.core.fact_transactions
    where instructions[0]:programId='HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T')
    ,daily_active_users as (select count(distinct signers[0]) , block_timestamp::date from solana.core.fact_transactions
    where instructions[0]:programId='HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T'
    group by 2)
    ,weekday_active_users as (select count(distinct signers[0]) , dayname(block_timestamp::date) from solana.core.fact_transactions
    where instructions[0]:programId='HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T'
    group by 2)
    ,new_users as (select signers[0] as users , min(block_timestamp::date) as mdate from solana.core.fact_transactions
    where instructions[0]:programId='HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T'
    group by 1)

    , mint as (select count(distinct tx_id) as mint_count , block_timestamp::date as mint_date from solana.core.fact_transactions
    where instructions[0]:programId='HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T'
    and inner_instructions[0]:instructions[0]:parsed:type='mintTo'
    group by 2)
    , burn as (select count(distinct tx_id) as burn_count , block_timestamp::date as burn_date from solana.core.fact_transactions
    where instructions[0]:programId='HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T'
    and inner_instructions[0]:instructions[0]:parsed:type='burn'
    group by 2)
    , rates as (select (mint_count+burn_count) as total , mint_count/(mint_count+burn_count) as mint_rate ,
    burn_count/(mint_count+burn_count) as burn_rate , (mint_count/burn_count) as mintdivideburn ,mint_date
    from mint inner join burn on mint_date=burn_date)
    , USDH as (select count(distinct tx_id) as number ,sum(inner_instructions[1]:instructions[0]:parsed:info:amount/1e6) as amount , block_timestamp::date from solana.core.fact_transactions
    where instructions[0]:programId='HubbLeXBb7qyLHt3x7gvYaRrxQmmgExb7fCJgDqFuB6T'
    and inner_instructions[1]:instructions[0]:parsed:info:mint='USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX'
    group by 3)

    select * from rates
    Run a query to Download Data