datavortexbuying assets
Updated 2024-12-17
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 stablecoins AS (
SELECT DISTINCT
symbol_in AS stable_token
FROM kaia.defi.ez_dex_swaps
WHERE symbol_in IN (
'oUSDT', 'USDC.e', 'KDAI', 'USDC', 'CUSDT', 'mUSDC', 'mUSDT', 'oUSDC', 'oWBTC', 'USDT'
)
),
swaps AS (
SELECT
tx_hash,
symbol_in,
symbol_out,
amount_in_usd,
origin_from_address,
block_timestamp::DATE AS swap_date
FROM kaia.defi.ez_dex_swaps
)
, total_swap_count AS (
SELECT
COUNT(DISTINCT tx_hash) AS total_swap_count,
SUM(amount_in_usd) AS total_swap_volume_usd,
COUNT(DISTINCT origin_from_address) AS total_trader_count
FROM swaps
WHERE symbol_in IS NOT NULL
)
, stablecoin_swap_count AS (
SELECT
COUNT(DISTINCT swaps.tx_hash) AS stablecoin_swap_count,
SUM(swaps.amount_in_usd) AS stablecoin_swap_volume_usd,
COUNT(DISTINCT swaps.origin_from_address) AS stablecoin_trader_count
FROM swaps
QueryRunArchived: QueryRun has been archived