Skip to content
Dune Analytics

@devinwalsh / Kyber DEX Volume v3

Kyber Daily VolumeKyber DEX Volume v3

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

1WITH kyber_volume_mapping AS
2  (SELECT evt_block_time,
3          CASE
4              WHEN reserve1 IN ('\x2295fc6BC32cD12fdBb852cFf4014cEAc6d79C10',
5                                '\x57f8160e1c59D16C01BbE181fD94db4E56b60495',
6                                '\x0000000000000000000000000000000000000000') THEN 0
7              ELSE "ethWeiValue"
8          END AS reserve1_eth_volume,
9          CASE
10              WHEN reserve2 IN ('\x2295fc6BC32cD12fdBb852cFf4014cEAc6d79C10',
11                                '\x57f8160e1c59D16C01BbE181fD94db4E56b60495',
12                                '\x0000000000000000000000000000000000000000') THEN 0
13              ELSE "ethWeiValue"
14          END AS reserve2_eth_volume
15   FROM kyber."Network_evt_KyberTrade" trade
16   WHERE evt_block_time >= date_trunc('day', now()::timestamptz - interval '12 weeks')
17     AND evt_block_time < date_trunc('day', Now()) ),
18     kyber AS
19  (SELECT 'Kyber' AS "Project",
20          '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'::BYTEA AS token,
21          date_trunc('hour', evt_block_time) AS evt_block_time,
22          SUM(reserve1_eth_volume+reserve2_eth_volume) AS amt
23   FROM kyber_volume_mapping
24   GROUP BY evt_block_time),
25     non_dydx AS...