0xHaM-dSwap || New vs Recurring Traders
Updated 2025-02-23
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 swapEvent as (
select
block_timestamp,
platform,
tx_hash,
ORIGIN_FROM_ADDRESS as user,
symbol_in,
symbol_out,
amount_in_usd,
amount_out_usd,
nvl(amount_in_usd, amount_out_usd) as amount_usd
from kaia.defi.ez_dex_swaps
WHERE platform ilike 'klayswap%'
)
,DAU_u as (
SELECT
date_trunc('day', BLOCK_TIMESTAMP) as dt,
count(DISTINCT user) as Active_users
FROM swapEvent
GROUP BY 1
)
,new as (
SELECT
date_trunc('day', first_tx) as dt,
count(DISTINCT user) as new_user
FROM (
SELECT
user,
min(block_timestamp) as first_tx
FROM swapEvent
GROUP BY 1
)
GROUP BY 1
)
SELECT
QueryRunArchived: QueryRun has been archived