Afonso_DiazCategorizing transactions based on stacked volume
Updated 2025-02-14
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
pricet as (
select
hour::date as date,
avg(price) as token_price_usd
from
ronin.price.ez_prices_hourly
where
symbol = 'RON'
group by 1
),
main as (
select
tx_hash,
block_timestamp,
'0x' || right(topics[2], 40) as pool_id,
origin_from_address as user,
utils.udf_hex_to_int(data)::bigint / 1e18 as amount,
amount * token_price_usd as amount_usd,
case origin_function_signature
when '0x4d99dd16' then 'Unstake'
when '0x5c19a95c' then 'Stake'
when '0x097e4a9d' then 'Reward Claimed'
end as event_name
from
ronin.core.fact_event_logs
left join
pricet on block_timestamp::date = date
where
tx_succeeded
and origin_to_address = '0x545edb750eb8769c868429be9586f5857a768758'
and topics[0] in ('0xe5541a6b6103d4fa7e021ed54fad39c66f27a76bd13d374cf6240ae6bd0bb72b', '0x4d10bd049775c77bd7f255195afba5088028ecb3c7c277d393ccff7934f2f92c')
and origin_function_signature in ('0x4d99dd16', '0x5c19a95c', '0x097e4a9d')
QueryRunArchived: QueryRun has been archived