adam10Top Pools by Swap Volume
Updated 2021-08-02
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
WITH swap_raw AS (
SELECT
pool_address,
pool_name,
CASE WHEN amount0_usd < 0 THEN amount0_usd ELSE amount1_usd END AS swap_usd_amount_out,
CASE WHEN amount0_usd >= 0 THEN amount0_usd ELSE amount1_usd END AS swap_usd_amount_in
FROM uniswapv3.swaps
WHERE amount0_usd IS NOT NULL AND amount1_usd IS NOT NULL
)
-- // Only amount in
SELECT
pool_address,
pool_name,
SUM(ABS(swap_usd_amount_in)) AS swap_volume_usd
FROM swap_raw
GROUP BY 1,2
ORDER BY 3 DESC
LIMIT 10
Run a query to Download Data