zakkisyedCumulative LST Withdrawals [Hourly] copy
Updated 2024-05-06
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
›
⌄
SELECT
hourly,
asset,
SUM(withdraw_amount) OVER (PARTITION BY asset ORDER BY hourly ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_withdraw_amount
FROM (
SELECT
DATE_TRUNC('hour', block_timestamp) AS hourly,
CASE
WHEN decoded_log:asset = '0xa35b1b31ce002fbf2058d22f30f95d405200a15b' THEN 'ETHx'
WHEN decoded_log:asset = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' THEN 'stETH'
WHEN decoded_log:asset = '0xac3e018457b222d93114458476f3e3416abbe38f' THEN 'sfrxETH'
END AS asset,
SUM(decoded_log:rsETHUnstaked/POW(10,18)) AS withdraw_amount
FROM
ethereum.core.ez_decoded_event_logs
WHERE
event_name = 'AssetWithdrawalQueued'
GROUP BY
hourly,
CASE
WHEN decoded_log:asset = '0xa35b1b31ce002fbf2058d22f30f95d405200a15b' THEN 'ETHx'
WHEN decoded_log:asset = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' THEN 'stETH'
WHEN decoded_log:asset = '0xac3e018457b222d93114458476f3e3416abbe38f' THEN 'sfrxETH'
END
) AS subquery
ORDER BY
hourly DESC, asset;
QueryRunArchived: QueryRun has been archived