flyingfishJan 13thJup Limit Orders - Top Users copy
Updated 2024-01-16Copy Reference Fork
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
›
⌄
-- forked from Jup Limit Orders - Top Users @ https://flipsidecrypto.xyz/edit/queries/d969d943-fac5-4adf-8686-e521a0d19731
-- forked from Jup Limit Orders - Overall Stats @ https://flipsidecrypto.xyz/edit/queries/dfa8bd43-9c87-44af-95dd-2e25595727ad
-- forked from Jup Limit Orders - Overall Stats @ https://flipsidecrypto.xyz/edit/queries/dfa8bd43-9c87-44af-95dd-2e25595727ad
WITH fill_events AS (
SELECT
block_timestamp
, decoded_instruction:name AS event_name
, decoded_instruction
, tx_id
FROM solana.core.ez_events_decoded
WHERE 1 = 1
AND block_timestamp::date = '2024-01-13'
-- AND block_timestamp < current_date
-- AND block_timestamp::date = '2023-12-08'
AND program_id = 'jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu'
AND decoded_instruction:name = 'flashFillOrder'
AND succeeded
ORDER BY block_timestamp
)
, cte AS (
SELECT *
from solana.core.fact_events
WHERE 1 = 1
AND block_timestamp::date = '2024-01-13'
AND program_id = 'jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu'
AND tx_id IN (SELECT tx_id FROM fill_events)
----QUALIFY row_number() OVER (PARTITION BY tx_id ORDER BY index desc) = 1
)
, open_index AS (
SELECT
block_timestamp
QueryRunArchived: QueryRun has been archived