0xaimanTotal Sales from NFT ($FUSD)
Updated 2023-04-11
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
›
⌄
with a as (
select date_trunc('month',block_timestamp) as month,currency, case when currency = 'A.4eded0de73020ca5.FazeUtilityCoin' then 'Faze Utility Coin'
when currency = 'A.1654653399040a61.FlowToken' then 'Flow Token'
when currency = 'A.3c5959b568896393.FUSD' then 'FUSD'
when currency = 'A.b19436aae4d94622.FiatToken' then 'Fiat Token'
when currency = 'A.ead892083b3e2c6c.DapperUtilityCoin' then 'Dapper Utility Token'
end as currency_symbol
, sum(price) as tot_sales_flow ,
sum(tot_sales_flow) OVER(ORDER BY month asc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cum_tot_sales_flow
from flow.core.ez_nft_sales
group by 1,2,3 order by 1)
, b as (
select date_trunc('month', timestamp) as month, token_contract, avg(price_usd) as price_usd
from flow.core.fact_prices
group by 1,2
)
, c as (select a.*, b.price_usd, CUM_TOT_SALES_FLOW*b.price_usd as cum_tot_sales_usd
from a inner join b on a.currency = b.token_contract and a.month=b.month
where a.month>'2022-08-31'
order by 1 desc)
select currency_symbol , CUM_TOT_SALES_FLOW as tot_sales_by_token, CUM_TOT_SALES_USD from c
where currency_symbol= 'FUSD'
Run a query to Download Data