flyingfishJup Limit Orders - Overall Stats
Updated 2024-02-27
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 - 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 > '2023-11-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 >= (SELECT min(block_timestamp) FROM fill_events)
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
, tx_id
, index AS index_in
, inner_instruction:instructions[0]:program AS token_program_in
-- , inner_instruction:instructions[0]:parsed:info:mint AS token_in
QueryRunArchived: QueryRun has been archived