TIMESPAN | TOKEN_COUNT | PERCENT | |
---|---|---|---|
1 | Less than a day | 105522 | 59.2 |
2 | Less than a week | 33037 | 18.5 |
3 | Week to a month | 13100 | 7.4 |
4 | Month to a year | 26427 | 14.8 |
5 | More than a year | 97 | 0.1 |
matejchianaliza aktivnosti trajanje graf
Updated 2025-02-10
999
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 tokens_eth as (
select address
from ethereum.core.dim_contracts
where symbol ilike '%trump%' or name ilike '%trump%'
),
swaps_eth as (
select
min(block_timestamp) as first_swap,
max(block_timestamp) as last_swap,
from ethereum.defi.ez_dex_swaps SWAPS
join tokens_eth TOKENS on (TOKENS.address = SWAPS.token_in or TOKENS.address = SWAPS.token_out)
group by TOKENS.address
),
timespan_eth as (
select
case
when timestampdiff(day, first_swap, last_swap) < 1 then 'Less than a day'
when timestampdiff(day, first_swap, last_swap) between 1 and 7 then 'Less than a week'
when timestampdiff(day, first_swap, last_swap) between 8 and 30 then 'Week to a month'
when timestampdiff(day, first_swap, last_swap) between 31 and 365 then 'Month to a year'
else 'More than a year'
end as timespan,
count(*) as token_count,
min(timestampdiff(day, first_swap, last_swap)) as min_time_span -- mora bit poseben stolpec, da lahko urediš končni order by
from swaps_eth
group by timespan
)
select
timespan,
token_count,
round((token_count * 100.0) / sum(token_count) over (), 1) as percent
from timespan_eth
order by min_time_span
Last run: 2 months ago
5
154B
47s