0xaimancollateral price
    Updated 2022-05-18

    with col as
    (select * from (select symbol as collateral, sum(amount_usd) as col_value --date_trunc('month',block_timestamp) as month, symbol as collateral, sum(amount) --event_name
    from ethereum.udm_events

    where to_address='0x6b175474e89094c44da98b954eedeac495271d0f' and symbol!='DAI' and origin_function_name is not null
    group by 1 order by 2 desc
    )
    where col_value is not null
    --group by 1,2 order by 1

    ),

    price as (select date(hour) as date, symbol, avg(price) as price
    from ethereum.token_prices_hourly


    group by 1,2 order by 1)

    select date, price.symbol, price
    from col
    inner join price on col.collateral=price.symbol

    Run a query to Download Data