Skip to content
Dune Analytics

@tianqi / curve.fi total trading fees per week

curve.fi total trading fees per week

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 day, sum(TriPool) as TriPool, sum(hbtc) as hbtc, sum(sbtc) as sbtc, sum(ren) as ren, sum(susdv2) as susdv2, sum(busd) as busd, sum(y) as y, sum(usdt) as usdt, sum(pax) as pax, sum(compound) as compound, (sum(sbtc + ren + susdv2 + busd + y + usdt + pax + compound + hbtc + TriPool) * 0.0004) as totalfees from (
2
3
4
5select date_trunc('week', evt_block_time) AS day, 0 as sbtc, sum(tokens_sold/(case 
6when sold_id = 0 then 1e18
7when sold_id = 1 then 1e6
8when sold_id = 2 then 1e6
9end)) as TriPool, 0 as ren, 0 as susdv2, 0 as busd, 0 as y, 0 as usdt, 0 as pax, 0 as compound, 0 as hbtc from curvefi."dai_usdc_usdt_evt_TokenExchange" as cst
10group by 1
11
12union
13
14select date_trunc('week', evt_block_time) AS day, 0 as sbtc, 0 as TriPool, 0 as ren, 0 as susdv2, 0 as busd, 0 as y, 0 as usdt, 0 as pax, 0 as compound, sum(tokens_sold/(case 
15when sold_id = 0 then 1e18
16when sold_id = 1 then 1e8
17end) * p.price) as hbtc from curvefi."hbtc_evt_TokenExchange" as cst
18LEFT JOIN prices.usd_2260fac5e5542a773aa44fbcfedf7c193bc2c599 p ON p.minute = date_trunc('minute', evt_block_time)
19group by 1
20
21union
22
23select date_trunc('week', evt_block_time) AS day, sum(tokens_sold/(case 
24when sold_id = 0 then 1e8
25when sold_id = 1 then 1e8...