HosseinUntitled Query
Updated 2023-01-26
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
mints as (
SELECT
trunc (x.block_timestamp,'day') as date,
case when x.block_timestamp < CURRENT_DATE-INTERVAL '1 MONTH' then 'Past activity' else 'Present activity' end as period,
count(distinct x.tx_id) as mints,
count(distinct x.purchaser) as minters,
sum(mint_price) as sol_volume_minted
from solana.core.fact_nft_mints x
WHERE x.block_timestamp >= CURRENT_DATE-INTERVAL '2 MONTHS' and mint_currency='So11111111111111111111111111111111111111111'
GROUP BY 1, 2
order by 1 asc
),
sales as (
select
trunc (y.block_timestamp,'day') as date,
case when y.block_timestamp < CURRENT_DATE-INTERVAL '1 MONTH' then 'Past activity' else 'Present activity' end as period,
count(distinct y.tx_id) as sales,
count(distinct y.purchaser) as buyers,
sum(sales_amount) as sol_volume_sold
from solana.core.fact_nft_sales y
WHERE y.block_timestamp >= CURRENT_DATE-INTERVAL '2 MONTHS'
GROUP BY 1, 2
order by 1 asc
)
select
y.date,y.period,
mints,minters, sol_volume_minted,
sales,buyers,sol_volume_sold
from mints x join sales y on x.date=y.DATE
order by 1 asc
select
block_timestamp::date as day,
Run a query to Download Data