winnie-fsOver time LSD Gov token copy
Updated 2023-04-12
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
29
30
31
32
33
34
35
36
›
⌄
-- forked from Deebs-DeFi-I-Orbital-Command-j9fRbz / Over time LSD Gov token @ https://staging.flipsidecrypto.xyz/Deebs-DeFi-I-Orbital-Command-j9fRbz/q/2023-04-11-06-45-pm-7O8yLp
-- forked from LSD Gov token Whales @ https://flipsidecrypto.xyz/edit/queries/a9631628-da01-4941-a728-b77b6c0e66aa
with price as (
select
Symbol,
TOKEN_ADDRESS,
date_trunc('day',HOUR) AS date,
avg(price) as usdprice
from crosschain.core.ez_hourly_prices
WHERE HOUR BETWEEN {{start_date}} AND {{end_date}}
group by 1,2,3
),
holdings as(
SELECT
date_trunc('day',BLOCK_TIMESTAMP) AS date,
MAX(BALANCE/POW(10,18)) AS Balance_User,
USER_ADDRESS,
CASE
WHEN Contract_ADDRESS = lower('0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32') THEN 'LIDO'
WHEN Contract_ADDRESS = lower('0xD33526068D116cE69F19A9ee46F0bd304F21A51f') THEN 'RocketPool RPL'
WHEN Contract_ADDRESS = lower('0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0') THEN 'FRAX FXS'
WHEN Contract_ADDRESS = lower('0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2') THEN 'Stakewise SWISE'
WHEN Contract_ADDRESS = lower('0x30D20208d987713f46DFD34EF128Bb16C404D10f') THEN 'Stader SD'
WHEN Contract_ADDRESS = lower('0x8290333ceF9e6D528dD5618Fb97a76f268f3EDD4') THEN 'ANKR aETH'
END as Token,
Contract_ADDRESS
FROM ethereum.core.fact_token_balances
WHERE Contract_ADDRESS IN (
lower('0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32'),
lower('0xD33526068D116cE69F19A9ee46F0bd304F21A51f'),
lower('0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0'),
lower('0x8290333ceF9e6D528dD5618Fb97a76f268f3EDD4'),
lower('0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2'),
Run a query to Download Data