Skip to content
Dune Analytics

@MatteoLeibowitz / Balancer: LP Revenue

Balancer: Cumulative LP Revenue [Source: Matteo Leibowitz, The Block]Balancer: LP Revenue

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 trades AS 
2(
3SELECT
4date_trunc('day', evt_block_time) as day,
5s.contract_address as pool,
6t.symbol as token,
7t.decimals as decimals,
8evt_tx_hash,
9sum("swapFee"/1e18) as fee,
10sum("tokenAmountIn") as volume
11FROM balancer."BPool_evt_LOG_SWAP" s
12LEFT JOIN balancer."BPool_call_setSwapFee" f ON s.contract_address = f.contract_address  
13LEFT JOIN erc20."tokens" t ON s."tokenIn" = t.contract_address
14GROUP BY 1,2,3,4,5
15ORDER BY 1 desc
16),
17
18prices as 
19(
20SELECT
21symbol,
22price
23FROM prices.usd
24WHERE minute = current_date
25UNION ALL...

Result visualizations

Balancer: LP Revenue Per Day [Source: Matteo Leibowitz, The Block]Balancer: LP Revenue

Loading