adriaparcerisasoptimism stablecoin swaps in USDC m27 1.2
Updated 2023-03-27
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
swaps_in as (
SELECT
trunc(block_timestamp,'day') as date,
platform,
symbol_in as token_in,
count(distinct tx_hash) as n_swaps,
sum(AMOUNT_IN_USD) as volume
--volume_in-volume_out as net_volume
from optimism.core.ez_dex_swaps x
-- join solana.dim_labels y on x.swap_to_mint=y.address
where block_timestamp>=CURRENT_DATE-INTERVAL '1 MONTH' and
symbol_in in ('USDC', 'USDT', 'USDH', 'UXD', 'PAI', 'DAI', 'FRAX')
and AMOUNT_IN_USD <100000000 and AMOUNT_IN_USD 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,
platform,
symbol_out as token_out,
count(distinct tx_hash) as n_swaps,
sum(AMOUNT_OUT_USD) as volume
--volume_in-volume_out as net_volume
from optimism.core.ez_dex_swaps x
-- join solana.dim_labels y on x.swap_to_mint=y.address
where block_timestamp>=CURRENT_DATE-INTERVAL '1 MONTH' and
symbol_out in ('USDC', 'USDT', 'USDH', 'UXD', 'PAI', 'DAI', 'FRAX')
and AMOUNT_OUT_USD <100000000 and AMOUNT_OUT_USD is not null --and swap_from_amount <1000000000 and swap_from_amount is not null
group by 1,2,3
)
SELECT
x.date,
x.platform as exchange,
sum(x.n_swaps) as "Number of swap in",
sum(y.n_swaps)*(-1) as "Number of swap out",
Run a query to Download Data