adriaparcerisasTracking USDC & USDT: top 10 contracts and exchanges by volume swapped in USDC
Updated 2022-06-16
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
›
⌄
-- Track stablecoin activity on Solana since April 1st (not limited to but look into USDC, USDT, UST, USDH, UXD, PAI).
-- What have been the flows between coins and what was the result of the UST depegging in the Solana ecosystem?
-- What types of wallets hold a USDH, UXD, or PAI compared to a USDC and what are users doing with those coins?
WITH
swaps_in as (
SELECT
--trunc(block_timestamp,'day') as date,
swap_program,
swapper,
case when swap_to_mint ='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then 'USDC'
when swap_to_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' then 'USDT'
--when swap_to_mint = '9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i' then 'UST'
--when swap_to_mint = 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX' then 'USDH'
--when swap_to_mint = '7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT' then 'UXD'
--when swap_to_mint = 'Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS' then 'PAI'
-- when swap_to_mint = 'NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa' then 'NIRV'
-- when swap_to_mint = 'FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1' then 'DAI'
-- when swap_to_mint = 'FR87nWEUxVgerFGhZM8Y4AggKGLnaXswr1Pd8wZ4kZcp' then 'FRAX'
end as token_in,
count(distinct tx_id) as n_swaps,
--sum(swap_from_amount) as volume_out,
sum(swap_to_amount) as volume
--volume_in-volume_out as net_volume
from solana.core.fact_swaps x
-- join solana.dim_labels y on x.swap_to_mint=y.address
where block_timestamp>=CURRENT_DATE-INTERVAL '1 MONTH' and
swap_to_mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', '9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i', 'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX', '7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT', 'Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS', 'NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa', 'FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1', 'FR87nWEUxVgerFGhZM8Y4AggKGLnaXswr1Pd8wZ4kZcp')
and swap_to_amount <100000000 and swap_to_amount is not null --and swap_from_amount <1000000000 and swap_from_amount is not null
group by 1,2,3
),
swaps_out as (
SELECT
--trunc(block_timestamp,'day') as date,
swap_program,
swapper,
case when swap_from_mint ='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then 'USDC'
Run a query to Download Data