Eman-RazPrice Comparision Over Time
    Updated 2024-09-19
    with black_dragon as (with tab1 as (select date_trunc('day',block_timestamp) as "Date", (sum(amount_in)/sum(amount_out)) as "Avg Price ($USD)"
    from near.defi.ez_dex_swaps
    where symbol_in in ('USDC','USDC.e','USDT.e','USDt')
    and SYMBOL_out='BLACKDRAGON' and block_timestamp is not null
    group by 1
    order by 1)

    select "Date", case
    when "Date"='2024-04-13' then '7.523329567e-8'
    when "Date"='2024-04-24' then '7.76012802e-8'
    when "Date"='2024-04-25' then '6.892335316e-8'
    else "Avg Price ($USD)"
    end as "BLACK DRAGON Price"
    from tab1
    where "Date" between '{{Start_Date}}' and '{{End_Date}}'
    order by 1),

    any_inu as (select hour::date as "Date", avg(price) as "AI Price"
    from ethereum.price.ez_prices_hourly
    where token_address=lower('0x2598c30330D5771AE9F983979209486aE26dE875')
    and hour::date between '{{Start_Date}}' and '{{End_Date}}'
    group by 1)

    SELECT black_dragon."Date" as "Date", "BLACK DRAGON Price", "AI Price"
    from black_dragon left join any_inu on black_dragon."Date"=any_inu."Date"
    order by 1







    QueryRunArchived: QueryRun has been archived