Skip to content
Dune Analytics

@devinwalsh / Uniswap V1

Uniswap V1

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 ADD AS
2  (SELECT provider,
3          sum(token_amount/1e18) AS ADD_DAI,
4          sum(eth_amount/1e18) AS ADD_ETH
5   FROM uniswap."Exchange_evt_AddLiquidity"
6   WHERE contract_address = '\x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667'
7   GROUP BY 1), withdraw AS
8  (SELECT provider,
9          sum(token_amount/1e18) AS WITHDRAW_DAI,
10          sum(eth_amount/1e18) AS WITHDRAW_ETH
11   FROM uniswap."Exchange_evt_RemoveLiquidity"
12   WHERE contract_address = '\x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667'
13   GROUP BY 1),
14                net AS
15  (SELECT a.ADD_DAI-w.WITHDRAW_DAI AS NET_DAI,
16          a.ADD_ETH-WITHDRAW_ETH AS net_ETH,
17          *
18   FROM ADD a
19   INNER JOIN withdraw w ON a.provider=w.provider)
20SELECT *
21FROM net
22WHERE add_eth>5
23ORDER BY add_eth DESC