jackguysushiswap graphs 1 copy
Updated 2023-03-02
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
›
⌄
-- forked from 57d3730f-1f83-4deb-8c76-99ef18326acf
with tab1 as (
SELECT
pool_name,
CONTRACT_ADDRESS as pool_address,
sum(amount_in_usd) as swap_volume_usd,
count(DISTINCT tx_hash) as swaps,
count(DISTINCT ORIGIN_FROM_ADDRESS) as users
FROM ethereum.core.ez_dex_swaps
WHERE amount_in_usd < amount_out_usd * 2
AND platform LIKE 'sushiswap'
GROUP BY 1,2
ORDER BY 3 DESC
LIMIT 5
)
SELECT
date_trunc('week', block_timestamp) as week,
CONTRACT_ADDRESS as pool_address,
sum(amount_in_usd) as swap_volume_usd,
count(DISTINCT tx_hash) as swaps,
count(DISTINCT ORIGIN_FROM_ADDRESS) as users
FROM ethereum.core.ez_dex_swaps
WHERE amount_in_usd < amount_out_usd * 2
AND platform LIKE 'sushiswap'
AND pool_name IN (SELECT pool_name FROM tab1)
GROUP BY 1,2
Run a query to Download Data