maybeyonasopyn_tvl_uniswap
Updated 2022-06-28
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
›
⌄
with
sqth_bals as (
select
balance_date,
non_adjusted_balance/pow(10,18) as sqth_bal
from ethereum.erc20_balances
where user_address = lower('0x82c427adfdf2d245ec51d8046b41c4ee87f0d29c')
and contract_address = '0xf1b99e3e573a1a9c5e6b2ce818b617f0e664e86b'
),
weth_bals as (
select
balance_date,
non_adjusted_balance/pow(10,18) as weth_bal,
price as weth_price
from ethereum.erc20_balances
where user_address = lower('0x82c427adfdf2d245ec51d8046b41c4ee87f0d29c')
and contract_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
)
select
s.balance_date,
sqth_bal,
weth_bal,
weth_price,
weth_bal/sqth_bal as sqth_eth_price,
sqth_eth_price*weth_price as sqth_usd_price
from sqth_bals s join weth_bals w on s.balance_date = w.balance_date
Run a query to Download Data