0xHaM-dTtl New vs Recurring Traders
Updated 2024-10-22
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 nearSwapEvent as (
select
block_timestamp,
TX_HASH,
TRADER,
coalesce(AMOUNT_OUT_USD, AMOUNT_IN_USD) as swap_vol
from near.defi.ez_dex_swaps
where block_timestamp::date >= '2024-01-01'
)
, aptosSwapEvent as (
select
block_timestamp,
TX_HASH,
SWAPPER as TRADER,
coalesce(AMOUNT_OUT_USD, AMOUNT_IN_USD) as swap_vol
from aptos.defi.ez_dex_swaps
where block_timestamp::date >= '2024-01-01'
)
,DAU_u as (
SELECT
'Near' as chain,
date_trunc('day', BLOCK_TIMESTAMP) as dt,
count(DISTINCT TRADER) as Active_users
FROM nearSwapEvent
GROUP BY 1,2
UNION all
SELECT
'Aptos' as chain,
date_trunc('day', BLOCK_TIMESTAMP) as dt,
count(DISTINCT TRADER) as Active_users
FROM aptosSwapEvent
GROUP BY 1,2
)
,new as (
SELECT
chain,
QueryRunArchived: QueryRun has been archived