Teach you how to use the blockchain analysis platform Dune Analytics
区块律动BlockBeats
2020-10-29 02:12
本文约2617字,阅读全文需要约10分钟
Try to learn to be a data analyst.

Editor's Note: This article comes fromBlock beats BlockBeats (ID: BlockBeats), author: 0x26, reprinted with authorization by Odaily.

Editor's Note: This article comes from

Block beats BlockBeats (ID: BlockBeats)

Block beats BlockBeats (ID: BlockBeats)

As we all know, on Ethereum, all information is public. But it is difficult for users to find the valuable information they need. If you want to know how many users there are in a certain project/protocol, or what is the daily trading volume of a certain DEX, you may need to write a separate script to traverse all blocks, parse information, sort and extract data correctly. Not only does this require specialized knowledge, it is also time-consuming. Such a script might extract information for a particular project, but would require extensive modification if it were to be applied to other projects. Also, traversing all the data is a lengthy process in itself, requiring either a full node or many separate queries using external services.

Dune Analytics is a powerful blockchain analysis platform that can be used to query, extract, and visualize massive Ethereum data. It's a web-based platform that queries Ethereum data from a pre-populated database by using simple SQL queries (avoiding each script traversing the data individually, redundant transactions). Instead of writing a dedicated script, users can simply query the database and extract almost any information on the blockchain.

This article will introduce how to use, search, write basic information, and visualize it. Even if you have never used SQL before, the basic examples in this article will help you understand. By reading this article and related official documents, you can also write your own scripts. It is expected that users can create more meaningful datasets.

Weekly DEX volume Decentralized exchange weekly trading volume

How Dune Analytics workssource

Dune Analytics essentially collects all unprocessed blockchain data into an SQL database, allowing all users to easily query. For example, all transfers of Ethereum can be easily queried in the database, and these data have been well sorted according to items such as sending address, receiving address, and quantity.

image description

The latest 5 transfers in Ethereum,

source

data search query

Write new query requirements

Create visualizations and statistics

secondary title

After registration, click Browse on the homepage to enter the data browsing interface.source 

image description

Median Gas Price,ETH gas fee related data,

The chart can choose to zoom in, full screen, or select any part. Select Fork to copy the entire data set into your own workspace, where you can operate, modify, create new charts and save them. And Qeuery allows you to see the implementation code of this part of the data set.

Last 24 hours (within 24 hours, the median gas fee)

image description

In chronological order, it can be found that many new users test their own data sets on the platform.

secondary title

Start learning to write a dataset of your own

image description

Some netizens are looking for services to write data sets for a fee on Discord

First of all, users can use Fork to copy the data sets successfully written by others, and can copy and modify their codes. Perhaps with a little adjustment, you can get the code you need (Rhythm Note, Dune Analytics also provides detailed Docs documents for users to learn).

1. Click Create and select Query to create a new query page;

2. Edit the relevant SQL code instructions.

This article introduces some related commands with high usage:

ethereum.transactions: All transfers on Ethereum.

ethereum.logs: logs when sending tokens.

erc20.ERC20_evt_Transfer: All events when sending tokens.

select * from ethereum."transactions" order by block_time desc limit 5

prices.layer1_usd: Displays the usd price of the L1 layer (public chain) every minute.

First select ethereum.transactions to find all the data on the ETH chain, and you can see the relevant subsets, including hash, GAS fee, block height and so on. The * character represents all content in the subset, and desc represents flashbacks.

After processing the main command, we get the following complete command:

Get the result, and then click SAVE to save, and the above has completed a simple query function.

image descriptionsource

limitation

A chart showing the value of ETH on the chain in the past 10 days,

source

Although Dune is a super powerful tool, it still has some bugs and limitations. Currently, only things like on-chain transfers and migrations can be queried. The state of an address on a particular block cannot be determined. For example, if you want to know what is the balance of a specific address in a specific block, you need to create a Query that summarizes all transfers to and from that address. Answering the question of "the current total amount of Ethereum" is still a bit tricky for Dune.

Summarize

Free users can only perform 3 queries at a time. If you want to update a multi-chart dataset, you need to pay attention to this limitation.Although the platform will automatically help debug incorrect Query commands most of the time, sometimes Query will be suspended until it times out (up to 40 minutes). If something is taking a significant amount of time and still not responding, you may want to try saving it and reloading the page. This part of the problem will be resolved later.Summarize

A tool is just a tool, what matters is the user behind it. As a data platform full of possibilities, Dune Analytics still has a lot to explore and discover, including various emerging DeFi projects or data, requiring users to build relevant data sets themselves. Given that 96% of the DeFi transaction volume in the third quarter of 2020 comes from ETH

, which focuses on Ethereum data and allows users to easily and quickly query, extract and display data, Dune Analytics can be said to be a super powerful research and exploration tool.

References:

Dune Analytics introduction tutorial (with examples)

image description

Datasets for DUNE Analytics Related Platforms

Note: Rhythm previously reported that on September 23, DUNE Analytics received a $2 million seed round of financing, led by Dragonfly Capital, Multicoin Capital, Coinbase Ventures, Alameda Research, Coingecko and other institutions, and AAVE founder Stani Kulechov, Uniswap's Matteo Leibowitz Wait for angel investors to follow suit.

区块律动BlockBeats
作者文库