BlockTrackermain query
Updated 2025-01-08
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 invariant_txs as (
select
tx_id ,
signers[0] as swapper
from eclipse.core.fact_events
where program_id = 'iNvTyprs4TX8m6UeUEkeqDFjAL9zRCRWcexK9Sd4WEU'
and block_timestamp::date >= '2024-10-22'
)
, swap_txs as (
select
tx_id ,
swapper
from eclipse.core.fact_transactions
join invariant_txs using(tx_id)
join LATERAL FLATTEN (log_messages) as f
where
f.value IN ('Program log: INVARIANT: SWAP','Program log: Instruction: Swap')
--and tx_id = 'B7NSwxgpB9HwdySaE1QsUpiTDvQhZSiSNY6DBEaz28RV5wAbRJydb2mGwoRyR9L4Sfk3uM73h96WNSYPQ9YqYim'
and block_timestamp::date >= '2024-10-22'
)
,
swap_asc_tx as (
select
*
from eclipse.core.fact_transfers
join swap_txs using(tx_id)
where block_timestamp::date >= '2024-10-22'
and SUCCEEDED
qualify row_number () over (partition by tx_id order by inner_index desc) = 1
)
,
swap_desc_tx as (
select
*
from eclipse.core.fact_transfers
join swap_txs using(tx_id)