datavortexselfish-rose
Updated 2024-11-06
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
›
⌄
SELECT
from_asset,
to_asset,
SUM(from_amount_usd) AS TotalVolumeUSD,
CASE
WHEN SUM(from_amount_usd) >= 1000000000 THEN
TO_CHAR(ROUND(SUM(from_amount_usd) / 1000000000, 2)) || 'B'
WHEN SUM(from_amount_usd) >= 1000000 THEN
TO_CHAR(ROUND(SUM(from_amount_usd) / 1000000, 2)) || 'M'
WHEN SUM(from_amount_usd) >= 1000 THEN
TO_CHAR(ROUND(SUM(from_amount_usd) / 1000, 2)) || 'K'
ELSE
TO_CHAR(SUM(from_amount_usd))
END AS TotalVolume2,
COUNT(DISTINCT tx_id) AS TotalTransactions,
CASE
WHEN COUNT(DISTINCT tx_id) >= 1000000 THEN
TO_CHAR(ROUND(COUNT(DISTINCT tx_id) / 1000000, 2)) || 'M'
WHEN COUNT(DISTINCT tx_id) >= 1000 THEN
TO_CHAR(ROUND(COUNT(DISTINCT tx_id) / 1000, 2)) || 'K'
ELSE
TO_CHAR(COUNT(DISTINCT tx_id))
END AS TotalTransactions2,
COUNT(DISTINCT from_address) AS ActiveSwappers,
CASE
WHEN COUNT(DISTINCT from_address) >= 1000000 THEN
TO_CHAR(ROUND(COUNT(DISTINCT from_address) / 1000000, 2)) || 'M'
WHEN COUNT(DISTINCT from_address) >= 1000 THEN
QueryRunArchived: QueryRun has been archived