bergRate of Swap from/Swap to of Uniswap at 2 weeks ago
Updated 2022-12-08Copy Reference Fork
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
›
⌄
with swap_from as (
select token0_symbol "Token",
count (distinct (tx_hash)) "Swaps Count",
sum(abs(amount0_usd)) "Volume (USD)"
from ethereum.uniswapv3.ez_swaps
where 1 = 1
and token0_symbol is not null
and token0_symbol in ('USDC', 'USDT', 'UNI', 'WETH', 'WBTC', 'MATIC')
and block_timestamp >= current_date - interval '2 weeks'
group by 1
),
swap_to as (
select token1_symbol "Token",
count (distinct (tx_hash)) "Swaps Count",
sum(abs(amount1_usd)) "Volume (USD)"
from ethereum.uniswapv3.ez_swaps
where 1 = 1
and token1_symbol is not null
and token1_symbol in ('USDC', 'USDT', 'UNI', 'WETH', 'WBTC', 'MATIC')
and block_timestamp >= current_date - interval '2 weeks'
group by 1
)
select
"Token",
(swap_to."Swaps Count" / swap_from."Swaps Count") as "Swap Ratio",
(swap_to."Volume (USD)" / swap_from."Volume (USD)") as "Volume Ratio"
from swap_from
join swap_to
using ("Token")
Run a query to Download Data