ArioTraderJoe New Swapper Over time
Updated 2023-10-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
›
⌄
-- forked from New Swapper Over time @ https://flipsidecrypto.xyz/edit/queries/98751a1e-7898-42a9-9c5a-886a48db756a
with
min_d as (
select
ORIGIN_FROM_ADDRESS as User_address,
min(date_trunc({{Granularity}}, BLOCK_TIMESTAMP)) as min_date
from
{{Blokchain}}.defi.ez_dex_swaps
where
1 = 1
and platform in ('trader-joe-v1', 'trader-joe-v2')
group by
1
)
SELECT
date_trunc({{Granularity}}, min_date) as date,
count(distinct User_address) as "# New Swapper",
count(DISTINCT ORIGIN_FROM_ADDRESS) as "# Sawpper"
from
{{Blokchain}}.defi.ez_dex_swaps a
join min_d b on date_trunc({{Granularity}}, block_timestamp) = date_trunc({{Granularity}},min_date)
where
min_date::date between '{{Start_date}}' and '{{End_date}}'
and platform in ('trader-joe-v1', 'trader-joe-v2')
group by
1
Run a query to Download Data