Skip to content
Dune Analytics

@MatteoLeibowitz / Uniswap: Weekly Volume ($)

Uniswap: Weekly Volume ($)

Loading
 

About queries and results

Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.

We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.

Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.

SQL query

1WITH prices AS 
2(
3SELECT
4date_trunc('hour', minute) as hour,
5contract_address,
6avg(price) as price
7FROM prices.usd 
8GROUP BY 1,2
9)
10
11SELECT
12date_trunc('week', block_time) as week,
13sum(
14    COALESCE(
15    token_a_amount*a.price,
16    token_b_amount*b.price)
17    ) as volume
18FROM dex."trades"
19LEFT JOIN prices a ON date_trunc('week', block_time) = a.hour AND token_a_address = a.contract_address
20LEFT JOIN prices b ON date_trunc('week', block_time) = b.hour AND token_b_address = b.contract_address
21WHERE project = 'Uniswap'
22GROUP BY 1
23ORDER BY 1 desc
24

SQL query results

Loading