Skip to content
Dune Analytics

@overanalyser / Fork of (#12277) Current composition of $DPI

% of each token in $DPIFork of (#12277) Current composition of $DPI

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

1
2WITH tokens (addr) AS (VALUES ('\x9f8f72aa9304c8b593d555f12ef6589cc3a579a2'::bytea), ('\x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'::bytea), ('\xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'::bytea), 
3('\x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e'::bytea), ('\x1f9840a85d5af5bf1d1762f925bdaddc4201f984'::bytea), ('\xc00e94cb662c3520282e6f5717214004a7f26888'::bytea), 
4('\x408e41876cccdc0f92210600ef50372656052a38'::bytea), ('\xbbbbca6a901c926f240b89eacb641d8aec7aeafd'::bytea), ('\xdd974d5c2e2928dea5f71b9825b8b646686bd200'::bytea)
5,('\xba100000625a3754423978a60c9317c58a424e3d'::bytea), ('\x221657776846890989a759ba2973e427dff5c9bb'::bytea)),
6addresses(addr) AS (SELECT contract_address FROM erc20.tokens where symbol in (select symbol from tokens))
7SELECT 
8contract_address,
9symbol,
10sum(amt) * (SELECT p.price/10^p.decimals FROM prices.usd p WHERE p.contract_address = x.contract_address ORDER BY minute DESC LIMIT 1) as usd
11FROM (
12    SELECT contract_address, value as amt
13    FROM erc20."ERC20_evt_Transfer"
14    WHERE  contract_address IN (SELECT addr FROM tokens)
15    AND "to" = '\x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b'
16    UNION ALL
17    SELECT contract_address, -value as amt
18    FROM erc20."ERC20_evt_Transfer"
19    WHERE  contract_address IN (SELECT addr FROM tokens)
20    AND "from" = '\x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b'
21) x
22GROUP BY 1 order by 2

Result visualizations

Value of each component in $DPIFork of (#12277) Current composition of $DPI

Loading