jackguyUSDC on AVAX and L2s 6
Updated 2023-09-26
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
-- Avalanche
avalanche_swaps AS (
SELECT
-- date_trunc('week', block_timestamp) as week,
'Avalanche' as chain,
sum(case WHEN symbol_in LIKE 'USDC' then amount_in_usd ELSE amount_out_usd END) as swap_volume_usd,
count(DISTINCT tx_hash) as swaps,
count(DISTINCT ORIGIN_FROM_ADDRESS) as users
FROM avalanche.core.ez_dex_swaps
WHERE (symbol_in LIKE 'USDC'
OR symbol_out LIKE 'USDC')
AND block_timestamp > '2022-04-20'
GROUP BY 1--, 2
),
-- Optimism
optimism_swaps AS (
SELECT
-- date_trunc('week', block_timestamp) as week,
'Optimism' as chain,
sum(case WHEN symbol_in LIKE 'USDC' then amount_in_usd ELSE amount_out_usd END) as swap_volume_usd,
count(DISTINCT tx_hash) as swaps,
count(DISTINCT ORIGIN_FROM_ADDRESS) as users
FROM optimism.core.ez_dex_swaps
WHERE (symbol_in LIKE 'USDC'
OR symbol_out LIKE 'USDC')
AND block_timestamp > '2022-04-20'
GROUP BY 1--, 2
),
-- Polygon
polygon_swaps AS (
SELECT
Run a query to Download Data