anomoneWhich is faster - BTC
Updated 2022-02-10
99
1
2
3
4
5
6
7
8
9
10
11
12
13
›
⌄
SELECT balance_date ,
max(CASE WHEN symbol = 'WBTC' THEN (NON_ADJUSTED_BALANCE/1e8)* (SELECT price
from
ethereum.token_prices_hourly WHERE token_address = LOWER('0x2260fac5e5542a773aa44fbcfedf7c193bc2c599')
and hour = (SELECT max(hour) from ethereum.token_prices_hourly)
) END) as BTC_USD ,
max(CASE WHEN symbol is null THEN (NON_ADJUSTED_BALANCE/1e8) * 44921.2 END) as rbtc_USD ,
BTC_USD + rbtc_USD as "WBTC TVL"
FROM ethereum.erc20_balances
WHERE user_address = LOWER('0x65a833afdc250d9d38f8cd9bc2b1e3132db13b2f') -- btc
AND date_trunc('day',balance_date) >= date_trunc('day',getdate()) - interval'150 days'
GROUP BY balance_date
Run a query to Download Data