DataBeingAverage ETH holding of a Metamask
Updated 2022-06-23
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
with metamask_wallets as(SELECT distinct from_address as Metamask_Wallet
FROM ethereum.core.fact_transactions
WHERE to_address = lower('0x881D40237659C251811CEC9c364ef91dC08D300C')),
eth_price as (select price, TRIM(symbol, 'W') as symbol
FROM ethereum.core.fact_hourly_token_prices
WHERE symbol = 'WETH'
ORDER BY HOUR
DESC
LIMIT 1)
SELECT avg(amount_usd) as avg_usd, avg(amount_usd / e.price) as balance_eth, e.symbol
FROM flipside_prod_db.ethereum.erc20_balances as b
JOIN metamask_wallets as m on b.user_address = m.Metamask_Wallet
JOIN eth_price as e on e.symbol = b.symbol
WHERE balance_date = CURRENT_DATE and b.symbol = 'ETH'
GROUP BY 3
Run a query to Download Data