Afonso_Diaztotal
Updated 2024-12-13
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
main as (
select
tx_hash,
block_timestamp,
a.event_data:user as user,
a.event_data:x_type_info as token_x,
a.event_data:y_type_info as token_y,
b.event_data:maker_side as side,
(b.event_data:price * b.event_data:size) / 1e6 as amount_usd
from
aptos.core.fact_events a
join
aptos.core.fact_events b using(tx_hash, success)
where
payload_function = '0x1c3206329806286fd2223647c9f9b130e66baeb6d7224a18c1f642ffe48f3b4c::panora_trade::place_market_order_user'
and a.event_module = 'panora_trade'
and a.event_resource = 'PlaceMarketOrderEvent'
and b.event_module = 'user'
and b.event_resource = 'FillEvent'
and success = 1
),
final as (
select
main.*,
a.symbol as symbol_x,
b.symbol as symbol_y,
symbol_x || ' - ' || symbol_y as pair
from
main
left join
aptos.core.dim_tokens a on token_x = a.token_address
left join
aptos.core.dim_tokens b on token_y = b.token_address
QueryRunArchived: QueryRun has been archived