LoriYagami-3606MakerDao1 withdrawal 1.1
    Updated 2022-09-07
    with

    price as (
    select
    HOUR::date as time,symbol, avg(PRICE) as price
    from ethereum.core.fact_hourly_token_prices
    group by 1,2
    )

    select

    SUM (AMOUNT_WITHDRAWN * PRICE) as USD_withdrawn,
    COUNT (DISTINCT TX_HASH) AS tx_count,
    COUNT (DISTINCT WITHDRAWER) AS withdrawers
    FROM ethereum.maker.ez_withdrawals a
    LEFT JOIN price b
    on a.block_timestamp::date = b.time
    and a.symbol= b.symbol
    where TX_STATUS = 'SUCCESS' and BLOCK_TIMESTAMP::date >= '2022-01-01'