jackguysushiswap graphs 1
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
›
⌄
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 50
)
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 LIKE '{{ pool_name }}'
GROUP BY 1,2
Run a query to Download Data