tkvresearchupset-harlequin
Updated 14 hours 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
›
⌄
with delegate_data as
(select
BLOCK_TIMESTAMP,
TX_HASH,
'0x' || SUBSTR(PARSE_JSON(TOPICS)[1]::string, -40) AS user_wallet,
-- '0x' || SUBSTR(PARSE_JSON(TOPICS)[2]::string, -40) AS validator_address,
TOPICS,
utils.udf_hex_to_int(DATA)/power(10,18) as data_raw
FROM berachain.testnet.fact_event_logs
where ORIGIN_TO_ADDRESS = '0xbda130737bdd9618301681329bf2e46a016ff9ad'
and
contract_address = '0xbda130737bdd9618301681329bf2e46a016ff9ad'
and
TX_SUCCEEDED = 'TRUE'
and
ORIGIN_FUNCTION_SIGNATURE = '0x95c0e232'),
undelegate_data as (
select
BLOCK_TIMESTAMP,
TX_HASH,
'0x' || SUBSTR(PARSE_JSON(TOPICS)[1]::string, -40) AS user_wallet,
-- '0x' || SUBSTR(PARSE_JSON(TOPICS)[2]::string, -40) AS validator_address,
TOPICS,
utils.udf_hex_to_int(DATA)/power(10,18) as data_raw
FROM berachain.testnet.fact_event_logs
where
ORIGIN_TO_ADDRESS = '0xbda130737bdd9618301681329bf2e46a016ff9ad'
and
contract_address = '0xbda130737bdd9618301681329bf2e46a016ff9ad'
and
TX_SUCCEEDED = 'TRUE'
and
ORIGIN_FUNCTION_SIGNATURE = '0xe1f63d2e'
),