Skip to content
Dune Analytics

@ashachaf / Bancor liquidity over time

Bancor liquidity over time


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


SQL query

1WITH per_week AS
2  (SELECT date_trunc('week', evt_block_time) AS week,
3          t.symbol,
4          SUM(amount/10^decimals) token_amount,
5          SUM(amount/10^decimals * p.price) usd_value,
6          SUM(amount/10^decimals) BNT_amount
7   FROM
8     (SELECT evt_tx_hash AS tx_hash,
9             evt_block_time,
10             tr."from" AS address, -tr.value AS amount,
11                                    tokens.decimals,
12                                    tokens.symbol,
13                                    tokens.contract_address
14      FROM erc20."ERC20_evt_Transfer" tr
15      JOIN erc20.tokens ON tr.contract_address = tokens.contract_address
16      WHERE "from" IN
17          (SELECT DISTINCT contract_address AS "address"
18           FROM bancor."BancorConverter_evt_PriceDataUpdate")
19      UNION ALL SELECT evt_tx_hash AS tx_hash,
20                       evt_block_time,
21                       tr."to" AS address,
22                       tr.value AS amount,
23                       tokens.decimals,
24                       tokens.symbol,
25                       tokens.contract_address...