TYPE | UNIQUE_TRADERS | TOTAL_TRADES | TOTAL_VOLUME | |
---|---|---|---|---|
1 | Sell | 5843 | 289210 | 187239321.85 |
2 | Buy | 17864 | 218369 | 210283306.19 |
Updated 2025-02-02
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
›
⌄
WITH swaps AS (
SELECT DATE_TRUNC('day', BLOCK_TIMESTAMP) as date,
CASE
WHEN TOKEN_IN = '0xffff003a6bad9b743d658048742935fffe2b6ed7' THEN 'Sell'
ELSE 'Buy' END as direction,
ORIGIN_FROM_ADDRESS as trader,
TX_HASH,
NULLIF(AMOUNT_IN_USD, 0) AS amount_usd,
NULLIF(AMOUNT_OUT_USD, 0) AS amount_out_usd,
TOKEN_IN,
TOKEN_OUT
FROM avalanche.defi.ez_dex_swaps
WHERE TOKEN_IN = '0xffff003a6bad9b743d658048742935fffe2b6ed7'
OR TOKEN_OUT = '0xffff003a6bad9b743d658048742935fffe2b6ed7'
)
SELECT
direction as type,
COUNT(DISTINCT trader) as unique_traders,
COUNT(*) as total_trades,
SUM(COALESCE(amount_usd, amount_out_usd)) as total_volume
FROM swaps
GROUP BY direction;
Last run: 17 days ago
2
69B
3s