CryptoLionSwap/Liquidity
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
›
⌄
SELECT
date_trunc('day',block_timestamp) as day,
CASE
WHEN pool_name LIKE 'USDC-WETH%' THEN 'USDC-WETH'
WHEN pool_name LIKE 'WETH-USDT%' THEN 'WETH-USDT'
WHEN pool_name LIKE 'USDC-USDT%' THEN 'USDC-USDT'
WHEN pool_name LIKE 'WBTC-WETH%' THEN 'WBTC-WETH'
END as pool,
sum(amount0_usd + amount1_usd) as swapvolume,
avg(liquidity_adjusted) as liqudity,
count(DISTINCT recipient) as swappers
FROM uniswapv3.swaps
WHERE block_timestamp >= getdate() - interval '14 days'
AND sender<>recipient
AND (pool_name LIKE 'USDC-WETH%'
OR pool_name LIKE 'WETH-USDT%'
OR pool_name LIKE 'USDC-USDT%'
OR pool_name LIKE 'WBTC-WETH%')
GROUP BY day, pool
ORDER BY DAY