Eman-RazTotal Reward Distributed ($USD)
    Updated 2023-09-16
    with tab3 as (with tab1 as (select date_trunc('day',block_timestamp) as "Date" , mint, sum(amount) as "Reward Volume"
    from solana.core.fact_transfers
    where tx_from='BEYJqFx5G6whGmpJ4Ar9yyKfnDVBTcGWDSnJPPmsPWh6' and
    mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v','DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263')
    group by 1,2
    order by 1),

    tab2 as (select recorded_hour::date as "Date", avg(close) as "Average Price", case
    when id='3408' then 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --USDC
    when id='23095' then 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263' --BONK
    end as mint, symbol
    from solana.price.fact_token_prices_hourly
    where id in ('3408','23095')
    group by 1,3,4
    order by 1)

    select tab1."Date" as "Date", "Reward Volume"*"Average Price" as "Reward Volume ($USD)", symbol
    from tab1 left join tab2 on tab1."Date"=tab2."Date" and tab1.mint=tab2.mint
    order by 1)

    select sum("Reward Volume ($USD)") as "Reward Volume ($USD)"
    from tab3



    Run a query to Download Data