nsa2000w4
Updated 2022-12-07
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
›
⌄
-- this code is thankfully burrowed from 0xHaM☰d: https://app.flipsidecrypto.com/dashboard/5hamvc
with pricTb as (
select
timestamp::date as p_date,
avg(price_usd) as usdprice
from flow.core.fact_prices
where symbol = 'FLOW'
and source = 'coinmarketcap'
group by 1
)
, laligaTb as (
select
BLOCK_TIMESTAMP::date as date,
row_number () over (order by date) as day_rank,
'LaLiga Golazos' as collection,
buyer,
COUNT(DISTINCT tx_id) as sales_cnt,
sum(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as volume
from flow.core.ez_nft_sales s join pricTb p on s.block_timestamp::Date = p.p_date
where nft_collection in ('A.87ca73a41bb50ad5.Golazos')
and tx_succeeded = 'TRUE'
GROUP by 1,3,4
qualify day_rank <= 7
-- ORDER by 1 ASC
-- limit 30
)
, TopShotTb as (
select
BLOCK_TIMESTAMP::date as day,
row_number () over (order by day) as d_rank,
'TopShot' as collection,
s.buyer,
COUNT(DISTINCT tx_id) as sales_cnt,
sum(case when currency = 'A.1654653399040a61.FlowToken' then price*usdprice else price end) as volume
from flow.core.ez_nft_sales s join pricTb p on s.block_timestamp::Date = p.p_date
JOIN laligaTb c on s.buyer = c.buyer
Run a query to Download Data