hbd1994Swaps in Base - Daily Overview - Swappers and New Swappers
Updated 2023-08-29
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 first_date as (
select
distinct ORIGIN_FROM_ADDRESS as swapper,
min(block_timestamp::date) as first_swap_date
from base.defi.ez_dex_swaps
group by 1
order by 1),
newcomers as (
select
first_swap_date,
count(distinct swapper) as Newcomer,
sum(Newcomer) over (order by first_swap_date) as cml_newcomer
from first_date
where first_swap_date >= '{{Start_Date}}'
and first_swap_date <= '{{End_Date}}'
group by 1),
daily_swappers as (
select
date(block_timestamp) as "Date",
count(distinct ORIGIN_FROM_ADDRESS) as "Swapper"
from base.defi.ez_dex_swaps
where block_timestamp >= '{{Start_Date}}'
and block_timestamp <= '{{End_Date}}'
group by 1
order by 1)
select
"Date",
"Swapper" as "Daily Swappers",
Newcomer as "Daily New Swappers",
cml_newcomer as "Cumulative New Swappers"
from daily_swappers
join newcomers on "Date" = first_swap_date
order by 1
Run a query to Download Data