kasadeghUntitled Query
    Updated 2022-11-22
    with algo_price as
    (
    select block_hour::date as day,
    avg (price_usd) as usdprice
    from algorand.defi.ez_price_pool_balances
    where asset_id = '0'
    group by 1
    )


    SELECT
    'algorand' as chain,
    block_timestamp::date as day,
    avg(usdprice) as price,
    count(distinct TX_ID) as tx_count,
    sum(amount) as total_volume,
    avg(amount) as avg_volume,
    count(DISTINCT ASSET_SENDER) as senders_cnt,
    count(DISTINCT RECEIVER) as receivers_cnt
    FROM algorand.core.ez_transfer as t1 join algo_price as t2 on t1.block_timestamp::date=t2.day
    where asset_id = '31566704'
    AND block_timestamp::date >='{{start_time}}' and block_timestamp::date <='{{end_date}}'
    GROUP BY 1,2

    Run a query to Download Data