kidaUniswap VS ETH Price
Updated 2021-08-18Copy 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
32
›
⌄
WITH avg_eth_price AS (
SELECT
TRUNC(hour, 'day') as date,
AVG(price) as avg_eth_price
FROM
ethereum.token_prices_hourly
WHERE
symbol = 'ETH'
GROUP BY 1
),
total_swap_volume AS (
SELECT
TRUNC(block_timestamp, 'day') as date,
SUM(amount_usd) as total_usd
FROM
ethereum.dex_swaps s
WHERE
amount_usd < POW(10,7) --remove all weird transactions
AND platform LIKE '%uniswap%'
GROUP BY 1
)
SELECT
p.date,
total_usd,
avg_eth_price
FROM
avg_eth_price p
JOIN
total_swap_volume s
ON s.date = p.date
Run a query to Download Data