nilocollections
Updated 2023-06-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
›
⌄
select
date_trunc('day', block_timestamp) as Date,
contract_name,
count(DISTINCT tx_id) as Txn,
count(DISTINCT buyer) as Buyers,
count(DISTINCT seller) as Sellers,
SUM(
CASE
WHEN CURRENCY = 'A.1654653399040a61.FlowToken' THEN PRICE * FLOW_USD
ELSE PRICE
END
) AS USD,
rank() over (
partition by
contract_name
order by
Date asc
) as Day,
sum(Txn) over (
partition by
contract_name
order by
date
) as cum_sales,
sum(Buyers) over (
partition by
contract_name
order by
date
) as cum_Buyers,
sum(USD) over (
partition by
contract_name
order by
date
) as cum_USD