Skip to content
Dune Analytics

@rlg195 / INDEX DEX Volume

INDEX VolumeINDEX DEX 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 results

Loading
 

SQL query

1SELECT
2    project,
3    date_trunc('day', block_time) as day,
4    SUM(
5        CASE WHEN token_a_address = price_address
6        THEN token_a_amount * price
7        ELSE token_b_amount * price END
8        ) AS usd_volume
9FROM (
10    SELECT DISTINCT ON (tx_hash, trace_address, evt_index)
11        project ||
12        version as project,
13        token_a_address,
14        token_a_amount,
15        token_b_address,
16        token_b_amount,
17        p.contract_address AS price_address,
18        price,
19        block_time
20    FROM dex.trades t
21    INNER JOIN prices.usd p
22    ON date_trunc('minute', block_time) = p.minute AND (token_a_address = p.contract_address OR token_b_address = p.contract_address)
23    WHERE  (token_a_address = '\x0954906da0Bf32d5479e25f46056d22f08464cab'
24        or token_b_address = '\x0954906da0Bf32d5479e25f46056d22f08464cab')
25        and block_time  > now() - interval '1 months'...