MoDeFi#solana Flash Bounty- Saga 6
Updated 2022-06-24Copy Reference Fork
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
›
⌄
with pre_orders as
( select distinct user
from (
select INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:mint as token,
INNER_INSTRUCTIONS[1]:instructions[0]:parsed:info:owner as owner,
INNER_INSTRUCTIONS[1]:instructions[1]:parsed:info:amount/1e6 as amount,
INNER_INSTRUCTIONS[1]:instructions[1]:parsed:info:authority as user,
TX_ID
from solana.core.fact_transactions
where --TX_ID='4jBq7eb7cjeX98AiPB6aN66TB8oFUdUxmEDEzAG5mG9QMz5WiSnp7MSCKJMtyztMdwQFcahnqRDeT2xUWuZfEn4X' --PROGRAM_ID='781wH11JGQgEoBkBzuc8uoQLtp8KxeHk1yZiS1JhFYKy' and SUCCEEDED=TRUE
token='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' and owner='781wH11JGQgEoBkBzuc8uoQLtp8KxeHk1yZiS1JhFYKy' and SUCCEEDED=TRUE
and BLOCK_TIMESTAMP::date>='2022-06-22')
)
select *,
row_number() over (order by total_amount desc) as rank
from (
select purchaser, sum(sales_amount) as total_amount
from solana.fact_nft_sales
where succeeded=true and purchaser in (select * from pre_orders)
group by purchaser
order by total_amount desc
limit 20
)
Run a query to Download Data