SalehMagic Eden Volume Trends- total sales volume per day since January 1st
Updated 2022-03-15Copy 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
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH secondary_sales AS ( SELECT block_timestamp
, block_id
, blockchain
, recent_block_hash
, tx_id
, mint
,succeeded
, pretokenbalances[0]:uiTokenAmount:amount as amount1
, posttokenbalances
, instruction
, inner_instruction
,inner_instruction:instructions[0]:parsed:info:lamports/POW(10,9) as price_0
, inner_instruction:instructions[1]:parsed:info:lamports/POW(10,9) as price_1
, inner_instruction:instructions[2]:parsed:info:lamports/POW(10,9) as price_2
, inner_instruction:instructions[3]:parsed:info:lamports/POW(10,9) as price_3
, COALESCE (inner_instruction:instructions[4]:parsed:info:lamports/POW(10,9), 0) as price_4
, (price_0 + price_1 + price_2 + price_3 + price_4) AS sales_price
FROM solana.nfts
WHERE date(block_timestamp) >= '2022-01-01'
-- AND pretokenbalances[0]:uiTokenAmount:amount::number=1
AND instruction:programId in( 'M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K','MEisE1HzehtrDpAAT8PnLHjpSSkRYakotTuJRPjTpo8')
AND array_size(inner_instruction:instructions) > 2
and SUCCEEDED=TRUE
)
select 'total_price_0' as type,sum(PRICE_0) as price from secondary_sales
union all select 'total_price_1' as type,sum(price_1) as price_1 from secondary_sales
union all select 'total_price_2' as type,sum(price_2) as price_2 from secondary_sales
union all select 'total_price_3' as type,sum(price_3) as price_3 from secondary_sales
union all select 'total_price_4' as type,sum(price_4) as price_4 from secondary_sales
union all select 'total_sales_price' as type,sum(sales_price) as sales_price from secondary_sales
Run a query to Download Data