KaskoazulDistribution of holders USDC & USDT count_if
Updated 2022-02-08
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
›
⌄
--Algorand Stablecoin Popularity USDC vs USDT
--Question 17: Now that xBacked(a decentralized stablecoin: https://www.xbacked.io/) is in testnet, let’s take a look at two of the biggest stable coins on Algorand: USDC and USDT.
--What’s the number of people who currently hold USDC vs USDT (Tip: Use the Account asset table)
--Create a time series chart counting the number of transactions a day for each stablecoin(Tip: Use the asset_transfer_transaction table)
--Create 1 chart for each stablecoin visualizing the current distribution of holders. 3a. Does one have a better distribution than the other? If so, explain why.
--Tip: USDC’s asset ID is 31566704 USDT’s asset ID is 312769
SELECT
asset_name,
--count_if(amount = 0) as BACTERIA,
count_if(amount > 0 AND amount <= 1000) as MOUSE,
count_if(amount > 1000 AND amount <=10000) as CAT,
count_if(amount > 10000 AND amount <=100000) as DOG,
count_if(amount > 100000 AND amount <= 1000000) as HORSE,
count_if(amount > 1000000 AND amount <= 10000000) as ELEPHANT,
count_if(amount > 10000000 ) as DINOSAUR,
--count_if(amount > 0),
MOUSE+CAT+DOG+HORSE+ELEPHANT+DINOSAUR as Total
FROM
algorand.account_asset
WHERE
asset_id = 31566704 --USDC
GROUP BY 1
UNION SELECT
asset_name,
--count_if(amount = 0) as BACTERIA,
count_if(amount > 0 AND amount <= 1000) as MOUSE,
count_if(amount > 1000 AND amount <=10000) as CAT,
count_if(amount > 10000 AND amount <=100000) as DOG,
count_if(amount > 100000 AND amount <= 1000000) as HORSE,
count_if(amount > 1000000 AND amount <= 10000000) as ELEPHANT,
count_if(amount > 10000000 ) as DINOSAUR,
--count_if(amount > 0),
MOUSE+CAT+DOG+HORSE+ELEPHANT+DINOSAUR as Total
Run a query to Download Data