farid-c9j0VMalgo2
Updated 2022-12-05
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 price as (
select
timestamp::date as day,
avg(price_usd) as flow_price
from flow.core.fact_prices
where token_contract = 'A.1654653399040a61.FlowToken'
group by 1
),
base as (
select
*,
case
when currency in ('A.ead892083b3e2c6c.FlowUtilityToken', 'A.1654653399040a61.FlowToken') then price * flow_price else price end as nft_price
from flow.core.ez_nft_sales join price on block_timestamp::date = day
where
nft_collection = 'A.e4cf4bdc1751c65d.AllDay' and tx_succeeded = 'TRUE'
),
base_2 as(
select
date_trunc('day', block_timestamp) as date,
case when date = '2022-11-24' then 'Thanksgiving day-2022'
when date > '2022-11-24' and date <='2022-12-01' then 'One week After Thanksgiving-2022'
when date < '2022-11-24' and date >='2022-11-17' then 'One week befor Thanksgiving-2022'
when date < '2022-11-17' and date >='2022-11-10' then 'Two week befor Thanksgiving-2022'
when date < '2022-11-10' and date >='2022-11-01' then 'Three week befor Thanksgiving-2022'
end as period,
tx_id,
buyer,
seller,
flow_price,
nft_price
from base
where date >='2022-11-03' and date <='2022-12-01'
)
select period ,count(distinct tx_id) as sales_count,
count(distinct buyer) as unique_buyer,
Run a query to Download Data