Updated 2021-08-03
    with anch as (
    select
    date_trunc('day', date) as t,
    AVG(balance_usd) as anch
    from terra.daily_balances
    where address like 'terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s'
    and currency like 'UST'
    and date > current_date - 14
    group by 1
    ), mir as (
    select
    date_trunc('day', date) as t,
    AVG(balance_usd) as mir
    from terra.daily_balances
    where address like 'terra1wfz7h3aqf4cjmjcvc6s8lxdhh7k30nkczyf0mj'
    -- and currency like 'UST'
    and date > current_date - 14
    group by 1
    )


    SELECT *
    from mir join anch on mir.t = anch.t













    Run a query to Download Data