boomer77vol stables vs btc
    Updated 2022-02-10
    with raw as (select date_trunc('day', block_timestamp) as dt, sum(amount_usd) as volume_mim, count(distinct tx_id) as tx_count
    from ethereum.udm_events
    where symbol in ('MIM','USDC','UST','DAI','USDT') and event_type = 'erc20_transfer' and to_label_type = 'dex' and block_timestamp >= '2022-01-01'
    group by 1),

    price as (select date_trunc('day', hour) as dt, avg(price) as BTC
    from ethereum.token_prices_hourly
    where symbol in ('WBTC')
    group by 1)

    select a.dt, a.volume_mim as volume, a.tx_count, b.btc
    from raw a
    left join price b on a.dt = b.dt
    Run a query to Download Data