boomer77Untitled Query
Updated 2021-11-11
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
with uniswap AS
(select avg(token0_balance_adjusted)/avg(token0_balance_usd) as ust_uni, date_trunc('day', block_timestamp) as days
from uniswapv3.pool_stats
where token0_symbol = 'UST' and token1_symbol = 'USDT'
group by 2),
oracle as (select avg(price_usd) as UST_terra, currency, symbol, date_trunc('day',block_timestamp) as days
from terra.oracle_prices
where symbol = 'UST'
group by 2,3,4)
select A.UST_uni, B.days, B.UST_terra
from uniswap A
join oracle B on A.days = B.days
order by 2 desc
Run a query to Download Data