MEDIAN_HOURS | AVERAGE_HOURS | |
---|---|---|
1 | 144 | 147.729753 |
lidoWithdrawals finalization time
Updated 4 days ago
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
›
⌄
-- retrieves the minimum and maximum withdrawal IDs for the last 7 days
with finalized_ids AS (
SELECT
BLOCK_TIMESTAMP
, DECODED_LOG:from AS "from"
, DECODED_LOG:to AS "to"
FROM ethereum.core.ez_decoded_event_logs
WHERE CONTRACT_ADDRESS = '0x889edc2edab5f40e902b864ad4d7ade8e412f9b1' --Lido withrawal queue
AND EVENT_NAME = 'WithdrawalsFinalized'
)
-- aggregates data from previous CTE
, aggr_finalized_ids AS (
SELECT
MIN("from") AS min_id
, MAX("to") AS max_id
FROM finalized_ids
WHERE BLOCK_TIMESTAMP::date >= date_trunc('day', CURRENT_DATE - interval '7 day')
)
-- gets withdrawal records within the range defined by the minimum and maximum IDs
, requested_ids AS (
SELECT
BLOCK_TIMESTAMP
, DECODED_LOG:requestId AS requestId
, DECODED_LOG:amountOfStETH AS amountOfStETH
FROM ethereum.core.ez_decoded_event_logs
WHERE CONTRACT_ADDRESS = '0x889edc2edab5f40e902b864ad4d7ade8e412f9b1'
AND EVENT_NAME = 'WithdrawalRequested'
AND DECODED_LOG:requestId >= (SELECT min_id FROM aggr_finalized_ids)
AND DECODED_LOG:requestId <= (SELECT max_id FROM aggr_finalized_ids)
)
-- time difference between withdrawal request and finalization
, latency AS (
SELECT
r.requestId
Last run: 4 days ago
1
18B
30s