mz0111open analyse 2
Updated 2022-09-25Copy Reference Fork
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 tab1 as(select
distinct BUYER_ADDRESS as "addr",
max(BLOCK_TIMESTAMP):: DATE as "last nft buy",
count(*) as "nft buy"
from ethereum.core.ez_nft_sales
where EVENT_TYPE = 'sale'
and CURRENCY_SYMBOL = 'ETH'
group by 1
order by 3 DESC
)
SELECT
distinct(ORIGIN_FROM_ADDRESS) as "add",
max(BLOCK_TIMESTAMP) :: date as "last swap",
'ETH' AS "BLOCKCHAIN",
count(*) as "swap num",
"nft buy",
"last nft buy",
DATEDIFF( day,"last swap","last nft buy" ) as "time diffrence",
case when "time diffrence" < 0 then -("time diffrence")
else ("time diffrence")
end as timediff
from ethereum.core.ez_dex_swaps b
join tab1 a on a."addr" = b.ORIGIN_FROM_ADDRESS
group by 1 , 5 , 6
order by 5 desc
limit 10
)
UNION ALL
(with tab1 as
(select
distinct PURCHASER as "addr",
max(BLOCK_TIMESTAMP):: DATE as "last nft buy",
Run a query to Download Data