elsinaSome users metrics
Updated 2025-05-14
999
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 raw_tx AS (
SELECT
CASE
WHEN origin_function_signature = '0x617ba037' THEN 'Supply'
WHEN origin_function_signature = '0xa415bcad' THEN 'Borrow'
WHEN origin_function_signature = '0x573ade81' THEN 'Repay'
WHEN origin_function_signature = '0x69328dec' THEN 'Withdraw'
END AS states,
tx_hash,
from_address,
block_timestamp,
regexp_substr_all(SUBSTR(input_data, 11), '.{64}') AS segmented_data
FROM mezo.testnet.fact_transactions
WHERE
to_address = '0x9c55214751472788a06797d88f38af1e79eee018'
AND tx_succeeded = 'True'
AND origin_function_signature IN (
'0x617ba037', -- Supply
'0xa415bcad', -- Borrow
'0x573ade81', -- Repay
'0x69328dec' -- Withdraw
)
),
extracted AS (
SELECT
states,
tx_hash,
from_address,
block_timestamp,
'0x' || LOWER(RIGHT(segmented_data[0], 40)) AS token_address,
segmented_data[1] AS raw_amount
FROM raw_tx
),
decoded AS (
QueryRunArchived: QueryRun has been archived