yasmin-n-d-r-hSolanart Collection solana open bounty
Updated 2022-12-06Copy 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 sol_price AS (
select
date_trunc('day', BLOCK_TIMESTAMP) as day,
(
sum(SWAP_TO_AMOUNT)/ sum(SWAP_FROM_AMOUNT)
) as price
from
solana.core.fact_swaps
where
SWAP_FROM_MINT = 'So11111111111111111111111111111111111111112'
and SWAP_TO_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
group by
1
),
tb AS (
SELECT
date_trunc('day', BLOCK_TIMESTAMP) AS date,
LABEL AS collection,
sum(SALES_AMOUNT * price) AS Volume,
rank() over (
partition by date
order by
Volume desc
) As rank
from
solana.core.fact_nft_sales
inner join sol_price on sol_price.day = date_trunc('day', BLOCK_TIMESTAMP)
inner join solana.core.dim_labels on MINT = ADDRESS
where
MARKETPLACE in (
'solanart'
)
and SALES_AMOUNT is not NULL
and date > CURRENT_DATE - 30
group by
1,
Run a query to Download Data