superflyDistributing the volume of transactions between wallets
Updated 2024-10-21Copy Reference Fork
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 wallet_totals AS (
SELECT
origin_from_address AS wallet,
SUM(raw_amount / 1e6) AS total_volume
FROM
avalanche.core.fact_token_transfers
WHERE
contract_address IN (
'0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7', -- USDT
'0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e', -- USDC
'0xd586e7f844cea2f87f50152665bcbc2c279d8d70', -- DAI.e
'0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664', -- USDC.e
'0xc7198437980c041c805a1edcba50c1ce5db95118', -- USDT.e
'0x130966628846bfd36ff31a822705796e8cb8c18', -- MIM
'0x1c20e891bab6b1727d14da358fae2984ed9b59eb' -- TUSD
)
GROUP BY
wallet
)
SELECT
CASE
WHEN total_volume < 100 THEN 'Less than $100'
WHEN total_volume >= 100 AND total_volume < 1000 THEN '$100 - $1000'
WHEN total_volume >= 1000 AND total_volume < 10000 THEN '$1000 - $10000'
ELSE 'More than $10000'
END AS volume_range,
COUNT(wallet) AS wallet_count
FROM
wallet_totals
GROUP BY
volume_range
ORDER BY
wallet_count DESC;
QueryRunArchived: QueryRun has been archived