Skip to content
Dune Analytics

@pengiundev / curve.fi underlying-volume-per-day

curve.fi underlying-volume-per-day

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

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

SQL query results

Loading
 

Result visualizations

curve.fi underlying-volume-per-day

Loading