diff --git a/.gitbook/assets/2021-11-03 16-59-42 (1) (1) (1).gif b/.gitbook/assets/2021-11-03 16-59-42 (1) (1) (1).gif deleted file mode 100644 index 851303d..0000000 Binary files a/.gitbook/assets/2021-11-03 16-59-42 (1) (1) (1).gif and /dev/null differ diff --git a/.gitbook/assets/2021-11-03 16-59-42 (1) (1) (2).gif b/.gitbook/assets/2021-11-03 16-59-42 (1) (1) (2).gif deleted file mode 100644 index 851303d..0000000 Binary files a/.gitbook/assets/2021-11-03 16-59-42 (1) (1) (2).gif and /dev/null differ diff --git a/.gitbook/assets/2021-11-03 16-59-42 (1) (1).gif b/.gitbook/assets/2021-11-03 16-59-42 (1) (1).gif deleted file mode 100644 index 851303d..0000000 Binary files a/.gitbook/assets/2021-11-03 16-59-42 (1) (1).gif and /dev/null differ diff --git a/.gitbook/assets/image (13) (1) (1) (1) (1).png b/.gitbook/assets/image (13) (1) (1) (1) (1).png deleted file mode 100644 index 31ff57d..0000000 Binary files a/.gitbook/assets/image (13) (1) (1) (1) (1).png and /dev/null differ diff --git a/.gitbook/assets/image (13) (1) (1) (1) (2).png b/.gitbook/assets/image (13) (1) (1) (1) (2).png deleted file mode 100644 index 31ff57d..0000000 Binary files a/.gitbook/assets/image (13) (1) (1) (1) (2).png and /dev/null differ diff --git a/.gitbook/assets/image (13) (1) (1) (1).png b/.gitbook/assets/image (13) (1) (1) (1).png deleted file mode 100644 index 31ff57d..0000000 Binary files a/.gitbook/assets/image (13) (1) (1) (1).png and /dev/null differ diff --git a/.gitbook/assets/image (19) (1) (1) (1).png b/.gitbook/assets/image (19) (1) (1) (1).png deleted file mode 100644 index 6387e29..0000000 Binary files a/.gitbook/assets/image (19) (1) (1) (1).png and /dev/null differ diff --git a/.gitbook/assets/image (19) (1) (1) (2).png b/.gitbook/assets/image (19) (1) (1) (2).png deleted file mode 100644 index 6387e29..0000000 Binary files a/.gitbook/assets/image (19) (1) (1) (2).png and /dev/null differ diff --git a/.gitbook/assets/image (19) (1) (1).png b/.gitbook/assets/image (19) (1) (1).png deleted file mode 100644 index 6387e29..0000000 Binary files a/.gitbook/assets/image (19) (1) (1).png and /dev/null differ diff --git a/.gitbook/assets/image (19).png b/.gitbook/assets/image (19).png index da2655e..6387e29 100644 Binary files a/.gitbook/assets/image (19).png and b/.gitbook/assets/image (19).png differ diff --git a/.gitbook/assets/image (27) (1) (1).png b/.gitbook/assets/image (27) (1) (1).png deleted file mode 100644 index b923849..0000000 Binary files a/.gitbook/assets/image (27) (1) (1).png and /dev/null differ diff --git a/.gitbook/assets/image (27) (1) (2) (1).png b/.gitbook/assets/image (27) (1) (2) (1).png deleted file mode 100644 index b923849..0000000 Binary files a/.gitbook/assets/image (27) (1) (2) (1).png and /dev/null differ diff --git a/.gitbook/assets/image (27) (1) (2) (2).png b/.gitbook/assets/image (27) (1) (2) (2).png deleted file mode 100644 index b923849..0000000 Binary files a/.gitbook/assets/image (27) (1) (2) (2).png and /dev/null differ diff --git a/.gitbook/assets/image (27) (1) (2).png b/.gitbook/assets/image (27) (1) (2).png deleted file mode 100644 index b923849..0000000 Binary files a/.gitbook/assets/image (27) (1) (2).png and /dev/null differ diff --git a/.gitbook/assets/image (27) (1).png b/.gitbook/assets/image (27) (1).png deleted file mode 100644 index b923849..0000000 Binary files a/.gitbook/assets/image (27) (1).png and /dev/null differ diff --git a/.gitbook/assets/image (27) (2).png b/.gitbook/assets/image (27) (2).png deleted file mode 100644 index b923849..0000000 Binary files a/.gitbook/assets/image (27) (2).png and /dev/null differ diff --git a/.gitbook/assets/image (27).png b/.gitbook/assets/image (27).png index d733507..b923849 100644 Binary files a/.gitbook/assets/image (27).png and b/.gitbook/assets/image (27).png differ diff --git a/.gitbook/assets/image (42).png b/.gitbook/assets/image (42).png index e236886..da2655e 100644 Binary files a/.gitbook/assets/image (42).png and b/.gitbook/assets/image (42).png differ diff --git a/.gitbook/assets/image (43).png b/.gitbook/assets/image (43).png index a13fa43..e236886 100644 Binary files a/.gitbook/assets/image (43).png and b/.gitbook/assets/image (43).png differ diff --git a/.gitbook/assets/image (44).png b/.gitbook/assets/image (44).png index 682f8f7..a13fa43 100644 Binary files a/.gitbook/assets/image (44).png and b/.gitbook/assets/image (44).png differ diff --git a/.gitbook/assets/image (45).png b/.gitbook/assets/image (45).png index b6f9923..682f8f7 100644 Binary files a/.gitbook/assets/image (45).png and b/.gitbook/assets/image (45).png differ diff --git a/.gitbook/assets/image (46).png b/.gitbook/assets/image (46).png index 7c5bea4..b6f9923 100644 Binary files a/.gitbook/assets/image (46).png and b/.gitbook/assets/image (46).png differ diff --git a/.gitbook/assets/image (47).png b/.gitbook/assets/image (47).png index 4a9f021..7c5bea4 100644 Binary files a/.gitbook/assets/image (47).png and b/.gitbook/assets/image (47).png differ diff --git a/.gitbook/assets/image (48).png b/.gitbook/assets/image (48).png index 7f276cd..4a9f021 100644 Binary files a/.gitbook/assets/image (48).png and b/.gitbook/assets/image (48).png differ diff --git a/.gitbook/assets/image (49).png b/.gitbook/assets/image (49).png index 0922ac1..7f276cd 100644 Binary files a/.gitbook/assets/image (49).png and b/.gitbook/assets/image (49).png differ diff --git a/.gitbook/assets/image (50).png b/.gitbook/assets/image (50).png index 711e243..d733507 100644 Binary files a/.gitbook/assets/image (50).png and b/.gitbook/assets/image (50).png differ diff --git a/.gitbook/assets/image (51).png b/.gitbook/assets/image (51).png index 6afc456..0922ac1 100644 Binary files a/.gitbook/assets/image (51).png and b/.gitbook/assets/image (51).png differ diff --git a/.gitbook/assets/image (52).png b/.gitbook/assets/image (52).png index e710688..711e243 100644 Binary files a/.gitbook/assets/image (52).png and b/.gitbook/assets/image (52).png differ diff --git a/.gitbook/assets/image (53).png b/.gitbook/assets/image (53).png index 2a6de60..6afc456 100644 Binary files a/.gitbook/assets/image (53).png and b/.gitbook/assets/image (53).png differ diff --git a/.gitbook/assets/image (54).png b/.gitbook/assets/image (54).png index 0ef68d4..e710688 100644 Binary files a/.gitbook/assets/image (54).png and b/.gitbook/assets/image (54).png differ diff --git a/.gitbook/assets/image (55).png b/.gitbook/assets/image (55).png index a520271..2a6de60 100644 Binary files a/.gitbook/assets/image (55).png and b/.gitbook/assets/image (55).png differ diff --git a/.gitbook/assets/image (56).png b/.gitbook/assets/image (56).png index f277d60..0ef68d4 100644 Binary files a/.gitbook/assets/image (56).png and b/.gitbook/assets/image (56).png differ diff --git a/.gitbook/assets/image (57).png b/.gitbook/assets/image (57).png index 556e67b..a520271 100644 Binary files a/.gitbook/assets/image (57).png and b/.gitbook/assets/image (57).png differ diff --git a/.gitbook/assets/image (58).png b/.gitbook/assets/image (58).png index d3ecf45..f277d60 100644 Binary files a/.gitbook/assets/image (58).png and b/.gitbook/assets/image (58).png differ diff --git a/.gitbook/assets/image (59).png b/.gitbook/assets/image (59).png index 2cc5381..556e67b 100644 Binary files a/.gitbook/assets/image (59).png and b/.gitbook/assets/image (59).png differ diff --git a/.gitbook/assets/image (60).png b/.gitbook/assets/image (60).png index 54d6111..d3ecf45 100644 Binary files a/.gitbook/assets/image (60).png and b/.gitbook/assets/image (60).png differ diff --git a/.gitbook/assets/image (61).png b/.gitbook/assets/image (61).png new file mode 100644 index 0000000..2cc5381 Binary files /dev/null and b/.gitbook/assets/image (61).png differ diff --git a/.gitbook/assets/image (62).png b/.gitbook/assets/image (62).png new file mode 100644 index 0000000..54d6111 Binary files /dev/null and b/.gitbook/assets/image (62).png differ diff --git a/README.md b/README.md index 9462c99..3679d50 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,81 @@ --- -说明: 欢迎使用Dune +description: Welcome to Dune --- -# Dune介绍 +# Introduction to Dune -## 简介 +## Introduction -**Dune是一款强大的区块链研究工具。通过Dune你可以查询,导出和可视化区块链上浩如烟海的数据。Dune让公共的区块链数据对每个人都触手可及,从而使其有了无限的可能。该文档将会帮你解答类似如下的问题:** +**Dune is a powerful tool for blockchain research. Dune gives you all the tools to query, extract, and visualize vast amounts of data from the blockchain. Dune is unlocking the power of public blockchain data by making it accessible to everyone. This documentation will help you answer questions like:** -[Uniswap每天的交易资金有多少?](https://dune.xyz/queries/3) +[How much volume flows through Uniswap each day?](https://dune.xyz/queries/3) -[哪家去中心交易所的交易额最高?](https://dune.xyz/queries/1847) +[Which Dex has the highest volume?](https://dune.xyz/queries/1847) -[重要的稳定币有什么链上行为?](https://dune.xyz/hagaetc/stablecoins) +[How are important Stablecoins behaving today?](https://dune.xyz/hagaetc/stablecoins) -## Dune基础 +## Dune Basics -#### Dune应用 +#### Dune App -理解[查询](./#queries), [可视化](duneapp/visualizations/)和 [仪表盘](duneapp/dashboards.md)的概念将对你畅游Dune很有帮助。 他们是你通往区块链信息大门的基础区块。作为一名区块链分析师,你可以查询数据信息,可视化你的结果,然后进一步用仪表盘来讲述你的内容。 +While navigating Dune, it helps to have a good understanding of [queries](./#queries), [visualizations](duneapp/visualizations/), and [dashboards](duneapp/dashboards.md). These are the basic building blocks that act as your portal to the world's blockchain information. As a blockchain analyst, you can create custom queries to fetch data, visualize the results of these queries, and then tell stories with your data using dashboards. -#### Dune的数据可视化 +#### Data available on Dune -在屏幕背后,Dune将晦涩的数据转换成容易阅读的数据表。使用SQL查询,你能准确得筛选出你需要的信息。 +Behind the scenes, Dune transforms difficult-to-access data into human-readable tables. Using SQL queries, you can query for exactly the information you need. -Dune既提供原始区块链数据也提供已解码的数据。只有有用户向我们提出了合约解码的需求,我们才提供对应的解码数据。 你可以在这里提交解码需求[网页](https://dune.xyz/contracts/new).\ +Dune has raw blockchain data and decoded blockchain data available. Decoded data is only available if somebody signaled to us before that a contract needs to be decoded. You can signal a decoding request to us via our [website](https://dune.xyz/contracts/new).\ \ -目前你可以查询以下的链上数据 **Ethereum, Polygon, Binance Smart Chain, Optimism** 和 **Gnosis Chain**. +You can currently query data from **Ethereum, Polygon, Binance Smart Chain, Optimism** and **Gnosis Chain**. -Dune提取区块链上我们索引的时间和内部调用,我们不规定和存储数据。 +Dune picks up events and internal calls from the blockchains we index, we don't have state/storage data. -## 查询 +## Queries -Dune将区块链的数据聚合到易于检索的数据库中。通过查询,你可以限定输出哪些数据。 +Dune aggregates blockchain data into SQL databases that can be easily queried. Queries are used to specify what data from the blockchain should be returned. -你也许想了解 _今天所有去中心化交易所的交易额_, 或者 _今年稳定币的铸造数量_。 不管是哪个问题,你都可以通过查询来解答。 +Maybe you want to know _all the Dex trades that happened today_, or the _total value of stablecoins minted this year_. Whatever the question, the answer likely starts with a Dune query. -查询同时返回数据的行和列 (与传统的SQL查询类似),你可以用来可视化展示。 +Queries return rows and columns of data (same as traditional SQL queries) that can later be visualized and presented. ![Screen Shot 2021-04-22 at 9 56 34 AM](https://user-images.githubusercontent.com/76178256/115726979-357d1380-a351-11eb-83ee-16f0d57c6ecb.png) -一名区块链分析师(比如你)可以有很多途径开始一条查询: +There are a few ways that a blockchain analyst (ie. you!) can get started running queries: -1. 使用Dune的 _抽象表_ 来查询常用数据表。这是最简单的也是最常用的使用Dune的方式。一些常用的抽象表包括`dex.trades`,`lending.borrow`和`stablecoin.transfer` (你可以在这里找到完整的抽象表列表[这里](https://github.com/duneanalytics/abstractions)) -2. 查询区块、日志和交易在内的原始以太坊数据。 -3. 中心化交易所的数据也是可以查询的。通过使用`prices.usd`可以迅速的返回几乎任意一种加密货币的价格。 +1. Use Dune _abstractions_ to query commonly used data tables. This is the simplest and most common way to use Dune. Some popular abstractions include `dex.trades`, `lending.borrow`, and `stablecoin.transfer` (you can find a complete list of abstractions [here](https://github.com/duneanalytics/abstractions)) +2. Query the raw ethereum data including blocks, logs, and transactions. +3. It is also possible to query centralized exchange data. Use `prices.usd` to quickly return the price of almost any cryptoasset -## 可视化 +## Visualizations -表中的数据 (行和列)有时不易阅读。结果的可视化可以更清晰准确地展示信息。 +Data presented in table form (rows and columns) can be difficult to read. Visualizations take the results of a query and present the information in a clear & precise way. -你可以开始通过可视化来讲述你的内容。通过Dune你可以轻松地将: +You can use visualizations to begin to tell a story with your data. With Dune visualizations it is easy to transform this: ![Screen Shot 2021-04-22 at 10 59 48 AM](https://user-images.githubusercontent.com/76178256/115737269-fa331280-a359-11eb-9a31-c0dfe4b038e6.png) -转化为: +Into this: ![Screen Shot 2021-04-22 at 11 01 02 AM](https://user-images.githubusercontent.com/76178256/115737692-5b5ae600-a35a-11eb-8145-bdcf9396cd03.png) -这个柱状图清晰地展示了最高的交易量发生在4月19日,同时帮助观众了解了时间趋势。 +The bar chart visualization makes it clear that April 19th had the highest transfer volume, and helps the audience see the trend over time. -Dune提供了可是展示数据的一系列的可视化选择,包括柱状图,面积图,线图,饼图等等。 +Dune offers a variety of visualizations that you can use to visually present data including bar charts, area charts, line charts, pie charts, and more. -## 仪表盘 +## Dashboards -使用精心设计的视觉展示,聪明的区块链分析师可以讲述关于特定数据组的内容。例如,在下文中,[仪表盘](https://dune.xyz/hagaetc/dex-metrics) 顶部展示了'Dex'在增长。观众来可以通过下面的展示发现,哪些去中心化交易所的交易额是较高的,最终通过累积的柱状图来能发现随时间变化的趋势。只需要看这一个仪表盘,观众就能清楚地看到整个DEX市场的情况。 +Using carefully planned visuals, a clever blockchain analyst can tell a story about a particular group of data. For example, in the below[ dashboard](https://dune.xyz/hagaetc/dex-metrics) it is clear at the top that 'Dex' as a category is growing. Below, the audience sees which dex's are the most popular by volume, and finally can view a stacked bar chart that shows changes over time. By just looking at this single dashboard, the audience sees a clear picture of the entire DEX market. ![Screen Shot 2021-04-23 at 10 51 25 AM](https://user-images.githubusercontent.com/76178256/115889404-e7841080-a421-11eb-9e30-8d43e58e28f4.png) -## Dune需要协作 +## Dune is a collaborative effort -Dune默认所有查询和数据库都是公开的。 +On Dune, all queries and datasets are public by default. -这引入了一个有趣的动态,在这个动态中,用户可以轻松地分叉和混合其他创建者的查询,并在他们的知识基础上进行构建。另一方面,每次编写新查询时,你都会参与查询贡献,帮助人们查询Dune上的数据。Dune社区通过不断改进的查询范围获得共同成功,你可以轻松查询所需的统计信息。 +This introduces an interesting dynamic in which you, the user, can fork and remix the queries of other creators with ease and build on top of their knowledge. On the other side, every time you write a new query, you contribute to the collection of queries that help people query for data on dune. That way, the Dune Community succeeds together through an ever improving range of queries that allow you to easily query for just the stats you need. -如果你对查询的隐私性有需求, 你可以订阅[pro Plan](https://dune.xyz/pricing)。 +If you do need Privacy for your Queries, the [pro Plan](https://dune.xyz/pricing) has got you covered. -加入我们 [Discord社区](https://discord.gg/BJBHFR6sdy) 来获得我们团队和社区的帮助。 +Join our [Community Discord](https://discord.gg/BJBHFR6sdy) to get world class support from our team and the community. -如果有任何反馈意见,不管是功能需求还是报告错误,你都可以在这里提交[这里](https://feedback.dune.xyz/). +If you have any feedback, whether feature requests or bug reports, you can submit it [here](https://feedback.dune.xyz/). diff --git a/SUMMARY.md b/SUMMARY.md index 9a142c1..8c30513 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,100 +1,100 @@ # Table of contents -* [Dune介绍](README.md) - -## 关于Dune - -* [使用案例](about/usecases/README.md) - * [项目仪表盘](about/usecases/project-dashboards.md) - * [细分仪表盘](about/usecases/sector-dashboards.md) - * [生态仪表盘](about/usecases/ecosystem-dashboards.md) -* [教程](about/tutorials/README.md) - * [网络课程](about/tutorials/our-network-course.md) - * [Dune指南](about/tutorials/dune-guides/README.md) - * [查询技巧](about/tutorials/dune-guides/tips.md) - * [SQL指南](about/tutorials/sql-guides.md) - * [视频教程](about/tutorials/video-series.md) - * [查询模板](about/tutorials/queries/README.md) - * [钱包的ETH余额](about/tutorials/queries/eth-balance-of-a-wallet.md) - * [钱包交易的原始数据](about/tutorials/queries/tx-wallet.md) - * [钱包的矿工费指标](about/tutorials/queries/gas-metrics-per-wallet.md) - * [价格查询](about/tutorials/queries/price-queries.md) - * [代币随时间的总供应量](about/tutorials/queries/supply.md) - * [一段时间的用户和交易量](about/tutorials/queries/untitled-6.md) - * [交易事件中代币的美元价格](about/tutorials/queries/untitled-3.md) - * [Uniswap代币的美元价格](about/tutorials/queries/untitled-2.md) - * [一段时间内一个钱包的代币(和美元价值)](about/tutorials/queries/untitled-1.md) - -## 数据表 - -* [数据表](data-tables/data-tables/README.md) +* [Introduction to Dune](README.md) + +## About Dune + +* [Use Cases](about/usecases/README.md) + * [Project Dashboards](about/usecases/project-dashboards.md) + * [Sector Dashboards](about/usecases/sector-dashboards.md) + * [Ecosystem Dashboards](about/usecases/ecosystem-dashboards.md) +* [Tutorials](about/tutorials/README.md) + * [Our Network course](about/tutorials/our-network-course.md) + * [Dune Guides](about/tutorials/dune-guides/README.md) + * [Tips for querying](about/tutorials/dune-guides/tips.md) + * [SQL guides](about/tutorials/sql-guides.md) + * [Video Series](about/tutorials/video-series.md) + * [Query templates](about/tutorials/queries/README.md) + * [ETH Balance of a wallet](about/tutorials/queries/eth-balance-of-a-wallet.md) + * [raw transactions per wallet](about/tutorials/queries/tx-wallet.md) + * [gas metrics per wallet](about/tutorials/queries/gas-metrics-per-wallet.md) + * [price queries](about/tutorials/queries/price-queries.md) + * [total supply over time of a token](about/tutorials/queries/supply.md) + * [Users and amount over a trailing period](about/tutorials/queries/untitled-6.md) + * [USD value of token utilised for an event](about/tutorials/queries/untitled-3.md) + * [USD price for a token from Uniswap](about/tutorials/queries/untitled-2.md) + * [Token (and USD value) per token over time for an address](about/tutorials/queries/untitled-1.md) + +## Data Tables + +* [Data tables](data-tables/data-tables/README.md) * [nft.trades](data-tables/data-tables/nft.trading.md) - * [原始数据](data-tables/data-tables/raw-data/README.md) - * [以太坊数据](data-tables/data-tables/raw-data/ethereum-data.md) - * [xDai数据](data-tables/data-tables/raw-data/xdai-data.md) - * [已解码数据](data-tables/data-tables/decoded-data.md) - * [代币标准](data-tables/data-tables/special-tables.md) - * [ERC-20代币余额](data-tables/data-tables/erc-20-balances.md) - * [抽象表](data-tables/data-tables/abstractions.md) - * [用户生成表](data-tables/data-tables/user-generated.md) - * [价格表](data-tables/data-tables/prices.md) - * [标签](data-tables/data-tables/labels.md) - * [Solana数据](data-tables/data-tables/solana-data/README.md) - * [更新日志](data-tables/data-tables/solana-data/changelog.md) - * [第三方数据](data-tables/data-tables/community-data/README.md) + * [Raw Data](data-tables/data-tables/raw-data/README.md) + * [Ethereum data](data-tables/data-tables/raw-data/ethereum-data.md) + * [xDai Data](data-tables/data-tables/raw-data/xdai-data.md) + * [Decoded Data](data-tables/data-tables/decoded-data.md) + * [Token standards](data-tables/data-tables/special-tables.md) + * [ERC-20 balances](data-tables/data-tables/erc-20-balances.md) + * [Abstractions](data-tables/data-tables/abstractions.md) + * [User Generated](data-tables/data-tables/user-generated.md) + * [Prices](data-tables/data-tables/prices.md) + * [Labels](data-tables/data-tables/labels.md) + * [Solana Data](data-tables/data-tables/solana-data/README.md) + * [Changelog](data-tables/data-tables/solana-data/changelog.md) + * [Third Party Data](data-tables/data-tables/community-data/README.md) * [Flashbots](data-tables/data-tables/community-data/flashbots.md) -## Dune V2 (beta) +## Dune Engine V2 (beta) -* [Dune V2介绍](dune-engine-v2-beta/dunes-new-query-engine.md) -* [查询引擎](dune-engine-v2-beta/query-engine.md) -* [Dune V2抽象表](dune-engine-v2-beta/abstractions-in-dunev2.md) +* [Dune V2 Intro](dune-engine-v2-beta/dunes-new-query-engine.md) +* [Query Engine](dune-engine-v2-beta/query-engine.md) +* [Abstractions in Dune V2](dune-engine-v2-beta/abstractions-in-dunev2.md) ## Dune App -* [查询编辑器](duneapp/query-editor.md) -* [可视化](duneapp/visualizations/README.md) - * [图表](duneapp/visualizations/graphs.md) - * [计数器](duneapp/visualizations/counters.md) - * [饼图](duneapp/visualizations/pie-charts.md) -* [仪表盘](duneapp/dashboards.md) -* [参数](duneapp/parameters.md) -* [添加新合约](duneapp/adding-new-contracts.md) +* [Query Editor](duneapp/query-editor.md) +* [Visualizations](duneapp/visualizations/README.md) + * [Graphs](duneapp/visualizations/graphs.md) + * [Counters](duneapp/visualizations/counters.md) + * [Pie Charts](duneapp/visualizations/pie-charts.md) +* [Dashboards](duneapp/dashboards.md) +* [Parameters](duneapp/parameters.md) +* [Adding new contracts](duneapp/adding-new-contracts.md) ## Onboarding -* [入门Dune](onboarding/onboarding-to-dune.md) +* [Onboarding to Dune](onboarding/onboarding-to-dune.md) -## 赏金计划 +## Bounties -* [Wizard需求计划](bounties/wizard-request-program.md) +* [Wizard Request Program](bounties/wizard-request-program.md) -## 跨网站使用Dune图表 +## Dune Charts across the web -* [内容归属](sharing/attribution.md) -* [嵌入第三方平台](sharing/embeds/README.md) +* [Attribution](sharing/attribution.md) +* [Embeds](sharing/embeds/README.md) * [Discord](sharing/embeds/discord.md) * [Twitter](sharing/embeds/twitter.md) * [Webpages](sharing/embeds/webpages.md) * [Mirror.xyz](sharing/embeds/mirror.xyz.md) * [Known Issues](sharing/embeds/known-issues.md) -## 资源 +## Resources * [Press Kit](resources/press-kit.md) ## FAQ -* [Dune是如何获取数据的?](faq/how-does-dune-get-its-data.md) -* [Dune有API吗?](faq/does-dune-have-an-api.md) -* [Dune有代币吗?](faq/does-dune-have-a-token.md) -* [查询结果如何刷新?](faq/how-are-results-refreshing.md) +* [How does Dune get it's data ?](faq/how-does-dune-get-its-data.md) +* [Does Dune have an API?](faq/does-dune-have-an-api.md) +* [Does Dune have a Token?](faq/does-dune-have-a-token.md) +* [How are results refreshing?](faq/how-are-results-refreshing.md) -## 更新日志 +## Changelog -* [Dune的变化](changelog/dune-changes/README.md) - * [2021年3月](changelog/dune-changes/march-2021.md) - * [2020年8月](changelog/dune-changes/august-2020.md) - * [2020年3月](changelog/dune-changes/march-2020.md) - * [2020年1月](changelog/dune-changes/january-2020.md) - * [2019年10月](changelog/dune-changes/october-2019.md) +* [Changes to Dune](changelog/dune-changes/README.md) + * [March 2021](changelog/dune-changes/march-2021.md) + * [August 2020](changelog/dune-changes/august-2020.md) + * [March 2020](changelog/dune-changes/march-2020.md) + * [January 2020](changelog/dune-changes/january-2020.md) + * [October 2019](changelog/dune-changes/october-2019.md) diff --git a/about/tutorials/README.md b/about/tutorials/README.md index b538c03..eb7bc74 100644 --- a/about/tutorials/README.md +++ b/about/tutorials/README.md @@ -1,14 +1,14 @@ -# 教程 +# Tutorials -## 如何开始 +## How to get started -**Dune是为技术和非技术人员构建的** \ -不论你是一个经验丰富的SQL开发人员还是刚刚起步的使用者,你都可以使用我们的平台,很快的开始分析区块链数据。 +**Dune is made for technical and non-technical users alike.** \ +Whether you are a seasoned SQL developer or just starting out, you can use our platform to start analyzing Blockchain data in an instant. -Dune团队和我们的一些社区成员已经制作了很好的内容,这些内容可以帮助你成为Dune巫师(Wizard)。 +The Dune Team and several of our community members have produced great content to aid you in your journey of becoming a Dune Wizard. -你可以从观看我们的视频系列开始 [这里](video-series.md) 或者通过文字教程 [这里](dune-guides/).\ -如果你对SQL完全不熟悉,不妨先用所列的SQL指南学习一下SQL [这里](sql-guides.md). +You can either start out by watching our video series [here](video-series.md) or looking through written tutorials [here](dune-guides/).\ +If you are entirely unfamiliar with SQL, it might be good to start off by learning some SQL with the guides listed [here](sql-guides.md). {% content-ref url="video-series.md" %} [video-series.md](video-series.md) @@ -22,22 +22,23 @@ Dune团队和我们的一些社区成员已经制作了很好的内容,这些 [dune-guides](dune-guides/) {% endcontent-ref %} -## 你需要知道哪些? +## What do you need to know? -#### SQL知识 +#### SQL knowledge -要想在Dune上成功地查询到数据,需要对SQL有一个基本的了解。\ -PostgreSQL数据库几乎在各行各业都被广泛使用,你可以找到很多关于它的非Dune专用的文档。这往往有助于回答与查询有关的问题,因为大多数答案可以在互联网上很容易找到。[PostgreSQL 文档](https://www.postgresql.org/docs/12/index.html) 官方文档也很有帮助. Dune运行在 PostgreSQL 12.2上. +A fundamental understanding of SQL is needed to be able to successfully query for data on Dune.\ +PostgreSQL Database Systems are widely used across almost all walks of life and you can find a lot of non Dune specific documentation about it. This often times helps with answering query related questions since most answers can easily be found in the internet. The official [PostgreSQL documentation](https://www.postgresql.org/docs/12/index.html) is quite helpful as well. Dune runs on PostgreSQL 12.2. -#### 以太坊虚拟机(EVM)数据 +#### Ethereum Virtual Machine data -你能在链上找到的数据,在Dune的数据库中基本都能找到,这个过程在许多方面都与理解以太坊虚拟机的整体工作方式有关,还需要理解具体的智能合约是如何工作的。如果你能够阅读Etherscan中的大部分数据,你就已经在能够在dune上熟练的查询各种数据了。\ -然而目前我们真的没有一个很好的资源可以提供,因为每个智能合约都有自己的规则。我们已经在我们的网站上写了一些关于这个问题的教程。[Section "decoded data"](../../data-tables/data-tables/decoded-data.md). +The data you will find on chain and therefore in Dune's databases is in many ways connected to understanding how the Ethereum Virtual Machine works as a whole and then in more specific terms understanding how the specific smart contracts work. If you are able to read most of the data in Etherscan, you are already well on your way to being able to query for things on dune.\ +Unfortunately there really isn't one great resource we can point you to currently as each smart contract has it's own rules. We have written up a few words on this in our [Section "decoded data"](../../data-tables/data-tables/decoded-data.md). -#### 业务理解 +#### Business Understanding -以上这些对你们中的一些人来说可能是一个惊喜,但实际上了解什么样的数据对你的项目或主题是有用的,是成为一个厉害的数据分析师的基础。\ +This is something that might come as a surprise to some of you, but actually understanding what kinds of data is interesting for your project or topic is a fundamental part of becoming a great wizard. \ \ -问你自己: **哪些数据是我的项目所关心和需要的,可以帮助我的决策过程 ?** +Ask yourself: **What Data is interesting and needed for my project to make better decisions ?** + +There is a thousand ways to go about finding what metrics are interesting to your project, but talking to the community of the project or the founders usually yields good results. -有上千种方法去寻找你的项目对哪些指标感兴趣,多与项目的社区或创始人交流通常会产生好的结果。 diff --git a/about/tutorials/dune-guides/README.md b/about/tutorials/dune-guides/README.md index f9228bd..54a80a7 100644 --- a/about/tutorials/dune-guides/README.md +++ b/about/tutorials/dune-guides/README.md @@ -1,6 +1,6 @@ -# Dune 指南 +# Dune Guides -我们的一些社区成员已经为Dune制作了很棒的教程。 +Some of our Community Members have produced great written tutorials for Dune: [Andrew Hong](https://twitter.com/andrewhong5297) @@ -31,6 +31,6 @@ -这些指南都很好,我们建议阅读所有的指南。\ +These guides are all great and we recommend reading all of them.\ \ -非常**感谢**这些指南的作者,你们太了不起了! +Big **thank you** to the authors of these guides, you are amazing! diff --git a/about/tutorials/dune-guides/tips.md b/about/tutorials/dune-guides/tips.md index ae1722f..8f64ca4 100644 --- a/about/tutorials/dune-guides/tips.md +++ b/about/tutorials/dune-guides/tips.md @@ -1,34 +1,34 @@ -# 查询技巧 +# Tips for querying -你可以通过我们的界面与数据表进行互动,网址是 [dune.xyz](https://www.dune.xyz/). +You can interact with the data tables through our interface at [dune.xyz](https://www.dune.xyz/). -要创建一个新的查询,你只需点击右上角的`New Query`。 +To create a new query you simply click `New Query` in the top right corner ![](https://i.imgur.com/dMHavC8.png) -在你的左边,你可以在下拉列表中选择你要使用的数据库,然后在窗口中看到数据表。只要搜索你感兴趣的项目就可以了。 +On your left you can select which database you want to use in the dropdown list and then see the data tables in the window. Just search for the project you are interested in working with. -## 使用抽象表(abstractions) +## Use abstractions -使用Dune Analytics进行分析的最简单方法是使用准备好的[抽象表](.../.../data-tables/data-tables/abstractions.md)表,如`dex.trades`。所有的表都是经过清理的,包含了数据和元数据(如人类可读的标记符号),使它们查询会非常便捷。 +The easiest way to do great analysis with Dune Analytics is to use prepared [abstractions](../../../data-tables/data-tables/abstractions.md) tables like `dex.trades`. All tables are cleaned and contains data and metadata (like human readable token symbols) that make them very straight forward to query. -## 在查询中使用以太坊地址 +## Using Inline Ethereum addresses -在Dune中,以太坊地址被存储为postgres字节数,并以`x`前缀进行编码。这与习惯的`0x`前缀不同。如果你想使用一个地址,比如说过滤一个给定的代币,你可以这样做 +In Dune Ethereum addresses are stored as postgres bytearrays which are encoded with the `\x` prefix. This differs from the customary `0x` prefix. If you’d like to use an inline address, say to filter for a given token, you would do ```sql WHERE token = '\x6b175474e89094c44da98b954eedeac495271d0f' ``` -是下面的简洁版本 +which is simply short for ```sql WHERE token = '\x6b175474e89094c44da98b954eedeac495271d0f'::bytea ``` -## 引用驼峰字母的列名和表名 +## Quote camel case column and table names -列和表的名称大多直接取自智能合约的ABI,没有任何修改。由于大多数智能合约是用Solidity编写的,而且是用驼峰命名惯例编写的,所以Dune的许多表和列名也是如此。Postgres要求你用双引号去区分的列和表的大小写。 +Column and table names are mostly taken directly from smart contract ABIs, with no modification. Since most smart contracts are written in Solidity, and written with a camelCased naming convention, so is many of Dune’s table and column names. Postgres requires you to quote columns and tablenames that are case sensitive: ```sql SELECT “columnName” @@ -36,7 +36,7 @@ FROM projectname.”contractName_evt_EventName” LIMIT 10 ``` -在Postgres中,双引号是为表和列保留的,而单引号是为值保留的: +In Postgres, double quotes are reserved for tables and columns, whereas single quotes are reserved for values: ```sql SELECT “columnName” @@ -45,61 +45,60 @@ WHERE contract_address = '\x6B175474E89094C44Da98b954EedeAC495271d0F' LIMIT 10 ``` -模式(schemas)在Dune中总是小写的。 +Schemas are always lowercase in Dune. ## Remove decimals -以太币转账和大多数ERC-20代币都是18位数字。为了得到一个更适合人类阅读的数字,你需要去掉所有的代表小数的0。表`erc20.tokens`为你提供了流行代币的合约地址、符号和小数点的数量。然后将代币价值转移除以10的小数点幂。 +Ether transfers and most ERC-20 tokens have 18 decimal places. To get a more human readable number you need to remove all the decimals. The table `erc20.tokens` gives you contract address, symbol and number of decimals for popular tokens. Token value transfers are then divided by 10 to the power of decimals from this table: `transfer_value / 10^erc20.tokens.decimals` -## 使用`date_trunc`获得时间 +## Use `date_trunc` to get time -我们在解码的事件表中加入了`evt_block_time`,以方便你使用。使用它的一个很好的方法是与`date_trunc`函数一起使用,像这样 +We’ve added `evt_block_time` to decoded event tables for your convenience. A neat way to use it is with the `date_trunc` function like this ```sql SELECT date_trunc('week', evt_block_time) AS time ``` -你可以用minute, day, week, month. +Here you can use minute, day, week, month. -## 如何获得美元价格(USD) +## How to get USD price To get the USD volume of onchain activity you typically want to join the smart contract event you are looking at with the usd price and join on minute. Also make sure that asset matches asset. -为了获得链上活动的美元交易量,你通常要将你所看的智能合约事件与美元价格就行关联,以分钟为关联的键,还要确保资产与资产相匹配。 + ```sql LEFT JOIN prices.usd p ON p.minute = date_trunc('minute', evt_block_time) AND event."asset" = p.contract_address ``` -然后,你可以在你的`SELECT`语句中简单地将智能合约事件的价值或金额与美元价格相乘:`* p.price`。 - -## 代币符号 +Then you can simply multiply the value or amount from the smart contract event with the usd price in your `SELECT` statement: `* p.price`. -你经常想按代币地址来分组查询结果。例如,你想看到按代币查询在DEX上的交易量。然而,一大堆代币地址的列表是抽象的,难以理解的。 +## Token symbols -因此,你经常想用代币符号来代替,简单地将表`erc20.tokens`与你的事件表关联起来,使用asset=token地址。然后你就可以用代币的符号代替地址。 +You often want to group your results by token address. For instance you want to see volume on a DEX grouped by token. However, a big list of token addresses are abstract and hard to digest. -**NB** `erc20.tokens`表包含了一些流行的代币。如果你正在处理更多晦涩难懂的代币,你应该注意与该表的关联,因为不在coincap表中的代币可能被排除在你的结果之外。 +Therefore you often want to use the token symbol instead. Simply join the table `erc20.tokens` with your event table where asset = token address. You then select symbol in your select statement instead of token address. +**NB** The `erc20.tokens` table cointains a selection of popular tokens. If you are working with more obscure tokens you should be careful with joining with this table because tokens that are not in the coincap table might be excluded from your results. -## 用参数过滤查询和仪表盘 +## Filter queries and dashboards with parameters -参数可以把你的查询或仪表盘变成区块链数据的应用程序。 +Parameters can turn your query or dashboard into an app for blockchain data. -在查询编辑器页面上点击SQL编辑器右下方的`Add parameter`。 +Click `Add parameter` in the bottom right of the SQL editor on the query editor page ![](https://i.imgur.com/rYJVSqA.png) -双层大括号将出现在你的查询中`{{}}`。在这些大括号中,你可以放入你的参数名称,如 `token symbol`或`holder address`。 +Double curly bracets will appear in your query `{{}}`. Inside these you put the name of your paramter like `token symbol` or `holder address`. -注意,如果你想在你的查询中使用参数`WHERE token = '{{token symbol}}'`,你需要加上单引号。 +Note that you need to put single quotes if you want to use the parameter in your query `WHERE token = '{{token symbol}}'`. -为了使用户不必为地址输入`\x`,一个有用的地址格式化是这样的。 +To save the user from having to put in `\x` for the address a useful formatting of addresses is this one: ```sql WHERE contract_address = CONCAT('\x', substring('{{token address}}' from 3))::bytea ``` -这让你的查询用户在过滤时只需粘贴`0xc00e94cb662c3520282e6f5717214004a7f26888`而不是`\xc00e94cb662c3520282e6f5717214004a7f26888`。 +This let’s a user of your query simply paste in `0xc00e94cb662c3520282e6f5717214004a7f26888` instead of `\xc00e94cb662c3520282e6f5717214004a7f26888` when they filter. diff --git a/about/tutorials/our-network-course.md b/about/tutorials/our-network-course.md index 8400faa..2e530ce 100644 --- a/about/tutorials/our-network-course.md +++ b/about/tutorials/our-network-course.md @@ -1,14 +1,13 @@ # Our Network course -我们来自OurNetwork的朋友与Dune Analytics合作创建了一个课程,在30天内教给30人web3数据分析。 +Our friends from OurNetwork have created a course in cooperation with Dune Analytics that taught 30 people web3 data in 30 days. -该课程涵盖了成为一名的Dune创作者的所有主题,并向所有人免费提供。它由Dune上的一些最好的创作者主讲,是开始你的Dune之旅的好地方。 +The course consists of presentations around all important topics that you need to become a Dune Creator and is available for free to everyone. It was hosted by some of the best creators we have on Dune nowadays and is currently the place to start your Dune Journey. -更多的细节信息和课程资料可以从下面找到: +More details and course materials can be found here: [https://ournetwork.mirror.xyz/gP16wLY-9BA1E\_ZuOSv1EUAgYGfK9mELNza8cfgMWPQ](https://ournetwork.mirror.xyz/gP16wLY-9BA1E\_ZuOSv1EUAgYGfK9mELNza8cfgMWPQ) Please consider buying an edition of the mirror post to support the teachers of this course. -请考虑购买mirror,以支持本课程的教师。 diff --git a/about/tutorials/queries/README.md b/about/tutorials/queries/README.md index a91268e..68ab646 100644 --- a/about/tutorials/queries/README.md +++ b/about/tutorials/queries/README.md @@ -1,12 +1,13 @@ -# 查询模板 +# Query templates -**根据我们的经验,你最好在Dune周围寻找你可能感兴趣的查询,并查看这些查询的源代码来学习。** +**In our experience, you are best off looking around Dune and finding queries that you might find interesting and looking at the source code of those to learn.** -Dune是一个由用户共享的协作的平台。所有数据分析师的复合知识将使你以最快的方式获得结果。 -看到查询的结果和反馈,确实可以让你更直观地参与到内容中去,学习得更快。\ -**找到优秀的查询创建者,并将他们的查询分叉,以获得最大的效率。** +Dune is a collaborative endeavour that is shared by it's users. The compounded knowledge of all analysts will allow you to get to results the fastest way.\ +Seeing the queries live and in action does allow you to more intuitively engage with the content and learn faster. -**我们一些最好的创作者:** +**Find great query creators and fork their queries for maximum efficiency.** + +**Some of our best creators are these:** * [https://dune.xyz/hagaetc](https://dune.xyz/hagaetc) * [https://dune.xyz/rchen8](https://dune.xyz/rchen8) @@ -16,7 +17,7 @@ Dune是一个由用户共享的协作的平台。所有数据分析师的复合 * \*\*\*\*[https://dune.xyz/Siang513](https://dune.xyz/Siang513) * [https://dune.xyz/keeganead](https://dune.xyz/keeganead) -**我们在此收集了一些查询,以做简单介绍:** +**Nevertheless we have collected some queries here for a simple introduction:** {% content-ref url="untitled-6.md" %} [untitled-6.md](untitled-6.md) diff --git a/about/tutorials/queries/eth-balance-of-a-wallet.md b/about/tutorials/queries/eth-balance-of-a-wallet.md index a41e985..22bc42a 100644 --- a/about/tutorials/queries/eth-balance-of-a-wallet.md +++ b/about/tutorials/queries/eth-balance-of-a-wallet.md @@ -1,6 +1,6 @@ -# 钱包的ETH余额 +# ETH Balance of a wallet -这个查询可以得出一个钱包在一段时间内的ETH余额。 +This Query yields the ETH balance of a wallet over time. ```sql Select sum(transfer) over (order by day asc), day @@ -35,4 +35,4 @@ SELECT date_trunc('day', block_time) as day, sum(-value/1e18) as transfer ) as x ``` -原作者: [https://twitter.com/MSilb7](https://twitter.com/MSilb7) +Original author: [https://twitter.com/MSilb7](https://twitter.com/MSilb7) diff --git a/about/tutorials/queries/gas-metrics-per-wallet.md b/about/tutorials/queries/gas-metrics-per-wallet.md index 399537a..ecf3ad8 100644 --- a/about/tutorials/queries/gas-metrics-per-wallet.md +++ b/about/tutorials/queries/gas-metrics-per-wallet.md @@ -1,6 +1,6 @@ -# 每个钱包的gas花费 +# gas metrics per wallet -### 总的gas费用(USD) +### Running Total of Gas Paid in USD ```sql with alltransactions @@ -33,7 +33,7 @@ ON date_trunc('minute', block_time) = minute ORDER BY block_time DESC ``` -### 总的gas费用(ETH) +### Running Total of Gas Paid in ETH ```sql with alltransactions @@ -58,7 +58,7 @@ FROM alltransactions ORDER BY block_time DESC ``` -### 平均gas费用 +### Average Gas Price Paid ```sql with alltransactions @@ -81,7 +81,7 @@ SELECT FROM alltransactions ``` -### 平均gas费用(USD) +### Average Gas Fee in USD ```sql with alltransactions @@ -113,7 +113,7 @@ LEFT JOIN ON date_trunc('minute', block_time) = minute ``` -### 最高gas费用(USD) +### Highest Gas Fee Paid in USD ```sql with alltransactions @@ -145,7 +145,7 @@ LEFT JOIN ON date_trunc('minute', block_time) = minute ``` -### 每月gas费用(USD) +### Gas Fees Paid by Month in USD ```sql with alltransactions diff --git a/about/tutorials/queries/price-queries.md b/about/tutorials/queries/price-queries.md index d29ba7e..2577baf 100644 --- a/about/tutorials/queries/price-queries.md +++ b/about/tutorials/queries/price-queries.md @@ -1,6 +1,6 @@ -# 价格查询 +# price queries -### 中心化交易所价格数据 +### Centralized exchange price data ```sql Select @@ -14,7 +14,7 @@ WHERE symbol = '{{1. Symbol}}' and minute > now() - interval '1hour' ``` -### 去中心化交易所价格数据 +### Decentralized exchange price data ```sql Select @@ -28,9 +28,9 @@ WHERE symbol = '{{1. Symbol}}' and hour > now() - interval '1000hour' ``` -这个查询以来erc20.tokens表,当该小时内没有提交的交易时,可能会出现空隙。 +This Query depends on the erc20.tokens table and can have gaps when there are no trades that been committed in that hour. -对于一个更好但更复杂的版本,使用这个: +For a better but more complicated to navigate version use this: ```sql with dex_trades AS ( @@ -107,4 +107,4 @@ with dex_trades AS ( AND d.hour < b.next_hour -- Yields an observation for every hour after the first transfer until the next hour with transfer ``` -这将根据dex交易数据按小时返回价格,并填补没有进行过交易的空白行。你可以在第53行调整所需的交易样本量,以便获取价更好的格数据。这可以帮助修正arbritrage机器人在dexes上获得奇怪价格的异常情况。如果你有这方面的问题,请在Discord上与我们联系。 \ No newline at end of file +This will return the price by hour according to dex trading data and fill in gaps where there have been no trades commited. You can adjust the sample size of trades required to carry the price data forward in line 53. This can help ammend edge cases where arbritrage bots get weird prices on dexes. If you have issues with this, please reach out to us on Discord. diff --git a/about/tutorials/queries/supply.md b/about/tutorials/queries/supply.md index 577c288..c5ad313 100644 --- a/about/tutorials/queries/supply.md +++ b/about/tutorials/queries/supply.md @@ -1,8 +1,8 @@ -# 代币在一段时间内的总供应量 +# total supply over time of a token -你可以使用该token的合约表,只要他们被解码([decoded](../../../data-tables/data-tables/decoded-data.md)): +You can either use that token's specific tables as long as they are [decoded](../../../data-tables/data-tables/decoded-data.md): ```sql SELECT @@ -24,8 +24,9 @@ UNION ) as net; ``` -或者你可以使用一些更通用的方式查询,就像这个: -(请注意,虽然这对大多数ERC20代币都有效,但有些代币的结构有细微变化,这个查询就会不起作用。) +Or you can use a more general purpose query like this one: + +(Please note that while this works for most tokens, some tokens do have slight changes in their structure that break this query) ```sql Select diff --git a/about/tutorials/queries/tx-wallet.md b/about/tutorials/queries/tx-wallet.md index 1644b56..761d488 100644 --- a/about/tutorials/queries/tx-wallet.md +++ b/about/tutorials/queries/tx-wallet.md @@ -1,6 +1,6 @@ -# 每个钱包的原始交易 +# raw transactions per wallet -### 总交易笔数 +### Total # of Transactions ```sql with alltransactions @@ -24,7 +24,7 @@ FROM alltransactions ``` -### 交易成功率 +### Transaction Success Rate ```sql with alltransactions @@ -50,7 +50,7 @@ GROUP by success ORDER BY success DESC ``` -### 某时间的总交易笔数 +### Running Total of # of Transactions ```sql with alltransactions diff --git a/about/tutorials/queries/untitled-1.md b/about/tutorials/queries/untitled-1.md index 0e0c8ee..6ed74f4 100644 --- a/about/tutorials/queries/untitled-1.md +++ b/about/tutorials/queries/untitled-1.md @@ -1,6 +1,6 @@ -# 一个地址的每个代币(和美元价值)在一段时间内的情况 +# Token (and USD value) per token over time for an address -请注意,当在很长一段时间内有许多代币和转让时,这个查询会变得非常繁重。 +Note that this query can get very heavy when there are many tokens and transfers over a long period of time. ```sql WITH transfers AS ( diff --git a/about/tutorials/queries/untitled-2.md b/about/tutorials/queries/untitled-2.md index f1a102d..993836d 100644 --- a/about/tutorials/queries/untitled-2.md +++ b/about/tutorials/queries/untitled-2.md @@ -1,10 +1,10 @@ -# 某一代币在Uniswap上的美元价格 +# USD price for a token from Uniswap -在Dune Analytics上获取代币美元价格的最常见和最简单的方法是使用`prices.usd`表。然而,这个数据是从中心化交易所获取的,所以对于长尾(小众)的代币,最好的方法是从Uniswap获取价格。 +The most common and easiest way to get token USD prices on Dune Analytics is with the `prices.usd` table. However, this data is fetched from centralised exchanges so for a long tail of tokens the best approach is to get prices from Uniswap. -这个查询使用WETH对,用来映射到美元价格。该查询可以被修改,以适用于任何有`prices.usd`价格的代币。 +This query uses WETH pairs, which is used to map to USD price. The query can be modified to work with any token that has a price in `prices.usd` -你可以在这里找到相关内容[这里](https://explore.dune.xyz/queries/11050/source?p\_Token%20address=0xeb4c2781e4eba804ce9a9803c67d0893436bb27d). +You can find this query on Dune [here](https://explore.dune.xyz/queries/11050/source?p\_Token%20address=0xeb4c2781e4eba804ce9a9803c67d0893436bb27d). ```sql WITH weth_pairs AS ( -- Get exchange contract address and "other token" for WETH diff --git a/about/tutorials/queries/untitled-3.md b/about/tutorials/queries/untitled-3.md index 9f3d528..1a13f47 100644 --- a/about/tutorials/queries/untitled-3.md +++ b/about/tutorials/queries/untitled-3.md @@ -1,4 +1,4 @@ -# 获取一个事件(event)的代币美元价值 +# USD value of token utilised for an event ### diff --git a/about/tutorials/queries/untitled-6.md b/about/tutorials/queries/untitled-6.md index 3866102..ebe8bfb 100644 --- a/about/tutorials/queries/untitled-6.md +++ b/about/tutorials/queries/untitled-6.md @@ -1,4 +1,4 @@ -# 查询一段时间的用户和交易量 +# Users and amount over a trailing period ```sql SELECT date_trunc('day', evt_block_time), diff --git a/about/tutorials/sql-guides.md b/about/tutorials/sql-guides.md index 80ab060..f1697ff 100644 --- a/about/tutorials/sql-guides.md +++ b/about/tutorials/sql-guides.md @@ -1,16 +1,16 @@ -# SQL指南 +# SQL guides -**PostgreSQL教程** +**General PostgreSQL Tutorials** -为了成为一名成功的Dune Wizard,你需要对PostgreSQL有一个很好的了解,以便能够从我们的数据库中查询数据。 +To be a successful Dune Wizard you need to have a good understanding of PostgreSQL to be able to query data from our database. -我们已经整理了一些资源,我们认为这些资源对你成为一名Dune Wizard的旅程是有帮助的。 +We have compiled a few resources that we think are helpful in your journey to becoming a Dune Wizard. -[FreecodeCamp.org](https://www.youtube.com/watch?v=qw--VYLpxG4) 视频教程列表 (免费) +[FreecodeCamp.org](https://www.youtube.com/watch?v=qw--VYLpxG4) Video Playlist (FREE) -[Amigoscode](https://www.youtube.com/watch?v=5hzZtqCNQKk) Youtube视频 (免费) +[Amigoscode](https://www.youtube.com/watch?v=5hzZtqCNQKk) Youtube Video (FREE) [UDEMY Course SQL & PostgreSQL for Beginners](https://www.udemy.com/course/sql-and-postgresql-for-beginners/?ranMID=39197\&ranEAID=JVFxdTr9V80\&ranSiteID=JVFxdTr9V80-nnMsdWXzWeu9lqxtbEa72g\&utm\_source=aff-campaign\&LSNPUBID=JVFxdTr9V80\&utm\_medium=udemyads) ($10) -[Mode SQL Tutorial](https://mode.com/sql-tutorial/) (免费) +[Mode SQL Tutorial](https://mode.com/sql-tutorial/) (FREE) diff --git a/about/tutorials/video-series.md b/about/tutorials/video-series.md index 11f511d..d5114e2 100644 --- a/about/tutorials/video-series.md +++ b/about/tutorials/video-series.md @@ -1,32 +1,34 @@ -# 视频教程系列 +# Video Series -我们在Youtube上制作了一系列的视频教程 [Youtube频道](https://www.youtube.com/channel/UCPrm9d2hLd\_YxSExH7oRyAg). +We have produced a video tutorial series on our [Youtube Channel](https://www.youtube.com/channel/UCPrm9d2hLd\_YxSExH7oRyAg). -## Dune 5分钟入门 +## Dune Analytics 5 Minute Intro + +This Video is the quickest and best way to get an introduction to Dune, be sure to check it out. -这个视频是了解Dune的最快速和最好的方法,一定要看一看。 {% embed url="https://www.youtube.com/watch?v=S-cctFmR828" %} -## 课程介绍 +## Intro to the Course + +This Video serves as an overview and intro to the whole course. -本视频是对整个课程的概述和介绍。 {% embed url="https://youtu.be/USTIesVPk68" %} -## 第1集: 案例和应用 +## Episode 1: Usecases and Applications -本视频解释了Dune的基础知识和它可以用来做什么。 +This Video explains the basics of Dune and what it can be used for. {% embed url="https://www.youtube.com/watch?v=IHC8HAZvw_Q" %} -## 第2集: 数据库 +## Episode 2: The database -本视频介绍了Dune中的数据表以及数据库的工作方式。 +This Video goes over the Data tables in Dune and how the database works. {% embed url="https://youtu.be/UDu23Eyvo_Y" %} -## 第3集: 简单query实例以及重建Fees.wtf查询 +## Episode 3.1: Simple Queries and recreating Fees.wtf in Dune -这个视频是对Dune内部查询的一个很好的介绍。我们的社区经理Boxer在Dune中重新创建了Fees.wtf,所以视频主要集中在gas交易方面。 +This Video is a great introduction to querying inside of Dune. Our Community Manager Boxer recreates Fees.wtf inside of Dune, so the Video mostly focuses on gas transactions. {% embed url="https://youtu.be/ez3VfcfNwvc" %} diff --git a/about/usecases/README.md b/about/usecases/README.md index e01661f..e3afc81 100644 --- a/about/usecases/README.md +++ b/about/usecases/README.md @@ -1,19 +1,18 @@ --- -说明: >- - 利用Dune来为你个人,你的项目,你的机构提供洞见。 - +description: >- + Leverage Dune to generate Insights for yourself, your project or your + organisation. --- -# 使用案例 - -## Dune是一个开放平台 +# Use Cases -Dune是一个区块链数据的分析平台,它将链上数据变成用户可读的数据并免费提供给用户。用户可以使用PostgreSQL来查询链上的数据,同时可以创建多个查询组成的仪表盘来讲述故事。Dune上的查询(query)是公开的,任何人都可以查看和分叉(fork),但隐私查询(private query)是非公开的,该功能只对订阅专业计划(Pro Plan)的用户开放。 +## Dune is an open platform +Dune is a data analytics platform that surfaces blockchain data turns on chain data into human readable data available to users for free. Users can query on chain data using PostgreSQL and create dashboards that group queries together to tell a story. Queries on Dune are public goods and are available for anyone to view and fork with the exception of private queries, which are available to users who have the pro plan subscription. -## **Dune用途有哪些?** +## **What is Dune used for?** -在Dune上几乎所有的事情都是可能的,所以在链上数据的查询方面,它没有任何限制。但我们可以展示一些具体的使用案例: +Since pretty much everything is possible on Dune, there really aren't any limitations as to what you can query in regards to on-chain data. There still is some distinct Use Cases we can establish: {% content-ref url="sector-dashboards.md" %} [sector-dashboards.md](sector-dashboards.md) @@ -28,11 +27,14 @@ Dune是一个区块链数据的分析平台,它将链上数据变成用户可 {% endcontent-ref %} \ -Dune上的创作内容是哪些类型? +What type of content is generated on Dune? ------------------------------------------ -为了获得更多关于用户如何使用Dune的洞见,你可以关注我们的推特账户,我们会转发Dune上最有趣的创作内容。\ - \ -只要点击一下最近的几条推文,就可以看到用户在Dune上的最新作品了! +To get more insights into how people use Dune, you can follow our Twitter account where we retweet the most interesting things that happen on Dune.\ +\ +Just click through the last few tweets and see what people are up to on Dune currently! {% embed url="https://twitter.com/DuneAnalytics" %} + +\ +\\ diff --git a/about/usecases/ecosystem-dashboards.md b/about/usecases/ecosystem-dashboards.md index 2b18492..0ca7efc 100644 --- a/about/usecases/ecosystem-dashboards.md +++ b/about/usecases/ecosystem-dashboards.md @@ -1,22 +1,22 @@ -# 生态仪表盘 +# Ecosystem Dashboards -**Dune汇总了所有数据集,因此你也可以探索更多的一般性指标。** +**Since Dune has all the data in one place you can also check more general metrics.** -## 矿工费(Gas) +## Gas Prices [https://dune.xyz/kroeger0x/gas-prices](https://dune.xyz/kroeger0x/gas-prices) -你可以用Dune很容易地收集到每个tx的平均矿工费(gas)、矿工费上限、一个区块的总矿工费等数据。 +You can easily assemble the data on average gas spent per tx, gas limit, gas spent in total in a block etc. using Dune. ![](<../../.gitbook/assets/image (13) (2).png>) ![](<../../.gitbook/assets/image (21).png>) -花费的矿工费(gas)和类似指标的数据也可能与具体协议有关,请记住这一点。 +Data on gas spent and similar metrics can also be relevant to certain protocols, so do keep this in mind. -## **DeFi用户** +## **DeFi Adoption** -[Richard Chen](https://twitter.com/richardchen39) 整合了所有重要的DeFi协议的用户数量,并将它们纳入了一个仪表盘。 +[Richard Chen](https://twitter.com/richardchen39) has compiled the user numbers of all important DeFi Protocols and compiled them in one Dashboard. ![](<../../.gitbook/assets/image (22).png>) diff --git a/about/usecases/project-dashboards.md b/about/usecases/project-dashboards.md index 593998b..d328b04 100644 --- a/about/usecases/project-dashboards.md +++ b/about/usecases/project-dashboards.md @@ -2,25 +2,25 @@ description: Project Dashboards are a great way to track the metrics of your project. --- -# 项目仪表盘 +# Project Dashboards -**项目仪表盘使你能够轻松地将你最喜欢的项目的数据汇集到一起。**\ -**没有基础设施需要维护,你可以简单地查询你想要的数据并将其聚合在仪表盘上,为你的项目提供一个现实的数据中心。** +**Project Dashboard allow you to easily assemble data on your favorite project in one place.**\ +**Without having to maintain infrastructure or overhead, you can simply query for the data you desire and assemble it on a Dashboard to make a Datahub for your project Reality.** -**让我们通过一个例子来探索:** +**Let's explore this with an example:** \*\*\*\*[**https://dune.xyz/poma/tornado-cash\_1**](https://dune.xyz/poma/tornado-cash\_1)\*\*\*\* -这是Tornado Cash的仪表盘,有创作者将所有重要的指标集合在了一个地方。 +This is the dashboard from Tornado Cash on which someone assembled all the important metrics in one place. ![](<../../.gitbook/assets/image (18).png>) -我们可以看到,创作者向我们展示了一些一目了然的计数器,用简单的数字告诉我们最重要的信息。 +We can see that the creator is showing us a few "on a glance" counters which tell us the most important information in simple numbers. ![](<../../.gitbook/assets/image (18) (1).png>) -接着他用一些有趣的历史数据,显示了用户和体量的增长。这只是仪表盘的一部分,但从中你可以清楚地看到这些统计数字和图表可以为你的项目带来多大的价值。 +He follows this up with some interesting historical data points which show the growth in users and volume. The Dashboard continues, but you can clearly already see how much value these stats and charts can produce for your project. -拥有所有这些统计数据,将十分有助于你的项目管理并帮助它获得成功。 +Having all these stats in one place greatly helps to manage your project and help it succeed. -你可以在我们的网站上找到许多其他更强大的仪表盘:[Projects Page](https://dune.xyz/projects). +You can find many other great dashboard on our [Projects Page](https://dune.xyz/projects). diff --git a/about/usecases/sector-dashboards.md b/about/usecases/sector-dashboards.md index 8fafb2f..b2e2610 100644 --- a/about/usecases/sector-dashboards.md +++ b/about/usecases/sector-dashboards.md @@ -1,18 +1,18 @@ -# 细分仪表盘 +# Sector Dashboards -**细分仪表盘让你可以一览细分的新兴领域,并实时分析正在发生的事情。** +**Sector Dashboards allow you to glance at an entire sector of our new Economy and analyse what's happening in real time.** -让我们通过一些例子来探讨这个问题: +Let's explore this with some examples: -## Dex指标 +## Dex Metrics [**https://dune.xyz/hagaetc/dex-metrics**](https://dune.xyz/hagaetc/dex-metrics) -这个仪表盘让你可以一次看清整个去中心化交易所的情况。 +This Dashboard allows you to take a look at the entirety of decentralized exchanges at once. -你可以看到Dex交易量、市场份额、所有交易所的总交易量以及更多的统计数据,一目了然。这让你可以比较不同交易所之间的表现,同时评估整个细分领域的表现。 +You can see Dex Volume, Market share, Total Volume across all exchanges and many more stats all on one glance. This allows you to compare the performance of different dexes with each other and at the same time evaluate the performance of the entire sector. -所有这些都是实时更新的,并由社区维护,如果一个新的dex想出现在这个仪表盘上,他们所要做的就是提交他们的代码到我们的公开github。更多内容见[抽象表](../../data-tables/data-tables/abstractions.md). +All of this updates in real time and is maintained by the community, if a new dex wants to be on this dashboard, all they have to do is submit their code to our public github. More on this in [abstractions](../../data-tables/data-tables/abstractions.md). ![](<../../.gitbook/assets/image (7).png>) @@ -20,29 +20,30 @@ ![](<../../.gitbook/assets/image (9).png>) -## 指数 +## Indices [**https://dune.xyz/0xBoxer/indices-products**](https://dune.xyz/0xBoxer/indices-products) -另一个有趣的仪表盘是关于去中心化指数的仪表盘。 +Another interesting Dashboard we have is a dashboard on decentralized indices. + +Here again, you can evaluate the entire state of a sector in one glance, being able to compare different products and projects to each other with ease. -在这里,你也可以一目了然地评估一个细分领域的整体状况,能够轻松地将不同的产品和项目相互比较 ![](<../../.gitbook/assets/image (10).png>) ![](<../../.gitbook/assets/image (11).png>) ![](<../../.gitbook/assets/image (12).png>) -## 借贷 +## Lending -这同样适用于借贷协议,它让你你轻松地了解借贷协议的状况并相互比较。 +The same applies for lending protocols, it allows you to easily check the state of lending protocols and compare them to each other with ease. ![](<../../.gitbook/assets/image (13).png>) ![](<../../.gitbook/assets/image (14).png>) -## 总结 +## Summary -细分仪表盘允许你的关注者对某一新兴领域的整个情况做出假设。这对于比较不同的产品和试图发现趋势是非常有用的。 +Sector Dashboards allow your audience to make assumptions on a whole sector of this nascent Industry. This is very useful for comparing different products with each other and trying to spot trends. -大多数细分仪表盘都依赖于一个或许多[抽象表)](.../.../data-tables/data-tables/abstractions.md)表,这使得它很容易查询大量的数据并在不同的协议之间实现标准化。 +Most Sector Dashboards are relying on one or many [abstraction](../../data-tables/data-tables/abstractions.md) tables which make it easy to query for vast amounts of data and standardizing between the different protocols. diff --git a/bounties/wizard-request-program.md b/bounties/wizard-request-program.md index f89f5c1..dd09cc6 100644 --- a/bounties/wizard-request-program.md +++ b/bounties/wizard-request-program.md @@ -1,45 +1,36 @@ -# Wizard需求计划 +# Wizard Request Program -#### 对于想寻找Wizards的项目方 +#### For projects looking for Wizards -如果你是一个想要在Dune上拥有更多或者更好仪表盘的项目方,我们已经为你提供了一个途径。以下是它如何工作的说明: +If you're a project looking to have more/better dashboards on Dune, we've created this program for you. This is how it works: -1. 项目方填写这个[表格](https://bounties.dune.xyz)去详细阐明他们的全部内容以及他们想要在Dune上看到的insights类型以及他们愿意为此支付的金额。 +1. Project fills out [this form](https://bounties.dune.xyz) explaining what they're all about and the kind of insights they'd like to see surfaced on Dune and how much they're willing to pay for it.\\ +2. We share this with our community and interested wizards get in touch with you.\\ +3. Project screens wizards and chooses who to work with.\\ +4. The data flows. +As opposed to more traditional bounty programs, the Wizard Request program is meant to unlock long-lasting relationships/collaborations between the analysts and the projects at large. -2. 我们将与社区分享,感兴趣的wizards会与你联系。 +#### For Wizards looking for :moneybag::moneybag::moneybag: -3. 项目方筛选以及选择跟谁合作。 +If you are a wizard looking for bounties, make sure to join [our Discord](https://discord.gg/ErrzwBz), go to our “freelancer-listing” channel and click on the flying dollar bill emoji there. Also follow the [bounty bot](https://twitter.com/Dune\_Bounties) on Twitter. -4. 数据就流动了起来。 +**FAQs about the program** -与更传统的赏金计划相反,Wizard需求计划旨在搭建分析师与项目方之间的长期关系/合作。 - - - -#### 对于想寻找:moneybag::moneybag::moneybag:的Wizards - -如果你是寻找赏金的wizard,请务必加入[我们的 Discord](https://discord.gg/ErrzwBz),进入我们的“自由职业者列表”频道,然后单击那里美元钞票的表情符号。 你还可以在推特上关注。[赏金机器人](https://twitter.com/Dune\_Bounties) 。 - - - -**关于项目的FAQs** - -_-我需要大量的数据分析,那么应该发布多少需求??_ - -将每个需求都当作一个仪表盘。如果你想在一个仪表盘中查看所有信息,那么只需一个需求。另一方面,如果你希望看到三个不同的仪表盘,我们建议你创建三个需求。创建三个需求并不一定意味着与三个不同的分析师合作,这取决于你的想法。 +_- I need a lot of data, how many requests should I post?_ +Think of every request as a dashboard. If you’d like to see all of your information in just one dashboard, then just one request. If, on the other hand, you’d like to see three different dashboards we recommend you create three requests. Creating three requests doesn’t necessarily mean working with three different analysts, that will be up to you to decide. \ -_- 我是一名分析师。我该如何报名?_ +_- I’m an analyst. How do I enroll?_ -目前,你唯一需要做的就是加入[我们的Discord](https://discord.gg/dunecom),进入我们的“自由职业者列表”频道,然后单击那里美元钞票的表情符号,这样你就会在新请求到达时收到通知。你还应该关注 Twitter 上[的赏金机器人](https://twitter.com/Dune_Bounties) 。 -\ -_- 我想创建一个需求,但我不知道我应该为此支付/报价多少金额_ +For the moment the only thing you need to do is join [our Discord](https://discord.gg/dunecom), go to our “freelancer-listing” channel and click on the flying dollar bill emoji there, this way you’ll get notified when new requests arrive. Oh and you should definitely follow the [bounty bot](https://twitter.com/Dune\_Bounties) on Twitter. -嗯,这实际上取决于你的需求的工作量和复杂性程度,但在你可接受的范围内,我们鼓励你尽可能慷慨。如果不确定,你可以随时在我们的 Discord 上提问! +\ +_- I want to create a requests but I don’t know how much should I pay/offer for it_ -_- Dune会抽成吗??_ +Well, that really depends on how much work/complexity your request entails but to the extent that you can, we encourage you to be generous. If you ain’t sure you can always ask on our Discord! -我们不会。 事实上,Dune 不参与完成交易的过程或后续跟进,这完全是在wizard和项目之间的事情。 +_- Does Dune take a cut?_ +No we don’t. In fact, Dune does not take part in closing the deal or following up over time, this is strictly between the wizard and the project. diff --git a/changelog/dune-changes/august-2020.md b/changelog/dune-changes/august-2020.md index 6fd8079..b698c9f 100644 --- a/changelog/dune-changes/august-2020.md +++ b/changelog/dune-changes/august-2020.md @@ -2,13 +2,13 @@ -#### 价格数据源切换 -我们已将价格数据源从 Coincap 更改为 Coinpaprika,以及现在在 prices.usd 和 prices.layer1_usd 表中拥有 230 多种资产的价格! 有一点需要注意的是,以前我们有截至当前时间的所有分钟的价格,但我们现在有截至当前时间前 5 分钟的价格。 +#### Price Provider Switch -**新表prices.layer1_usd** +We’ve changed price providers from Coincap to Coinpaprika, and in turn now have prices for 230+ assets in the `prices.usd` and `prices.layer1_usd` tables! A slight caveat is that while previously we had prices for all minutes up to current time, we now have prices up to 5 minutes before current time. -我们已将所有非以太坊代币的资产移至它们的表 prices.layer1_usd。 该表按symbol分区并具有 `(symbol, minute)` +**New table prices.layer1\_usd** +We’ve moved all assets that are not tokens on Ethereum to their own table `prices.layer1_usd`. This table is partitioned on `symbol` and has `(symbol, minute)` as primary key as before. ``` Column │ Type @@ -18,20 +18,17 @@ symbol │ text ``` -#### prices schema的变化 +#### Changes to prices schema -**price.usd表新增新列decimals** +**New column decimals on prices.usd** -我们在`prices.usd`中添加了一个新的列`decimals`,这样你就可以避免与 erc20.tokens 进行额外关联来计算正确的交易量。 +We’ve added a new column `decimals` to `prices.usd` so that you can avoid the additional join with `erc20.tokens` for calculating correct volumes. +**New primary key for prices.usd** +Previously `prices.usd` was partitioned on the token `symbol`, and it’s primary key was `(symbol, minute)`. In this release we’ve made a change to this scheme to allow for multiple `contract_address`es to map to the same `symbol`. This could happen e.g. in times where a token migration is happening. `prices.usd` is now partitioned on `contract_address` and it’s primary key is `(contract_address, minute)`. -**New price.usd 的新主键** - -以前`prices.usd` 是根据代币`symbol`进行分区的 , 它的主键是 `(symbol, minute)`。在此版本中,我们对此方案进行了更改,以允许多个`contract_address`映射到同一个`symbol`。在某些场景下它会发挥作用例如在Token合约发生迁移的时候。`prices.usd`现在在`contract_address`上进行了分区,它的主键是`(contract_address, minute)`。 - -请注意,执行包含 `SELECT minute, price FROM prices.usd WHERE symbol='x'`的查询时可能会产生一些奇怪的结果。因为在某些情况下时间窗口中有两个contract映射到symbol `x`,然后你可能每分钟下会关联多多条数据。 这种情况下最好使用主键`contract_address` - +Note that this might yield some weird results for queries that rely on doing `SELECT minute, price FROM prices.usd WHERE symbol='x'` in certain cases where there are two contracts mapped to the symbol `x` in a time window. You may then receive several rows per minute. It is better to then use the primary key `contract_address` for filtering and joining. ``` Column │ Type diff --git a/changelog/dune-changes/january-2020.md b/changelog/dune-changes/january-2020.md index a749068..fd62f32 100644 --- a/changelog/dune-changes/january-2020.md +++ b/changelog/dune-changes/january-2020.md @@ -1,14 +1,12 @@ # January 2020 ## Postgres 12.1 -我们已将数据库从 postgres 11 升级到 postgres 12.1。这应该会使性能得到全面的改进。 +We’ve upgraded the database from postgres 11 to postgres 12.1. This should result in performance improvements across the board. +## ERC20 Transfer and Approval tables -##ERC20 转移和授权表 - -你现在可以查询`erc20."ERC20_evt_Transfer"`和`erc20."ERC20_evt_Approval"`表以获取解码的Token转移和授权表。这些表回包括可以使用 ERC20 标准的 ABI 解码的所有事件。这意味着所有代币的所有转账都可以通过这张表查询。该表很大(撰写本文时为240M行),因此请告诉我们你对查询性能的体验。 - +You can now query the `erc20."ERC20_evt_Transfer"` and `erc20."ERC20_evt_Approval"` tables to get decoded token transfers and approvals. These tables should include all events that could be decoded using the ABI of the ERC20 standard. This means that all transfers from all tokens can be queried through this table. The table is large (240M rows at time of writing), so please let us know your experience of the query performance. `erc20."ERC20_evt_Transfer"` schema: @@ -32,8 +30,7 @@ | `evt_tx_hash` | `bytea` | | `evt_index` | `bigint` | -这里的`contract_address`是指发出事件的合约,即代币地址,`evt_tx_hash`和`evt_index`可以方便地让你使用类似的查询关联`ethereum.logs`。 - +Here `contract_address` refers to the contract emmitting the event, i.e. the token address, while `evt_tx_hash` and `evt_index` conveniently lets you join with `ethereum.logs` using a query like ``` SELECT * @@ -43,7 +40,7 @@ ON apps.evt_tx_hash = logs.tx_hash AND apps.evt_index = logs.index LIMIT 100; ``` -另请注意,你可以将这些表与`erc20.tokens`连接起来,以获得人类可读的Token符号和小数位数,如 +Also note that you can join these tables with `erc20.tokens` to get human readable token symbols and the number of decimals like ``` SELECT value/10^decimals, tr.* @@ -54,9 +51,11 @@ WHERE symbol = 'MKR' LIMIT 10 ``` -**例子** +Note though that -**Token头部持有者** +**Examples** + +**Top token holders** ``` WITH transfers AS ( @@ -81,7 +80,7 @@ ORDER BY 2 desc LIMIT 10 ``` -**Token余额** +**Token Balances** ``` WITH transfers AS ( @@ -105,18 +104,13 @@ GROUP BY 1 ORDER BY 2 desc; ``` -## 反向解码 - -上面的表格是使用我们称为“反向解码”的新功能生成的。本质上,它能拆解为为能够被解码的日志,而无所谓事件的合约地址或合约字节码。如果你知道此解码可能有用的其他情况,请随时通过 [hello@dune.xyz](mailto:hello@dune.xyz)告诉我们 - -## 其他 - -* 现在可以分别在`gnosis_sight`、`gnosis_safe` 和`gnosis_dfusion`模式中找到 Gnosis vision、safe 和 dfusion 的数据。 -* Synthetix 代币合约现在有了正确的名称`Synthetix`并且可以在`synthetix`模式中找到 -* `prices.usd_dai`已重命名为`prices.usd_sai`,Symbol更改为 SAI - 不幸的是,我们仍然没有 DAI 价格,因为我们的价格提供者没有提供。 -* `prices.usd_rep`现在为迁移后的条目提供了正确的`REP`Token地址。以前所有条目都有旧地址。 - - +## Fallback decoding +The above tables are generated with a new feature we call “fallback decoding”. Essentially it breaks down to being able to decode logs regardless of the events contract address or contract bytecode. If you know other cases where this decoding can be useful feel free to let us know at [hello@dune.xyz](mailto:hello@dune.xyz) +## Misc +* Data for Gnosis sight, safe and dfusion can now be found in `gnosis_sight`, `gnosis_safe` and `gnosis_dfusion` schemas respectively. +* Synthetix token-contracts now have the correct name `Synthetix` and are found in the `synthetix` schema +* `prices.usd_dai` have been renamed to `prices.usd_sai`, and the symbol changed to `SAI` - we still don’t have `DAI` prices unfortunately, as our price provider has not listed it. +* `prices.usd_rep` now has the correct token address for `REP` for entries after the migration. Previsouly all entries had the old address. diff --git a/changelog/dune-changes/march-2020.md b/changelog/dune-changes/march-2020.md index 8384271..95ad1a8 100644 --- a/changelog/dune-changes/march-2020.md +++ b/changelog/dune-changes/march-2020.md @@ -2,13 +2,13 @@ -本月在数据方面有较大的更新。 +Big release on the data front this month. -#### `block_time`以及`block_number`的的非规范化 +#### Denormalization of `block_time` and `block_number` -我们为所有解码的事件和调用添加了 `block_time`和`block_number`,分别命名为 `evt_block_time`, `evt_block_number` 和`call_block_time`, `call_block_number` 这将消除平台上最痛苦的关联查询,关联`ethereum.transactions`以便在你的查询中获得时间维度。 +We’ve added `block_time` and `block_number` to all decoded events and calls, with names `evt_block_time`, `evt_block_number` and `call_block_time`, `call_block_number` respectively. This will eliminate the most painful joins on the platform, joining with `ethereum.transactions` in order to get a time dimension into your queries. -过去我们可能需要这样做 +Where previously would need to do ``` SELECT date_trunc('day', tx.block_time), count(*) @@ -17,7 +17,7 @@ INNER JOIN ethereum.transactions tx ON tp.evt_tx_hash = tx.hash GROUP BY 1; ``` -为了获得 Uniswap 上每日 `TokenPurchase`-events 的数量,你现在可以很简单地实现 +in order to get the number of daily `TokenPurchase`-events on Uniswap, you can now simply do ``` SELECT date_trunc('day', evt_block_time), count(*) @@ -25,11 +25,9 @@ FROM uniswap."Exchange_evt_TokenPurchase" GROUP BY 1; ``` -消除了令人痛苦以及消耗较大的join。通过使用`evt_block_number`或`call_block_number`,也可以在不涉及任何以太坊表的情况下完成两个解码表的连接。 +eliminating a painful and costly join. Joining across two decoded tables can also be done without involving any of the `ethereum`-tables by using `evt_block_number` or `call_block_number`. - - -####无参数解码事件 +#### Decoding events without parameters We’re also “decoding” events that are emitted without parameters. These events have their own tables, but only include Dune-added fields i.e.: @@ -41,10 +39,9 @@ We’re also “decoding” events that are emitted without parameters. These ev | `evt_block_time` | `timestamptz` | | `evt_block_number` | `bigint` | -#### 解码 Call Output +#### Decoding call outputs - -我们已将函数返回值添加到已解码的`call`table中。 每当一个有命名函数有一个返回值时,它将被解码为 `output_{{name}}`,当它没有命名时,它将被解码为`output_{{i}}`,其中 i 是一个从 0 开始的计数器。参考以下案例,计算调用 Compound CERC20 mint 函数的成功和错误代码: +We’ve added function return values to decoded `call` tables. Whenever a function has a named return value it will be decoded into `output_{{name}}`, and when it is not named it will be decoded into `output_{{i}}` where `i` is a counter that starts at 0. Consider the following case, counting success and error codes for calls to the Compound CERC20 `mint` function: ``` SELECT output_0, count(*) @@ -55,8 +52,7 @@ GROUP BY 1; #### traces.success -**TLDR**: 我们向 `ethereum.traces`添加了一个`success`字段,你可以使用它来确定确切的调用是否成功。 对例如有用 计算余额。 这是一个例子: - +**TLDR**: we’ve added a `success` field to `ethereum.traces` that you can use to figure out if an exact call was successful. Useful for e.g. calculating balances. Here’s an example: ``` SELECT sum(amount) @@ -82,13 +78,9 @@ FROM ( ; ``` -**更长的故事**: Dune 从 Parity OpenEthereum 提取交易traces。 OpenEthereum 返回一个的函数的call traces(树状数据结构),其中一些可能会有非空`error`字段。以前我们或多或少地提取过traces,今天我们在 ethereum.traces 中添加了一个`success`字段。如果在traces层次结构中有非空`error`字段但是它上面没有traces,则它的success字段为true。 - - - -我们注意到,如果父级tracese-entry有一个非空`error`字段,则子call用在 EVM 中也被视为失败。以前在 Dune 中为了正确评估给定函数调用的状态更改是否包含在区块链中,你需要编写一个稍微复杂的查询来检查跟踪树的同一分支中的任何traces 是否有错误.随着今天success字段的加入,这变得容易多了。 - +**Longer Story**: Dune ingests transaction traces from Parity OpenEthereum. OpenEthereum returns a tree-like datastructure of function call traces, where some can have a non-null `error` field. Where previously we ingested the traces more or less _as is_, today we’ve added a `success` field to `ethereum.traces`. This `success` field is `true` for a given trace if no trace above it in the trace hierarchy has a non-null `error` field. +It came to our attention that if a _parent_ trace-entry has a non-null `error` field, the _child_ call is considered failed in the EVM as well. Previously in Dune, in order to correctly assess whether or not a given function call’s state change was included in the blockchain you would’ve needed to write a slightly complex query to check if any traces in the same branch of the trace tree had an error. With the addition of the `success` field today, this has become much easier. Note that the field `tx_success` field denotes the success of the transaction as a whole, and that a `true` `tx_success`-field, does not necessarily mean that every function call in the transaction has a `true` `success` field. Here are the potential combinations @@ -98,18 +90,17 @@ Note that the field `tx_success` field denotes the success of the transaction as | `true` | `false` | | `false` | `false` | -正如你所看到的,一个成功的transaction中的一个call也可能是失败的,但在一个失败的的transaction中call都会是失败的..... - -另请注意,以前解码表上的字段 `call_success`计算为`traces.tx_success && !traces.error`,现在直接从`traces.success`复制 +As you can see a call can be _not successful_ in a _successful_ transaction, but can not be _successful_ in a _not successful_ transaction… +Also note that where previously the field `call_success` on decoded tables where calculated as `traces.tx_success && !traces.error`, it is now directly copied from `traces.success`. #### Postgresql 12.2 -将数据库升级到 postgresql 12.2。 更改日志在[这里](https://www.postgresql.org/docs/current/release-12-2.html)。 +Upgraded the databases to postgresql 12.2. Changelog [here](https://www.postgresql.org/docs/current/release-12-2.html). -#### 其他 +#### Misc -重命名了一些curvefi-contracts: +Renamed some curvefi-contracts: | schema | name | Address | | ------- | ------------ | ------------------------------------------ | @@ -120,7 +111,7 @@ Note that the field `tx_success` field denotes the success of the transaction as | curvefi | busd | 0x79a8c46dea5ada233abaffd40f3a0a2b1e5a4f27 | | curvefi | compound\_v3 | 0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56 | -将onesplit的的contracts移动到它们自己的schema下. +Moved onesplit contracts to their own schema. | schema | name | address | | -------- | -------- | ------------------------------------------------------ | diff --git a/changelog/dune-changes/march-2021.md b/changelog/dune-changes/march-2021.md index 52dc1a4..12a7001 100644 --- a/changelog/dune-changes/march-2021.md +++ b/changelog/dune-changes/march-2021.md @@ -4,70 +4,68 @@ description: Dune Analytics version 2.0 # March 2021 -## 更新概览 +## Overview of changes -* 查询 - * 保存 - * 执行 -* 刷新 -* 其他各种更新 +* Queries + * Saving + * Running +* Refreshing +* Various other upgrades -新版本的Dune无论是前端上还是底层都对查询和刷新方式做了调整。 +While all the core functionality you expect from Dune is available in Dune v2 the new version of Dune brings changes to how queries and refreshing work, both on the surface and under the hood. +## Queries -## 查询 +**Saving** -**保存** +By default, **new queries are not saved** to your queries so you can play around and test various ideas quickly. If you want to keep your work, remember to hit the **Save button** and give your query a name. -默认情况下**新查询不会保存**因此你可以快速尝试以及测试各种想法。如果你想保留你的工作成果,请记住点击 **“保存”按钮**并为你的查询命名。 +This means that if you navigate away from a page without saving, your work is lost. If you allow notifications from [dune.xyz](http://dune.xyz/) in your browser, the app will notify you when you navigate away from unsaved content. -这意味着,如果你在没有保存的情况下离开页面,你的工作成果就会丢失。如果你在浏览器中允许来自[dune.xyz](http://dune.xyz/) 的通知,当你离开未保存的内容时,该应用程序会通知你。 +The same applies to forks. A fork is not saved to your queries before you click the **Save button** and give your fork a name. -这同样适用于forks。在你单击 **保存按钮**以及为你的 fork 命名之前,不会将 fork 保存到你的查询中。 +**Running** +We’ve merged the old save and execute buttons into a single button, **Run**. When you click **Run** on a saved query, any changes you’ve made to the query text is saved and the query is queued for execution. -**执行** -我们将旧的保存和执行按钮合并为一个按钮,**Run**。当你在已保存的查询上单击**Run**时,你对查询文本所做的任何更改都会被保存,并且查询会排队等待执行。 +> _**Useful tip:**_ Press `CMD / CTRL + Enter` to run your query. +**Running query snippets** -> _**有用的tip:**_ 按住 `CMD / CTRL + Enter`可以快速运行你的查询. +If you mark parts of your query, the button changes to **Run selection**, and executes the part of the query that you’ve marked. This will updates the results and visualizations in the process but _**not save**_ the query. -**运行查询部分片段** -如果你标记查询的一部分,按钮将变为**Run selection**,并执行你标记的查询部分。这将更新项目中中的结果和可视化,但**不保存**查询。 +> _**Useful tip:**_ if you want to execute the whole query without saving it, select all of the query (CMD / CTRL + A) and then hit **Run selection**. +## Refreshing +There’s also changes to how results are refreshed. Over the last months we’ve been redesigning our entire query execution backend to bring large improvements to how Dune works. -> _**有用的tip:**_ 如果你想执行整个查询而**不保存**它,选择所有查询(CMD / CTRL + A)然后点击**Run selection** +When a visualization is viewed, either on a query page or on a dashboard, the Dune backend will inspect the age of the most recent result. If the result is stale (currently defined as >3 hours old), Dune will automatically queue an execution for this query and run it in the background. -## 刷新 -结果的刷新方式也发生了变化。 在过去的几个月里,我们一直在重新设计整个查询执行后端,以极大地改进 Dune 。 +This means that your dashboards will always be kept up to date when they are being viewed. -当在查询页面或仪表盘上查看可视化时,Dune 后端将检查最新结果的年龄。 如果结果过时(当前定义为 >3 小时前),Dune 将自动排队执行此查询并在后台运行它。 +Query creators does not need to set a refresh scheduele and the scheduling feature has been deprecated as it is no longer needed to keep results fresh. -这意味着你的仪表盘在查看时将始终保持最新状态。 +## Queues -查询创建者不需要设置刷新计划,并且计划功能已被弃用,因为它不再需要一直去刷新结果。 +We’re also bringing changes to how queueing works in Dune. When you manually click **Run** on a query an execution is queued. Every user on Dune can queue 3 queries at the same time (pro users have more, see our [pricing](https://hackmd.io/YOP3YIgaRAejTPE190sOjw?view) page for more info). -## 队列 +Automatically refreshed results (as we talked about above) does not use the query creators queuing credits nor the viewing user’s. -我们还对Dune中的排队方式进行了调整。 当你在查询里手动单击**Run**按钮时,一个查询会进入队列。Dune 上的每个用户都可以同时排队3个查询(专业用户有更多,请参阅我们的[定价](https://hackmd.io/YOP3YIgaRAejTPE190sOjw?view) 页面了解更多信息) +## Other updates -## 其他更新 +**A faster and better looking Dune** - the whole Dune app including all the charts have gotten a big facelift. The app is now also many times faster. -**一个更快、更好看的Dune** -包括所有图表在内的整个Dune应用程序都进行了重大改造。这个应用比之前快了很多倍。 +**Query parameters** - what is probably Dune’s most underrated feature has gotten a major upgrade. It’s now super easy to filter any query or dashboard for a token, address or anything really. Meaning you can turn your queries and dashboards into interactive apps for onchain data. -**查询参数** -这个可能是 Dune 最被低估的功能已经得到了重大升级。现在通过Token、地址或任何东西筛选任何查询或仪表盘都非常容易。这意味着你可以将查询和仪表盘变成用于链上数据的交互式应用程序。 +**See all content without having to log in** - simply copy and share the link from the page you are on. The exception is for paid users that make their content private, more details on our [pricing page](https://hackmd.io/YOP3YIgaRAejTPE190sOjw?view). +**Errors show on the relevant line** - when running your queries you will see error messages directly on the relevant line in your code. -**无需登录即可查看所有内容** - 只需复制并分享你所在页面的链接即可。将内容设为私有的付费用户除外,详情请参阅我们的[定价](https://hackmd.io/YOP3YIgaRAejTPE190sOjw?view) 页面。 - -**错误显示在相关行** -运行查询时,你将直接在代码的相关行上看到错误消息。 - -**单击查询标题以从仪表盘进行查询** - -我们很乐意在[Discord](https://discord.com/invite/ErrzwBz)的#feedback 频道中获得你对 Dune v2 体验的反馈。如果你遇到任何问题,也可以联系 [support@dune.xyz](mailto:support@dune.xyz)。 +**Click query title to go to query from a dashboard** +We’d love to get your feedback on your experience with Dune v2 in the #feedback channel in our [Discord](https://discord.com/invite/ErrzwBz). You can also contact [support@dune.xyz](mailto:support@dune.xyz) if you face any issues. Happy querying! -**PS.** Dune v2 目前不支持一些可视化类型:数据透视、队列、漏斗、热图和气泡。我们已向受影响的用户发送电子邮件。如果你没有收到电子邮件,你的所有查询和可视化应该在 v2 中正常运行。 +**PS.** There are a few visualisation types that are currently not supported in Dune v2: pivot, cohort, funnel, heatmap and bubble. We’ve emailed the users that are affected. If you have not been emailed all your queries and visualisations should work seamlessly in v2. diff --git a/changelog/dune-changes/october-2019.md b/changelog/dune-changes/october-2019.md index 5e288b1..6387652 100644 --- a/changelog/dune-changes/october-2019.md +++ b/changelog/dune-changes/october-2019.md @@ -1,12 +1,12 @@ # October 2019 -#### 新的数据结构 +#### New data structure -如果你要分叉旧查询,则需要注意这些变化,你可以用新的替换旧的表和列名。 +If you are forking old queries you need to be aware of these changes to you can replace old table and column names with new ones. +#### USD price tables -#### USD价格表 -以前美元价格表被命名为`coincap."tokens/usd"`现在改为`prices.usd`。 +Previously the usd price table was named `coincap."tokens/usd"` this is now changed to `prices.usd` with the fields ``` symbol -- unchanged @@ -15,9 +15,6 @@ price -- previously "average" minute -- previously "time" ``` -#### Dune生成的列 +#### Dune generated columns We add some data fields to all decoded tables for `calls` and `events`. These are now named `evt_index, evt_tx_hash, contract_address`. Previously these were simplt named `index, tx_hash, address` but we wanted to make it clear that these are added by Dune and not extracted directly from the blockchain. - -我们为`calls`和`events`的所有解码表添加了一些数据字段。 这些现在被命名为 `evt_index, evt_tx_hash, contract_address`。以前这些是简单命名的index、tx_hash、address,但我们想明确指出,这些是由 Dune 添加的,而不是直接从区块链中提取的。 - diff --git a/data-tables/data-tables/README.md b/data-tables/data-tables/README.md index 4a47994..dba9768 100644 --- a/data-tables/data-tables/README.md +++ b/data-tables/data-tables/README.md @@ -1,51 +1,52 @@ --- -说明: 数据表是 Dune 工作的基础 +description: Data Tables are what makes Dune work. --- -# 数据表 +# Data tables {% embed url="https://www.youtube.com/watch?v=UDu23Eyvo_Y" %} -这个视频涵盖了有关数据表的所有重要主题。 +This video covers all important topics around data tables. -## Dune 的表结构 +## Dune's Table Structure -Dune 将区块链数据聚合到一个可访问的 PostgreSQL 数据库中。可以通过以下方式理解模式: +Dune aggregates blockchain data into an accessilbe PostgreSQL database. The schema can be understood in the following way: -1\) 底层数据(原始交易数据)提供区块链上所有活动的详细记录。 +1\) Low-level data (raw transaction data) provides detailed records of all activities on the blockchain -2\) 解码数据表使用相应智能合约的应用程序二进制接口将编码数据转换为解码数据。你可以通过我们的 [网站] (https://dune.com/contracts/new) 的这一部分向我们发出信号,表明你需要某个智能合约的解码数据。在”[添加新合约](../../duneapp/adding-new-contracts.md)”中阅读有关合约提交的更多信息。 +2\) Decoded Data tables use the Application binary interface of the respective smart contract to turn the encoded data into decoded data. \ +You can signal to us that you need decoded data for a smart contract via this part of our [website](https://dune.xyz/contracts/new). Read more about contract submission in "[Adding new contracts](../../duneapp/adding-new-contracts.md)" -3\) 抽象表(Abstractions)是返回有关分类/主题的聚合/标准化数据的更高级别的生成表。生成这些表的脚本可在这个 [github 存储库](https://github.com/duneanalytics/abstractions) 中找到。 +3\) Abstractions are higher-level created tables that return aggregated/standarized data on sectors/topics. The scripts to generate these tables are available in this [github repository](https://github.com/duneanalytics/abstractions). -你目前可以从**Ethereum、Polygon**、**Binance Smart Chain**、**Optimism** 和 **Gnosis Chain** 区块链数据集查询数据。 +\ +You can currently query data from **Ethereum, Polygon, Binance Smart Chain, Optimism** and **Gnosis Chain**. -## 如何找到我需要的数据? +## How do I find the data I need? -本部分旨在指导你找到适合你项目的数据表。 +This section aims to guide you in the process of finding the right data tables to work on your project.\ +Different Use Cases of Dune require different data tables to pull data from, study these carefully and you'll recognize what significance each of the data table types has for your Queries and Dashboards. -Dune 的不同用例需要不同的数据表来提取数据,仔细研究这些数据表,你将认识到每种数据表类型对查询和仪表盘的重要性。 - -Dune 上的大多数表都是由 Dune 填充的,只是将区块链数据转换为 SQL 表,但对于 [抽象表](abstractions.md) 和 dune\_user\_generated 表,你实际上可以自己创建,并根据你的需要来聚合或修改数据集。 +Most of the tables on Dune are populated by Dune and are just a translation of the blockchain data to SQL tables, but in the case of [abstractions ](abstractions.md)and dune\_user\_generated tables you can actually create your own tables that aggregate or modify the dataset to your need. {% content-ref url="raw-data/" %} -[原始数据](raw-data/) +[raw-data](raw-data/) {% endcontent-ref %} {% content-ref url="decoded-data.md" %} -[已解码数据](decoded-data.md) +[decoded-data.md](decoded-data.md) {% endcontent-ref %} {% content-ref url="abstractions.md" %} -[抽象表数据](abstractions.md) +[abstractions.md](abstractions.md) {% endcontent-ref %} {% content-ref url="prices.md" %} -[价格数据](prices.md) +[prices.md](prices.md) {% endcontent-ref %} {% content-ref url="labels.md" %} -[标签数据](labels.md) +[labels.md](labels.md) {% endcontent-ref %} diff --git a/data-tables/data-tables/abstractions.md b/data-tables/data-tables/abstractions.md index e953d0f..c650359 100644 --- a/data-tables/data-tables/abstractions.md +++ b/data-tables/data-tables/abstractions.md @@ -1,48 +1,53 @@ --- -说明: >- - 我们构建了涵盖区块链上所有类型活动的自定义表格,从而使你能够轻松聚合大量数据并尽可能地减少的不便。 +description: >- + We construct customs tables which cover the entirety of a type of activity on + the blockchain and thereby enable you to effortlessly aggregate lots of data + with as little friction as possible. --- -# 抽象表(Abstractions) +# Abstractions -## 什么是抽象表? +## What are abstractions? -抽象表是由 Dune 团队和我们的社区维护的自定义表。它们允许你访问更复杂的 SQL 运算符,例如创建自己的表、在值中循环或其他更适合数据库管理员的操作。这有时对于聚合链上数据或简化数据查询过程是必要的。 +Abstractions are custom tables that are maintained by Team Dune and our community. They allow you to gain access to more complex SQL operators like creating your own tables, looping through values or other operations that are more catered towards database administrators. This sometimes is necessary to aggregate the on-chain data or simplify the process of querying for data. -这个公共的 [github 存储库](https://github.com/duneanalytics/abstractions) 承载构建表和视图的逻辑。 +This public [github repository](https://github.com/duneanalytics/abstractions) hosts the logic to construct the tables and views. -有哪些抽象表? +\ +Which abstractions are there? ----------------------------- -你可以在我们的 [公共 github 存储库](https://github.com/duneanalytics/abstractions) 中检查现有的抽象表。你通常可以将它们分为 2 个不同的类别。 +You can check for existing abstractions in our [public github repository](https://github.com/duneanalytics/abstractions). You can generally divide them into 2 distinct categories. -### 细分领域抽象表(Sector Abstractions) +### Sector Abstractions -细分领域抽象表是指 dex.trades、erc20.stablecoins、lending.borrow 等表。 +Sector Abstractions are tables like dex.trades, erc20.stablecoins, lending.borrow etc. -这些抽象表从多个合约和项目中获取数据,标准化它们之间的数据,因此可以很容易地查询这些数据并比较不同项目的指标。 +These abstractions take in data from multiple contracts and projects, standardize the data across them and therefore make it very easy to query for this data and compare the metrics of different projects with each other. -大多数 [细分领域](../../about/usecases/sector-dashboards.md) 仪表盘都依赖于细分领域抽象表。这引入了一个有趣的动态,项目可以通过向我们的公共 [github 存储库](https://github.com/duneanalytics/abstractions) 发出拉取请求轻松地将其数据放入这些仪表盘。 +Most of the [sector](../../about/usecases/sector-dashboards.md) Dashboards depend on sector abstractions. This introduces an interesting dynamic in which projects can easily get their data into these dashboards by making a pull request to our public [github repo](https://github.com/duneanalytics/abstractions).\ +\ +Team Dune and the community are always improving on these sector abstractions, all new additions to existing ones are always welcome. -Dune 团队和社区一直在改进这些细分领域抽象,我们总是欢迎对现有数据的所有新添加。 -### 项目抽象表(Project Abstractions) +### Project Abstractions -有时,将数据组装到一张整齐的表格中以让需要的所有数据集中在一起对某些项目很有用。为此,你可以在我们的抽象表中构造视图或表。 +Sometimes it can be useful for projects to assemble their data into one neat table that has all the data they need in one place. To do this, you can construct views or tables in our abstractions. -与仅构建视图相比,这里的主要优势是你可以在我们的抽象表中处理大量数据,因为我们可以每隔几个小时在后台自动运行它们。 +The main advantage here over just constructing a view is that you are able to deal with bigger amounts of data in our abstractions since we can run them automatically in the background every few hours. -### 查找抽象表(Lookup abstractions) +### Lookup abstractions -这类抽象表中最引人注目的是 `erc20.tokens` 抽象表,我们将代币映射到它们的小数和符号。其他还有 `erc20.stablecoins` 或 `compound.view_c_tokens` 等。 +The most noticeable mentions for this abstraction is the `erc20.tokens` abstraction in which we map tokens to their decimals and symbols. There also is `erc20.stablecoins` or `compound.view_c_tokens.` -## 贡献抽象表 +## Contributing to abstractions -一般来说,我们的抽象表对所有团队和项目开放,但我们保留拒绝请求的权利。 +Our abstractions are open to all teams and projects in general, but we do reserve the right to reject pull requests. -如果你确实选择为抽象表做出贡献,请确保你的添加确实有效并产生了预期的结果。此外,请给我们一个简短的摘要,说明你要实现的目标以及你的项目是做什么的。 +If you do choose to contribute to abstractions please make sure your addition actually works and produces the intended results. Furthermore please give us a short summary about what you are trying to achieve and what your project does. + +If applicable please construct a view in which you show us that your addition produces the intended results. -如果适用,请构建一个视图,通过它向我们展示你的添加达到了预期的结果。 diff --git a/data-tables/data-tables/community-data/README.md b/data-tables/data-tables/community-data/README.md index ca4a364..1870c94 100644 --- a/data-tables/data-tables/community-data/README.md +++ b/data-tables/data-tables/community-data/README.md @@ -1,7 +1,8 @@ --- -说明: >- - 本部分包含由第三方数据提供商提交并托管在 Dune 上的数据 +description: >- + This section contains data that has been submitted and hosted on Dune by 3rd + party data providers --- -# 第三方数据 +# Third Party Data diff --git a/data-tables/data-tables/community-data/flashbots.md b/data-tables/data-tables/community-data/flashbots.md index 0f97ac9..7a3d42f 100644 --- a/data-tables/data-tables/community-data/flashbots.md +++ b/data-tables/data-tables/community-data/flashbots.md @@ -1,119 +1,126 @@ --- -说明: >- - Flashbots 是一个研发组织,旨在确保 MEV 激励措施不会变得不透明和不民主。 +description: >- + Flashbots is a research and development organization formed with the goal of + making sure MEV incentives do not become opaque and undemocratic. --- # Flashbots -**注意:** mev-inspect-py 是 Flashbots 用于生成 MEV 数据的开源引擎,用于为 mev-explore 和 Dune 的 Flashbots 集成等仪表盘提供动力。在我们的社区和贡献者的帮助下,我们一直在寻求改进、修复错误、覆盖边缘情况并尽我们所能增加协议覆盖率。我们鼓励研究人员和开发人员报告并帮助纠正任何发现的错误,或实现任何新功能! 请随时查阅文档并加入 Flashbots discord,以获取有关我们的数据和 mev-inspect 的更多信息和更新。 +**Note:** mev-inspect-py, Flashbots’ open source engine for generating MEV data, is used to power dashboards such as mev-explore and Dune’s Flashbots integration. We’re always looking to improve, fix bugs, cover edge cases, and add protocol coverage to the best of our ability with the help of our community and contributors. We encourage researchers and developers to report and help correct any found bugs, or implement any new features! Feel free to consult the documentation and join the Flashbots discord for more information and updates on our data and mev-inspect -**文档:** [https://docs.flashbots.net/](https://docs.flashbots.net) +**Docs:** [https://docs.flashbots.net/](https://docs.flashbots.net) -**Discord:** [https://discord.gg/7hvTycdNcK](https://discord.gg/7hvTycdNcK) +**Discord:** [https://discord.gg/7hvTycdNcK](https://discord.gg/7hvTycdNcK) ## **flashbots.mev\_summary** -此表包含所有分类交易的摘要。 +This table contains summary of all the classified transactions -查询示例可在此处找到:[来自清算和套利的矿工收入](https://dune.com/queries/625974/1167301) +Query examples can be found here: [Miner Revenue from Liquidations and Arbitrages](https://dune.com/queries/625974/1167301) -| **列名** | **数据类型** | **说明** | +| **Column name** | **Type** | **Description** | | ------------------------------------ | --------- | ------------------------------------------------------ | -| block\_timestamp | timestamp | 区块时间戳 | -| block\_number | bigint | 区块编号 | -| base\_fee\_per\_gas | bigint | 每单位 gas 的基本费用 | -| coinbase\_transfer | bigint | 直接转账到矿工地址的费用 | -| error | string | 错误信息(如果存在) | -| gas\_price | bigint | gas 价格 | -| gas\_price\_with\_coinbase\_transfer | bigint | gas 价格+直接转账到矿工地址的费用 | -| gas\_used | bigint | 消耗的 gas 量 | -| gross\_profit\_usd | double | 以美元为单位的交易总利润 | -| miner\_address | string | 矿工地址 | -| miner\_payment\_usd | double | 矿工收到的美元付款 | -| protocol | string | 主要交互协议 | -| protocols | string | 交易中涉及的协议列表 | -| transaction\_hash | string | 交易哈希 | -| type | string | MEV的类型(例如arbitrage) | -| timestamp | timestamp | 文件最新更新的时间戳 | +| block\_timestamp | timestamp | Block timestamp | +| block\_number | bigint | Block number | +| base\_fee\_per\_gas | bigint | Base fee per gas | +| coinbase\_transfer | bigint | Direct transfer to miner’s address | +| error | string | Error if exists | +| gas\_price | bigint | Price of the gas | +| gas\_price\_with\_coinbase\_transfer | bigint | Amount of gas spent + direct transfer to miner address | +| gas\_used | bigint | Amount of gas used | +| gross\_profit\_usd | double | Total profit from the transaction in usd | +| miner\_address | string | Address of the miner | +| miner\_payment\_usd | double | Payment received by the miner in usd | +| protocol | string | Main interacted protocol | +| protocols | string | List of protocols involved in the transaction | +| transaction\_hash | string | Hash of the transaction | +| type | string | Type of the MEV (e.g. arbitrage) | +| timestamp | timestamp | Timestamp of the latest update of the file | ## **flashbots.arbitrages** -此表包含有关每笔套利交易的附加信息的记录。 +This table contains records with additional information about each arbitrage trade. -查询示例可在此处找到:[总套利协议](https://dune.com/queries/626076/1167481) +Query examples can be found here: [Total Arb Protocols](https://dune.com/queries/626076/1167481) -| **列名** | **数据类型** | **说明** | +| **Column name** | **Type** | **Description** | | ---------------------- | --------- | --------------------------------------------- | -| block\_number | bigint | 区块编号 | -| account\_address | string | 搜索者的地址 | -| created\_at | string | 记录创建时间 | -| end\_amount | bigint | 套利后可用金额 | -| error | string | 错误信息(如果存在) | -| id | string | 套利的内部id | -| profit\_amount | bigint | 套利后的利润额 | -| profit\_token\_address | string | 利润资产地址 | -| protocols | string | 交易中涉及的协议列表 | -| start\_amount | bigint | 套利前可用金额 | -| transaction\_hash | string | 交易哈希 | -| timestamp | timestamp | 文件最新更新的时间戳 | +| block\_number | bigint | Block number | +| account\_address | string | Address of the searcher | +| created\_at | string | Time of the record creation | +| end\_amount | bigint | Available amount after the arbitrage | +| error | string | Available amount after the arbitrage | +| id | string | Internal id of the arbitrage | +| profit\_amount | bigint | Profit amount after the arbitrage | +| profit\_token\_address | string | Address of the profit asset | +| protocols | string | List of protocols involved in the transaction | +| start\_amount | bigint | Available amount before the arbitrage | +| transaction\_hash | string | Hash of the transaction | +| timestamp | timestamp | Timestamp of the latest update of the file | ## **flashbots.liquidations** -清算是另一种 MEV 策略。此表包含与已执行清算相关的详细信息。 +Liquidation is another MEV strategy. This table contains details related to executed liquidations. -查询示例可以在这里找到:[协议清算](https://dune.com/queries/625715/1166880) +Query examples can be found here: [Liquidations by Protocol](https://dune.com/queries/625715/1166880) -| **列名** | **数据类型** | **说明** | +| **Column name** | **Type** | **Description** | | ------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------- | -| created\_at | string | 记录创建时间 | -| transaction\_hash | string | 交易哈希 | -| trace\_address | string | 与 MEV 交易相关的所有交易链中交易位置相关的跟踪模式 | -| debt\_token\_address | string | 要支付的债务的基础代币地址 | -| received\_amount | bigint | 从清算中收到的金额 | -| protocol | string | 协议名称 | -| liquidated\_user | string | 被清算用户地址 | -| liquidator\_user | string | 清算人用户地址 | -| received\_token\_address | string | 收到资产的地址 | -| block\_number | bigint | 区块编号 | -| debt\_purchase\_amount | bigint | 购买的债务金额 | -| timestamp | timestamp | 文件最新更新的时间戳 | +| created\_at | string | Time of the records creation | +| transaction\_hash | string | Transaction hash | +| trace\_address | string | Trace pattern related to the position of the transaction in the chain of all transactions related to the MEV trade. | +| debt\_token\_address | string | Underlying token address of the debt to pay | +| received\_amount | bigint | Amount received from the liquidation | +| protocol | string | Protocol name | +| liquidated\_user | string | Address of the liquidated user | +| liquidator\_user | string | Address of the liquidator user | +| received\_token\_address | string | Address of the received asset | +| block\_number | bigint | Block number | +| debt\_purchase\_amount | bigint | Amount of purchased debt | +| timestamp | timestamp | Timestamp of the latest update of the file | ## **flashbots.sandwiched\_swaps** -Sandwiched\_swaps 表包含有关一个或多个交换的附加数据,这些交换与数据库中的相应三明治夹在中间。 +The sandwiched\_swaps table contains additional data about one or more swaps that were sandwiched with a corresponding sandwich in the database. -| **列名** | **数据类型** | **说明** | +Query examples can be found here: + +| **Column name** | **Type** | **Description** | | ----------------- | --------- | ----------------------------------------------------------------------------------------------------------- | -| created\_at | string | 记录创建时间 | -| block\_number | bigint | 区块编号 | -| sandwich\_id | string | 三明治交易的内部 id | -| trace\_address | string | 与套利交易相关的所有掉期链中掉期位置相关的跟踪模式 | -| transaction\_hash | string | 交易哈希 | -| timestamp | timestamp | 文件最新更新的时间戳 | +| created\_at | string | Time of the records creation | +| block\_number | bigint | Block number | +| sandwich\_id | string | Internal id of the sandwiched swap | +| trace\_address | string | Trace pattern related to the position of the swap in the chain of all swaps related to the arbitrage trade. | +| transaction\_hash | string | Transaction hash | +| timestamp | timestamp | Timestamp of the latest update of the file | ## **flashbots.sandwiches** -此表包含有关已执行三明治交换的详细信息。 +This table contains detailed information about executed sandwiches + +Query examples can be found here: -| **列名** | **数据类型** | **说明** | +| **Column name** | **Type** | **Description** | | --------------------------------- | --------- | --------------------------------------------------------------- | -| created\_at | datetime | 记录创建时间 | -| block\_number | bigint | 区块编号 | -| backrun\_swap\_trace\_address | string | 回溯交易中的交换地址 | -| backrun\_swap\_transaction\_hash | string | 指定三明治的backrun代交易的交易哈希 | -| frontrun\_swap\_trace\_address | string | 前端交易中的掉期地址 | -| frontrun\_swap\_transaction\_hash | string | 指定三明治前端交易的交易哈希 | -| id | string | 三明治交易的内部 id | -| profit\_amount | bigint | 套利后的利润额 | -| profit\_token\_address | string | 利润资产地址 | -| sandwicher\_address | string | 三明治交易者的地址 | -| timestamp | timestamp | 文件最新更新的时间戳 | +| created\_at | datetime | Time of the records creation | +| block\_number | bigint | Block number | +| backrun\_swap\_trace\_address | string | address of the swap in the backrun transaction | +| backrun\_swap\_transaction\_hash | string | transaction\_hash of backrun transaction of specified sandwich | +| frontrun\_swap\_trace\_address | string | address of the swap in the frontrun transaction | +| frontrun\_swap\_transaction\_hash | string | transaction\_hash of frontrun transaction of specified sandwich | +| id | string | Internal id of the sandwich | +| profit\_amount | bigint | Profit amount after the arbitrage | +| profit\_token\_address | string | Address of the profit asset | +| sandwicher\_address | string | Address of the sandwicher | +| timestamp | timestamp | Timestamp of the latest update of the file | ## **flashbots.blocks** -此表包含块号和对应的区块时间戳。 +This table contains block numbers and corresponding block\_timestamps + +Query examples can be found here: -| **列名** | **数据类型** | **说明** | +| **Column name** | **Type** | **Description** | | ---------------- | --------- | --------------- | -| block\_number | bigint | 区块编号 | -| block\_timestamp | timestamp | 区块时间戳 | +| block\_number | bigint | Block number | +| block\_timestamp | timestamp | Block timestamp | diff --git a/data-tables/data-tables/decoded-data.md b/data-tables/data-tables/decoded-data.md index fd042f0..8c64ca4 100644 --- a/data-tables/data-tables/decoded-data.md +++ b/data-tables/data-tables/decoded-data.md @@ -1,81 +1,82 @@ --- -说明: >- - 我们对智能合约发出的数据进行解码,并将它们存储在易于使用的表格中。 +description: >- + We decode the data emitted by smart contracts and store them in easy-to-use + tables. --- -# 已解码数据 +# Decoded Data -## 已解码智能合约数据 +## Decoded smart contract data -Dune 不使用跟踪和日志,而是将智能合约活动解码为易于阅读的表格。 +Instead of working with the traces, logs, and traces, Dune decodes smart contract activity into nice human-readable tables. -我们为智能合约 ABI 中定义的每个事件(event)和功能(function)创建表格。随后,对该合约的每个事件或函数调用都被解码并作为一行插入到这些表中。 +We create tables for each event and function defined in the smart contract ABI. Subsequently, every event or function call on that contract is decoded and inserted as a row into these tables. -这些表被相应地命名: +The tables are named accordingly -**事件(events):** `projectname."contractName_evt_eventName"` +**events:** `projectname."contractName_evt_eventName"` -**函数调用(function calls):** `projectname."contractName_call_eventName"` +**function calls:** `projectname."contractName_call_eventName"` -例如,在表 [uniswap\_v2."pair\_swap"](https://dune.xyz/queries/38968) 中可以找到 uniswap V2 交换合约的 `swap` 事件的解码数据。 +As an example, decoded data for the `swap`-event of the uniswap V2 exchange contract is found in the table [uniswap\_v2."pair\_swap"](https://dune.xyz/queries/38968). -使用事件表通常就足够了,但在某些情况下,你会想要使用 `call` 表。例如 Maker DAO,它不会给你太多事件,你可以使用像 [maker."SaiTub\_call\_draw](https://dune.xyz/queries/38974)" 这样的表格。 +Using the event tables is usually sufficient, but in some cases you will want to use the `call` tables. For instance Maker DAO which don’t give you too many events you can use tables like [maker."SaiTub\_call\_draw](https://dune.xyz/queries/38974)". -## 哪些合约有已解码数据? +## What contracts have decoded data? -你可以通过我们的数据库查询 “blockchain”.contracts 表或 [这个仪表盘](https://dune.xyz/0xBoxer/Is-my-Contract-decoded-yet) 来检查合约是否已解码。 +You can check if contracts are already decoded by querying "blockchain".contracts through our database or [this dashboard](https://dune.xyz/0xBoxer/Is-my-Contract-decoded-yet). -如果合约还没有在我们的数据库中,你可以在此处将其提交给 [解码](../../duneapp/adding-new-contracts.md):[dune.xyz/decode](http://dune.xyz/decode). +If the contract is not in our database yet, you can submit it for [Decoding](../../duneapp/adding-new-contracts.md) here: [dune.xyz/decode](http://dune.xyz/decode) -我们通常需要大约 24-48 小时来解码智能合约。 +We usually take about 24-48 hours to decode smart contracts. -查看 [本指南](../../duneapp/adding-new-contracts.md) 以了解有关解码过程的更多信息。 +Check out [this guide](../../duneapp/adding-new-contracts.md) to learn more about the Decoding process. -## 如何理解已解码数据? +## How to understand decoded data? -解码数据有时有点难以处理,因为它需要你了解事件/调用在智能合约上下文中的含义。此外,你需要了解智能合约发出什么样的数据,并了解项目的不同智能合约相互交互的复杂性。通常,你要查找的数据分散在 Dune 中的多个智能合约和表格中。 +Decoded data sometimes is a bit tricky to work with since it requires you to understand what the events/calls mean in the context of the smart contract. Additionally you need to understand what kind of data the smart contract emits and understand the intricacies of the different smart contracts of the project interacting with each other. Often times the data you are looking for is scattered across multiple smart contracts and tables in Dune. -如果你无法通过仅在表格中搜索来理解数据,则使用代交易哈希和 etherscan 查看单个交易(transaction)的详情通常会有所帮助。 +If you are not able to make sense of the data by just searching at the tables, it usually helps to look at single tx's using the transaction hash and etherscan. -如果这也不能带来令人满意的结果,那么搜索项目的相关文档和 github 可以引导你找到所需的答案。此外,与项目的开发人员和核心社区交流也可以让你更好地理解合约。 +If that also doesn't lead to satisfactory results, scouring the relevant docs and github of the project can lead you to the desired answers. Furthermore, talking to the developers and core community of a project can also get you to a good understanding of the contract. -在整个 Dune 中都可以找到有关如何处理解码数据的一些很好的展示,但尤其是我们的 [抽象表存储库](https://github.com/duneanalytics/abstractions) 充满了很好的例子。 +Some good showcasing of how to deal with decoded data can be found all throughout Dune, but especially our [abstraction repository](https://github.com/duneanalytics/abstractions) is full of great examples. -**总之**: +**In Summary**: -处理解码数据可以让你深入访问存储在区块链上的信息,并且信息量非常丰富,但了解数据有时需要你付出一些努力,因为你正在以直接的方式与合约数据进行交互。 +Dealing with decoded data allows you deep access to information stored on the blockchain and is very information rich, but understanding that data sometimes takes a bit of effort on your side since you are interacting with the data of the contract in a direct way. -## 跨合约的可扩展解码 +## Scalable decoding across contracts -许多 dApp 拥有大量使用相同字节码部署的智能合约。这可以是:收益聚合池、独特的期权、流动性池等。 +Many dApps have numerous smart contracts that are deployed with the same bytecode. This can be: yield aggregator pools,distinctive options, liquidity pools etc. -我们可以自动将这些相似的合约提取到同一个表中,从而让你更轻松地处理这些数据。无需查询所有独特的智能合约,你只需查询一张表,该表将以该特定智能合约的 `contract_address` 作为标识符。 +We can automatically pull these similar contracts into the same tables and thereby make it way easier for you to work with that data. Instead of having to query for all distinctive smart contracts you can then just query one table which will have the `contract_address` of that specific smart contract as an identifier. -为了能够使用此功能,你必须在将合约提交解码时将其作为两个底部选项之一提交。 +To be able to use this function you have to submit the contract as one of the two bottom options while submitting it to decoding. ![](<../../.gitbook/assets/image (23).png>) -因此,来自单个表的 `SELECT` 可能会产生来自多个合约的数据。在解码表中,`contract_address` 列告诉你事件或调用在哪个智能合约上。如果你只想查看单个合约,则可以按其地址进行过滤。 +As a result, `SELECT`-ing from a single table might yield data from multiple contracts. In decoded tables, the column `contract_address` tells you which smart contract the event or call is on. If you want to look at only a single contract you can filter by its address. -例如: +For example: ```sql SELECT DISTINCT contract_address FROM uniswap_v2."Pair_evt_swap"; ``` -将通过代币购买事件为你提供所有独特的 Uniswap 交易对。 +will give you all the unique Uniswap Pairs with a Token Purchase event. -[查询实战](https://dune.xyz/queries/39006) +[Query in action](https://dune.xyz/queries/39006) -## **探索已解码合约的查询** +## **Queries to explore decoded Contracts** -**查看我们已解码数据的所有项目** +**See all projects we have decoded data for** ```sql SELECT DISTINCT namespace FROM ethereum."contracts"; ``` -如果你直接使用事件或调用表,你可以通过此查询查看该合约是否有多个实例。 +If you are working with a an event or call table directly you can see if there are several instances of that contract with this query. ```sql SELECT DISTINCT contract_address FROM projectname."contractName_evt_eventName"; diff --git a/data-tables/data-tables/erc-20-balances.md b/data-tables/data-tables/erc-20-balances.md index 5a1d296..2247bcf 100644 --- a/data-tables/data-tables/erc-20-balances.md +++ b/data-tables/data-tables/erc-20-balances.md @@ -1,21 +1,22 @@ --- -说明: >- - ERC20 代币分析是任何 DeFi 产品分析的基础部分,这些表格和视图将为你提供所有必要的信息。 +description: >- + ERC20 token analysis is a fundamental part of any analysis of DeFi products, + these tables and views will provide you with all the necessary information. --- -# ERC-20 代币余额 +# ERC-20 balances -## 随着时间的推移轻松跟踪钱包和代币余额 +## Easily track wallets and token balances over time. -下列表格允许随时间变化或按快照格式轻松跟踪钱包余额、代币分配或代币供应量。 +The following tables allow for easy tracking or wallet-balances, token allocations or supply of a token over time or in a snapshot format. -在原始数据级别上,使用 erc20 代币非常困难,因为你需要对所有地址的所有代币转移进行汇总。这不必要地使查询膨胀并迅速导致人为错误。为了防止这种情况发生,我们构建了几个视图和表,可以帮助你轻松查询 erc20 代币数据。 +On a raw data level it's pretty hard to work with erc20 tokens since you need to sum all transfers for all addresses over time. This unnecessarily bloats queries and quickly leads to human errors. To prevent that from happening we have constructed several views and tables that will help you query for erc20 data with ease. -这些表可用于各种有趣的分析,但在使用它们时你仍需要注意一些事项: +These tables can be used for all kinds of interesting analysis, but you still need to watch out for a few things while working with them: -* **铸造/燃烧地址** 没有标准化,因此你需要找出这些地址并在查询中手动应用修复。在大多数情况下,用于铸造和燃烧的将是 `x0000000000000000000000000000000000000000` ,但请始终确保确实如此。在下面给出的示例中,情况并非如此。 +* the **mint/burn address** is not standardized, so you need to find out those addresses and manually apply a fix in your queries. In most cases it will be `x0000000000000000000000000000000000000000`for minting and burning, but always make sure that that is indeed the case. In the example given that's exactly not the case. -**示例:** +**example:** ```sql Select @@ -25,11 +26,11 @@ Select token_symbol from erc20."view_token_balances_daily" where token_address = '\x429881672B9AE42b8EbA0E26cD9C73711b891Ca5' -and wallet_address != '\x0000000000000000000000000000000000000000' -- 铸造地址 -and wallet_address != '\x000000000000000000000000000000000000dead' -- 燃烧地址 +and wallet_address != '\x0000000000000000000000000000000000000000' --mint address +and wallet_address != '\x000000000000000000000000000000000000dead' --burn address ``` -* 使用这些表格工作会很快产生很多单独的数据点,我们的可视化引擎并不总是能够完美处理这些数据点。与其尝试显示每个唯一的持有者,不如将它们按特定标准分组并以这种方式显示数据集。这对于每个代币都是唯一的,你可能需要进行一些试验以查看什么分类方式能在你的查询中有效工作。 +* working with these tables quickly leads to a lot of individual data points that our visualization engine is not always able to handle perfectly. Instead of trying to display every unique holder it makes sense to group them by certain criteria and display the dataset that way. This is unique for every token, you might need to experiment a bit to see what works in your queries. ```sql Select @@ -44,7 +45,7 @@ Select WHEN amount between 100 and 1000 then 'fish(100-1,000)' WHEN amount between 1000 and 10000 then 'dolphin(1,000-10,000)' WHEN amount > 10000 then 'whale (>10000)' - -- 请注意,case 表述的顺序在这里很重要 + --note that the order of case statements matters here end as classification, sum(amount) as amount, @@ -53,67 +54,67 @@ from erc20."view_token_balances_latest" where token_address = '\x429881672B9AE42b8EbA0E26cD9C73711b891Ca5' and wallet_address != '\x0000000000000000000000000000000000000000' and wallet_address != '\x000000000000000000000000000000000000dead' -and amount > 0.1 -- 过滤掉灰尘量,根据经济价值针对不同的代币进行调整 +and amount > 0.1 --filter out dust amounts, adjust this for different tokens based on economic value group by 1,3 ``` -## 仪表盘示例: +## Dashboard example: -此仪表盘包含与用作治理代币的单个 erc20 代币相关的最重要用例。 +This dashboard contains the most important use cases related to a single erc20 token that is used as gov token. [https://dune.xyz/0xBoxer/pickle-finance\_1](https://dune.xyz/0xBoxer/pickle-finance\_1) ## erc20.view\_token\_balances\_latest -此视图依赖于 erc20.token\_balances 表,并为你提供该代币的最新分布信息。 +This view depends on the erc20.token\_balances table and gives you the information of the latest distribution of that token. -| 列名 | 数据类型 | 描述 | +| column name | data type | description | | ----------------------------- | ----------- | ------------------------------------------------------------------------------------------ | -| amount | numeric | 该代币的正确显示格式的金额 | -| amount\_raw | numeric | 该代币的原始金额(需要除以小数位数!) | -| amount\_usd | float8 | 当前价格(如果我们有价格数据) | -| last\_transfer\_\_\_timestamp | timestamptz | 此特定钱包地址中此代币余额最后更改的日期 | -| token\_address | bytea | 代币地址 | -| token\_symbol | text | 代币符号 | -| wallet\_address | bytea | 持有该代币的钱包地址 | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| amount\_usd | float8 | the current price (if we have data on the price) | +| last\_transfer\_\_\_timestamp | timestamptz | the date on which the balance of this token last changed in this particular wallet address | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | ## erc20.view\_token\_balances\_hourly -此表将按小时提供有关所有代币余额的信息。在大多数情况下,它还已经包含小数和价格,因此它们已经准备好可开箱即用。 +This table will provide information about all token balances on an hourly basis. It also already includes decimals and prices in most cases, so they are pretty much ready to go out of the box. -| 列名 | 数据类型 | 描述 | +| column name | data type | description | | --------------- | ----------- | ---------------------------------------------------------- | -| amount | numeric | 该代币的正确显示格式的金额 | -| amount\_raw | numeric | 该代币的原始金额(需要除以小数位数!) | -| amount\_usd | float8 | 当前价格(如果我们有价格数据) | -| hour | timestamptz | 以小时为单位的时间 | -| token\_address | bytea | 代币地址 | -| token\_symbol | text | 代币符号 | -| wallet\_address | bytea | 持有该代币的钱包地址 | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| amount\_usd | float8 | the current price (if we have data on the price) | +| hour | timestamptz | the time in the resolution of hours | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | ## erc20.view\_token\_balances\_daily -**此表的性能将比 `erc20.view_token_balances_hourly` 好得多,因为它仅按天查询数据**。如果你想进行高阶分析,这是你应该选择的表。 +**This table will perform much better than `erc20.view_token_balances_hourly` since it's only querying for data on a daily basis**. If you want to make high level analysis, this is your way to go. -| 列名 | 数据类型 | 描述 | +| column name | data type | description | | --------------- | ----------- | ---------------------------------------------------------- | -| amount | numeric | 该代币的正确显示格式的金额 | -| amount\_raw | numeric | 该代币的原始金额(需要除以小数位数!) | -| amount\_usd | float8 | 当前价格(如果我们有价格数据) | -| day | timestamptz | 以天为单位的时间 | -| token\_address | bytea | 代币地址 | -| token\_symbol | text | 代币符号 | -| wallet\_address | bytea | 持有该代币的钱包地址 | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| amount\_usd | float8 | the current price (if we have data on the price) | +| day | timestamptz | the time in the resolution of days | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | ## erc20.token\_balances -该表包含所有 erc20 代币在这些代币存在期间的每小时余额。如果我们上面提供的视图不足以满足你尝试建立的用例,你可以使用此表作为备用选项。 +This table contains the hourly balance of all erc20 tokens over the entire existence of these tokens. You can use this table as a fallback option might the views we have provided above not be sufficient for the usecase you are trying to establish. -| 列名 | 数据类型 | 描述 | +| column name | data type | description | | --------------- | ----------- | ---------------------------------------------------------- | -| amount | numeric | 该代币的正确显示格式的金额 | -| amount\_raw | numeric | 该代币的原始金额(需要除以小数位数!) | -| timestamp | timestamptz | 以小时为单位的时间 | -| token\_address | bytea | 代币地址 | -| token\_symbol | text | 代币符号 | -| wallet\_address | bytea | 持有该代币的钱包地址 | +| amount | numeric | the correct display format for that token | +| amount\_raw | numeric | the raw amount of that token (need to divide by decimals!) | +| timestamp | timestamptz | the time in the resolution of hours | +| token\_address | bytea | the address of the token | +| token\_symbol | text | the symbol of the token | +| wallet\_address | bytea | the address of the wallet holding this token | diff --git a/data-tables/data-tables/labels.md b/data-tables/data-tables/labels.md index 3acc8e9..6539c7a 100644 --- a/data-tables/data-tables/labels.md +++ b/data-tables/data-tables/labels.md @@ -1,99 +1,99 @@ -# 标签(Labels) +# Labels -你是否曾经在 Dune 上查询过地址列表,却只是停下来想知道这些漂亮的随机十六进制编码字符串背后是什么? 我们也是。 +Have you ever made a query on Dune where you get a list of addresses, only to stop and wonder what’s behind these beautiful, random hexadecimal encoded strings? So have we. -**地址标签** 是 Dune 上的一项功能,你作为用户可以为任何地址_添加_、_更新_和_查询_标签数据。 +**Address labels** is a feature on Dune where you as a user can _add_, _update_ and _query_ labels for any address. -## 什么是标签? +## What is a label? -标签是**关于某个地址的元数据**、标记或元数据(如果你愿意)。它以键值对的形式出现。键是标签_类型_,值是标签_名称_。 +A label is **a piece of metadata about an address**, a tag or metadata if you will. It comes in the form of a key-value pair. The key is the label _type_, and the value the label _name_. -在 [**标签页面**](https://dune.xyz/labels) 浏览地址和标签。 +Browse addresses and and labels at the [**labels page**](https://dune.xyz/labels). -## 标签看起来像什么 +## What labels looks like -查看 [这个仪表盘](https://dune.xyz/hagaetc/labels) 了解可以使用标签创建的示例。 +Check out [this dashboard](https://dune.xyz/hagaetc/labels) for examples on what can be created with labels. -**地址标签示例** +**Address label examples** -地址 [0xD551234Ae421e3BCBA99A0Da6d736074f22192FF](https://dune.xyz/ethereum/address/0xD551234Ae421e3BCBA99A0Da6d736074f22192FF) 可以被这样标记: +The address [0xD551234Ae421e3BCBA99A0Da6d736074f22192FF](https://dune.xyz/ethereum/address/0xD551234Ae421e3BCBA99A0Da6d736074f22192FF) can be labeled like this: -| **类型** | **名称** | +| **type** | **name** | | ----------- | -------- | | owner | binance | | wallet type | exchange | -此地址由交易所 Binance 控制。 +The address is controlled by the exchange Binance. -地址 [0xe65040f61701940b62e18da7a53126a58525588b](https://dune.xyz/ethereum/address/0xe65040f61701940b62e18da7a53126a58525588b) 可以被这样标记: +The address [0xe65040f61701940b62e18da7a53126a58525588b](https://dune.xyz/ethereum/address/0xe65040f61701940b62e18da7a53126a58525588b) can be labeled like this: -| **类型** | **名称** | +| **type** | **name** | | ---------- | ------------ | | dapp usage | uniswap user | | activity | dex trader | -这个地址曾经与 Uniswap 进行过交互。 +The address in the past interacted with Uniswap. -你可以随意想出新的类型和标签名称,因为 Dune 上的标签是开放式的并且**众包**的。 +You are free to come up with both new types and label names, as labels on Dune are open ended and **crowd sourced.** -## 添加标签 +## Adding labels -添加标签的方法有两种: +There are two ways to add labels: -**1. 通过我们的标签页面直接添加地址** +**1. Directly to an address via our labels page** -适合特定标签,例如“这是一个币安(binance)钱包”。 +Good for specific labels like “this is a binance wallet”. -**2. 通过 Dune 查询** +**2. Via a Dune query** -使用 Dune 查询来标记地址。一种非常强大且可扩展的方式来添加标签,例如“所有这些地址都使用过 Uniswap”等等。 +Use Dune queries to label addresses. A very powerful and scalable way to add labels like “all these addresses used Uniswap”, and much much more. -请参阅我们的 [Github](https://github.com/duneanalytics/abstractions/tree/master/labels),了解使用你自己的查询和 PR 创建标签的示例! +Please see our [Github](https://github.com/duneanalytics/abstractions/tree/master/labels) for examples of labels created with queries and PR in your own! -你可以执行的操作示例: +Examples of what you can do: -* 标记所有使用某个 dapp 的地址 -* 标记所有持有一定数量某种代币的地址 -* 标记每月使用某个 dapp 超过 X 次的所有地址 -* 标记所有向 Binance 汇款的地址 +* Label all addresses that used a certain dapp +* Label all addresses that hold a certain amount of a token +* Label all addresses that use a dapp more than X times per month +* Label all addresses that sent money to Binance -你还可以围绕用户模式做更多新颖和复杂的事情,例如谁进行了套利交易或从闪电贷款中获利等等。 +You could also do more novel and involved things around user patterns like who did arbitrage trades or profited from flash loans and so much more. -请注意,在 [dune.xyz](http://dune.xyz/) 上添加标签后,在你可以在 SQL 中查询它之前可能会有几分钟延迟。 +Note that there might be a few minutes delay from adding the label on [dune.xyz](http://dune.xyz/) until you can query it in SQL. -## 标签表 +## The labels table -标签存储在新的 `labels.labels` 表中,该表具有以下模式: +Labels are stored in the new `labels.labels` table which has the following schema: -| 列名 | 数据类型 | 说明 | +| column name | data type | description | | ----------- | ----------- | -------------------------------------------------------- | -| id | int | 自增整数 | -| address | bytea | 此标签描述的合约或钱包的地址 | -| name | text | 标签名称 | -| type | text | 标签类型 | -| author | text | 创建此标签的用户的用户名 | -| source | text | 此标签的来源,由 Dune 自动填充 | -| updated\_at | timestamptz | 最近更改此标签的时间 | +| id | int | incrementing integer | +| address | bytea | the address of a contract or wallet this label describes | +| name | text | label name | +| type | text | label type | +| author | text | the username of the user who created this label | +| source | text | the source of this label, autopopulated by dune | +| updated\_at | timestamptz | the last time this label was changed | -## 使用标签 +## Using labels -请注意,该表为每个地址中包含多行记录,因此对它进行连接可能会很棘手。出于这个原因,我们制作了方便的功能: +Note that this table holds multiple rows per address, and therefore joins against it can be tricky to get right. For that reason we’ve made the convenient function: `labels.get(address bytea, type text default null) RETURNS text[]` -我们预计这将是使用标签的主要方式。请参阅下面的示例。 +which we anticipate will be the primary way to use labels. See examples below. -通常,如果你执行返回 `address` 的查询,你可以使用 `labels.get(address)` 来获取该地址的所有标签,而与标签类型无关。如果你想查看 `owner` 类型的标签,可以执行 `labels.get(address, 'owner')` 。你还可以将此函数传递给你想要包含的几种标签类型,例如:`labels.get(address, 'owner', 'project')` 。 +Typically if you do a query that returns `address` you can use `labels.get(address)` to get all labels for that address independent of label type. If you want to see labels of the type `owner` you can do `labels.get(address, 'owner')`. You can also pass this function several label types you want included like: `labels.get(address, 'owner', 'project')`. -我们还添加了函数 `labels.url(address bytea)` 。从你的查询中传递给该函数一个地址,你的结果表将包含一个可点击的链接,例如: +We’ve also added the function `labels.url(address bytea)`. Pass that function an address from your query and your results table will contain a clickable link to for instance: [https://dune.xyz/ethereum/address/0xD551234Ae421e3BCBA99A0Da6d736074f22192FF](https://dune.xyz/ethereum/address/0xD551234Ae421e3BCBA99A0Da6d736074f22192FF) -### 用例:我想显示地址列表的标签 +### Usecase: I want to display labels for a list of addresses -> 我们鼓励你在阅读本文时在 Dune 中运行这些查询 +> We encourage you to run these queries in Dune while you read this -假设你正在查看过去 24 小时内所有 dex 中 DAI 的前 10 名交易者: +Say you’re looking at the top 10 traders of DAI across all dexes last 24 hours: ```sql SELECT trader_a, SUM(token_a_amount) @@ -105,9 +105,9 @@ ORDER BY 3 DESC LIMIT 10; ``` -如果你想为这些地址添加标签,只需将 `trader_a` 列更改为 `labels.get(trader_a)` 。 +If you want to have labels for these addresses simply alter the `trader_a` column to `labels.get(trader_a)`. -> 注意:在下面的示例中,`---` 表示删除的行,而 `+++` 表示添加的行。 +> Note: In the examples below `---` represents lines removed, and `+++` lines added. ```sql SELECT trader_a, labels.get(trader_a) as label, SUM(token_a_amount) @@ -120,7 +120,7 @@ SELECT trader_a, labels.get(trader_a) as label, SUM(token_a_amount) LIMIT 100; ``` -现在你已将地址替换为交易者a(trader\_a)的所有标签列表。有时你只对标签的一个子集感兴趣:`labels.get` 接受一个可选的类型名称列表,用于过滤你获得的标签类型。假设你只对 `‘activity’` 标签感兴趣: +Now you’ve replaced the addresses with lists of all labels for trader\_a. Sometimes you’re only interested in a subset of labels: `labels.get` accepts an optional list of type names which filter the type of labels you get. Say you’re only interested in ‘activity’ labels: ```sql SELECT trader_a, labels.get(trader_a, 'activity') as label, SUM(token_a_amount) @@ -133,7 +133,7 @@ SELECT trader_a, labels.get(trader_a) as label, SUM(token_a_amount) LIMIT 100; ``` -当然你也可以显示地址,同时过滤多种标签类型 +Of course you can also show the address, and filter for multiple label types ```sql SELECT trader_a, labels.get(trader_a, 'activity', 'project', 'contract_name') as label, SUM(token_a_amount) @@ -146,7 +146,7 @@ SELECT trader_a, labels.get(trader_a) as label, SUM(token_a_amount) LIMIT 100; ``` -你还可以使用 `labels.url` 使地址可点击: +You can also use `labels.url` to make the addresses clickable: ```sql SELECT labels.url(trader_a), labels.get(trader_a, 'activity') as labels, SUM(token_a_amount) @@ -158,13 +158,13 @@ GROUP BY 1, 2 LIMIT 10; ``` -这样,查看你的仪表盘的人可以轻松地为其添加更好的标签! +This way people who look at your dashboard can easily contribute even better labels to it! -### 用例:我想按存在的标签过滤我的查询。 +### Usecase: I want to filter my query by labels that exist. -在这个用例中,你不想使用 `labels.get`,因为它操作起来可能很慢。相反,你将在 SQL 中使用奇妙的 `EXISTS` 函数。 +In this usecase you wouldn’t want to use `labels.get`, because it can be slow to operate with. Instead you’ll use the fantastic `EXISTS` function in SQL. -例如:你正在查询 _Uniswap_,但对之前在 _1inch_ 上交易过的用户的行为感兴趣。以下是你的处理方式: +As an example: you’re querying _Uniswap_, but are interested in the behavior of users who have traded previously on _1inch_. Here’s how you’d go about that: ```sql SELECT "to" @@ -179,9 +179,9 @@ WHERE EXISTS( LIMIT 10; ``` -上面的查询将为你提供 10 个在 Uniswap 上交换并在 1inch 上交易过的地址。 +The above query will give you 10 address that has swapped on Uniswap and traded on 1inch. -当然,你可以结合使用这两种模式! 如果你确实对这些地址上的标签感兴趣,请继续使用 `labels.get` 和 `WHERE EXISTS` 模式: +Of course, you can use the two patterns in conjunction! If you _are_ interested for labels on those addresses, go ahead and use `labels.get` in addition to the `WHERE EXISTS` pattern: ```sql --- SELECT "to" @@ -191,4 +191,4 @@ LIMIT 10; LIMIT 10; ``` -你得到:你看到在 Uniswap 和 1inch 上交易的地址 _以及_ 所有相关的地址标签。 +There you have it: you see addresses that traded on both Uniswap and 1inch _and_ all associated address labels. diff --git a/data-tables/data-tables/nft.trading.md b/data-tables/data-tables/nft.trading.md index 75ef6e2..21e0d06 100644 --- a/data-tables/data-tables/nft.trading.md +++ b/data-tables/data-tables/nft.trading.md @@ -1,49 +1,50 @@ --- -说明: >- - NFT交易表 在 Dune 上向所有人提供 NFT 交易数据。 - NFT交易表 将跨多个 NFT 平台的数据聚合到一张简单的表格中。 +description: >- + nft.trades makes NFT trading data available to everyone on Dune Analytics. + NFT.trades aggregates data across multiple NFT platforms into one simple + table. --- -# NFT交易表(nft.trades) +# nft.trades -## **一种查询 NFT 数据的简单方法** +## **An easy way of querying for NFT data** -NFT交易表(nft.trades)旨在让 Dune 上的每个人都能轻松获得 NFT 交易数据。该表将不同数据平台之间的数据聚合和标准化,并在同一张表中提供辅助信息和元数据。 +`nft.trades` is an effort to make NFT trading data easily available to everyone on Dune Analytics. This table aggregates and standardizes the data between different data platforms and provides auxiliary information and metadata all in one table. -最重要的是使用该数据集,让在所有索引平台上查询任何与 NFT 相关的交易数据变得非常容易。 +The culmination of this is a dataset which makes it extremely easy to query for any NFT related trading data across all indexed platforms. -到目前为止,我们已经对以下平台的数据进行了索引: +So far we have indexed the data of the following platforms: * OpenSea * Rarible * SuperRare -* CryptoPunks(他们在自己的合约中进行交易) +* CryptoPunks (They get traded in their own contracts) * Foundation * LooksRare -所有这些数据都可以通过非常简单的查询轻松访问,例如: +All of this data is easily accessible with very simple queries like these: -* [**给定 NFT 的所有交易**](https://dune.xyz/queries/146090) +* [**all trades for a given NFT**](https://dune.xyz/queries/146090) ![](<../../.gitbook/assets/image (31).png>) ```sql select * from nft.trades -where nft_contract_address = '\xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb' -- 这是 cryptopunks 的地址 +where nft_contract_address = '\xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb' --this is the cryptopunks address ``` -* [**过去 24 小时内在给定平台上的交易**](https://dune.xyz/queries/146152) +* [**trades in the last 24 hour on a given platform**](https://dune.xyz/queries/146152) ```sql -select date_trunc('day', block_time), usd_amount, nft_contract_address, token_id from +select date_trunc('day', block_time), usd_amount, nft_contract_address, token_id from nft.trades -where platform = 'OpenSea' -- 仅显示给定平台上的交易 +where platform = 'OpenSea' --only shows trades on given Platform and block_time > now() - interval '24hours' ``` -* [**去年的平台交易量**](https://dune.xyz/queries/146160) +* [**platform volumes in the last year**](https://dune.xyz/queries/146160) ```sql select sum(usd_amount), date_trunc('day', block_time), platform from nft.trades @@ -55,99 +56,97 @@ group by 2,3 ### -### 基本理解 +### Basic Understanding -#### 单品交易(Single Item Trade) +#### Single Item Trade -交易发生在“买方”(buyer)和“卖方”(seller)之间。 +A trade occurs between a `buyer`and a `seller`.\ +They exchange an item which is uniquely identified by the combination of `nft_contract_address` and `token_id`. The Buyer will pay the Seller a given `original_amount`of tokens in any given `original_currency`. To make it easier, we have calculated the `usd_amount` that this was worth at the time of the trade for you. Most trades will be done in ETH or WETH, but especially non OpenSea trades often contain other currencies.\ +The trade is committed on any of the indexed `platforms`and will be facilitated through a smart contract of those platform's `exchange_contract_address`. Each trade will have metadata like `block_time`, `tx_hash`_,_ `block_number`, `platform version`, `evt_index` etc.\ +\ +Additionally, we also provide metadata about the traded NFT. `nft_project_name` and `erc_standard` will help you in analysing your dataset more easily. `nft_project_name` data gets pulled from the `nft.tokens` [table](https://github.com/duneanalytics/abstractions/blob/master/ethereum/nft/tokens.sql), if your NFT is missing in that table, you are welcome to make a PR to add it. -他们交换一个由 `nft_contract_address` 和 `token_id` 的组合唯一标识的项目。买方将以任何给定的 `original_currency` 向卖方支付给定的 `original_amount` 代币。为方便起见,我们已经为你计算了在交易时对应价值的 `usd_amount` 。大多数交易将以 ETH 或 WETH 进行,但尤其是非 OpenSea 交易通常包含其他货币类型。 +**Bundle Trade** -交易在任何被索引的 `platforms` 上进行,并将通过这些平台的 `exchange_contract_address` 的智能合约来促进。每笔交易都会有诸如 `block_time` , `tx_hash` , `block_number` , `platform version` , `evt_index` 等元数据。 +There can also be trades in which a single trade transaction contains multiple Items. Each of these Items is uniquely identified through a combination of `nft_contract_address` and `token_id`. Unfortunately, in these trades there is not a clear way to determine a corresponding `usd_amount` for each of the items. A possible workaround is to divide the number of items by the payment made for the bundle, but this logic very quickly falls apart when Items that are not one in kind/value get sold in a bundle. We recommend removing bundle transfers from the dataset that you are working with since it can heavily influence the results in either direction. Note that `token_id` and '`erc_standard` will be null if tokens with different tokens IDs or erc type are transfered within the same transaction. -此外,我们还提供有关交易的 NFT 的元数据。`nft_project_name` 和 `erc_standard` 将帮助你更轻松地分析数据集。`nft_project_name` 数据将从 `nft.tokens` [数据表](https://github.com/duneanalytics/abstractions/blob/master/ethereum/nft/tokens.sql) 中提取,如果你的 NFT 在该表中不存在,欢迎你发PR来添加它。 +**Aggregator Trade** -**捆绑交易(Bundle Trade)** +There can also be trades in which a single trade transaction contains multiple items, especially when using NFT aggregator platforms. Our approach is to unravel aggregator trades so that each row correspond to a unique item that was traded, with its associated ID, price, collection, etc. Importantly, the `trade_type` will be indicated as `Aggregator Trade`, and platform names and address can be found in the `nft.aggregators` [table](https://github.com/duneanalytics/abstractions/blob/master/ethereum/nft/aggregators.sql). If your aggregator platform is missing in that table, you are welcome to make a PR to add it. -单次交易也可能包含多个物品。这些物品中的每一个都通过 `nft_contract_address` 和 `token_id` 的组合来唯一标识。然而在这些交易中,没有明确的方法来确定每个物品对应的 `usd_amount` 。一种可能的解决方法是将商品数量除以捆绑商品的付款金额,但是当非实物/价值的商品捆绑出售时,这种逻辑就不成立了。我们建议从你正在使用的数据集中删除捆绑转移,因为它会严重影响任一方向的结果。请注意,如果在同一交易中转移具有不同Token ID 或 erc 类型的代币,则 `token_id` 和 `erc_standard` 将为空(Null)。 +**Platform and Royalty Fees** -**聚合贸易(Aggregator Trade)** +In the most recent version of `nft.trades`, information about the amount and percent of royalty fees in the original amount and in USD is available when this information was able to be retrieved. Royalty fees are going to the creator, and Platform fees are collected by the NFT platform. Note that royalty fees cannot always be retrieved, and are set to null by default. -在使用 NFT 聚合器平台时,也会出现单次交易包含多个物品的情况。我们的方法是分解聚合器交易,以便每一行对应一个被交易的唯一商品,及其关联的 ID、价格、分类等。重要的是,`trade_type` 将指示为`聚合贸易` ,平台名称和地址可以在 `nft.aggregators` [数据表](https://github.com/duneanalytics/abstractions/blob/master/ethereum/nft/aggregators.sql) 中找到。如果该表中缺少你的聚合平台,欢迎你提交 PR 以添加它。 +### **Sample dashboards** -**平台和版税费用** +**Dashboard that utilize parameters** -在最新版本的 `nft.trades` 中,如果销售许可费(royalty fees)的原始金额,美元金额以及百分比的信息在数据库中存在,那么检索时是一并提供的。版税归创作者所有,平台费用由 NFT 平台收取。请注意,版税费用并非总是能检索,所以默认设置为 null。 - -### **示例仪表盘** - -**利用参数的仪表盘** - -[**https://dune.xyz/0xBoxer/NFT**](https://dune.xyz/0xBoxer/NFT) +[**https://dune.xyz/0xBoxer/NFT**](https://dune.xyz/0xBoxer/NFT)\*\*\*\* [**https://dune.xyz/rantum/NFT-Sales-Overview-by-Project**](https://dune.xyz/rantum/NFT-Sales-Overview-by-Project) -**涵盖整个生态系统的仪表盘** +**Dashboards that look across the entire Ecosystem** [**https://dune.xyz/rantum/NFT-Collection-Dashboard**](https://dune.xyz/rantum/NFT-Collection-Dashboard) [**https://dune.xyz/masquot/NFT-Sales-Trends**](https://dune.xyz/masquot/NFT-Sales-Trends) -## **先生,我的平台没有被索引** +## **Ser my platform is not indexed** -处理每个市场数据的 SQL 代码是开源的,可在我们的 [github 存储库](https://github.com/duneanalytics/abstractions/tree/master/ethereum/nft/trades) 中找到。每个人都可以查看代码、提交拉取请求并提交代码以添加更多交易市场。 +The SQL code that processes the data for every market place is open source and available in our [github repository](https://github.com/duneanalytics/abstractions/tree/master/ethereum/nft/trades). Everyone can review the code, make pull requests and submit code to add more marketplaces. -另请阅读有关此主题的“[抽象表](abstractions.md)”部分。 +Also read the section "[abstractions](abstractions.md)" about this topic. -**数据表内容** +**Table contents** -| 列名 | 数据类型 | 说明 | +| column\_name | data\_type | description | | ---------------------------- | ------------------------ | --------------------------------------------------------------------------------- | -| block\_time | timestamp with time zone | 该交易何时执行的 | -| nft\_project\_name | text | NFT 项目名称(例如“the dudes”) | -| nft\_token\_id | text | 交易的 token\_id(例如 235) | -| erc\_standard | text | 交易代币的代币标准 | -| platform | text | 该交易是在哪个平台上执行的? | -| platform\_version | text | 使用了该平台的哪个版本? | -| trade\_type | text | “单品销售”还是“捆绑销售”? | -| number\_of\_items | integer | 本次交易一共交易了多少个 NFT? | -| category | text | 这是拍卖(auction)还是直销(direct sale)? | -| evt\_type | text | 当前未使用,默认“Trade” | -| aggregator | text | 此交易是否使用聚合器进行(是:聚合器名称,否:NULL) | -| usd\_amount | numeric | 执行时交易的美元价值 | -| seller | bytea | NFT 卖家地址 | -| buyer | bytea | NFT 买家地址 | -| original\_amount | numeric | 正确格式的金额 | -| original\_amount\_raw | numeric | 货币的原始金额 | -| eth\_amount | numeric | 执行时交易的 ETH 价值 | -| royalty\_fees\_percent | numeric | 支付给创作者的版税(百分比) | -| original\_royalty\_fees | numeric | 交易所用货币的特许权使用费 | -| usd\_royalty\_fees | numeric | 执行时特许权使用费的美元价值 | -| platform\_fees\_percent | numeric | 平台费用(百分比) | -| original\_platform\_fees | numeric | 用于此交易的货币的平台费用 | -| usd\_platform\_fees | numeric | 执行时平台费用的美元价值 | -| original\_currency | text | 用于此交易的货币 | -| original\_currency\_contract | bytea | 本次交易所用币种的 erc20 地址(不适用于原始ETH) | -| currency\_contract | bytea | 修正后的货币合约 | -| nft\_contract\_address | bytea | 交易的 NFT 合约地址 | -| exchange\_contract\_address | bytea | 促成此交易的平台合约 | -| tx\_hash | bytea | 本次交易的哈希 | -| block\_number | integer | 该交易执行完成的区块编号 | -| tx\_from | bytea | 发起本次交易的地址 | -| tx\_to | bytea | 接收这笔交易的地址 | +| block\_time | timestamp with time zone | When was this trade exectuted | +| nft\_project\_name | text | NFT project name (e.g. "the dudes") | +| nft\_token\_id | text | The token\_id that got trades (e.g. 235) | +| erc\_standard | text | The Token Standard of the traded token | +| platform | text | Which Platform was this trade executed on? | +| platform\_version | text | Which version of this platform was utilized? | +| trade\_type | text | "Single Item Sale" or "Bundle Sale"? | +| number\_of\_items | integer | How many NFTs were traded in this trade? | +| category | text | Was this an auction or a direct sale? | +| evt\_type | text | currently not in use, default 'Trade' | +| aggregator | text | Was this trade made using an aggregator (Yes : Name of aggregator, No : Null) | +| usd\_amount | numeric | USD value of the trade at time of execution | +| seller | bytea | Seller of NFTs | +| buyer | bytea | Buyer of NFTs | +| original\_amount | numeric | The amount in the right format | +| original\_amount\_raw | numeric | raw amount of the currency | +| eth\_amount | numeric | ETH value of the trade at time of execution | +| royalty\_fees\_percent | numeric | Royalty fees going to the creator (in %) | +| original\_royalty\_fees | numeric | Royalty fees in the currency used for this trade | +| usd\_royalty\_fees | numeric | USD value of royalty fees at time of execution | +| platform\_fees\_percent | numeric | Platform fees (in %) | +| original\_platform\_fees | numeric | Platform fees in the currency used for this trade | +| usd\_platform\_fees | numeric | USD value of platform fees at time of execution | +| original\_currency | text | The Currency used for this trade | +| original\_currency\_contract | bytea | The erc20 address of the currency used in this trade (does not work with raw ETH) | +| currency\_contract | bytea | the corrected currency contract | +| nft\_contract\_address | bytea | The contract address of the NFT traded | +| exchange\_contract\_address | bytea | The platform contract that facilitated this trade | +| tx\_hash | bytea | the hash of this transaction | +| block\_number | integer | the block\_number that this trade was done in | +| tx\_from | bytea | Initiated this transaction | +| tx\_to | bytea | Received this transaction | | trace\_address | ARRAY | n/a | -| evt\_index | integer | 事件索引 | +| evt\_index | integer | event index | | trade\_id | integer | n/a | -## **鸣谢** +## **Credits** -以下 Dune 用户在 NFT 方面的惊叹的先驱性工作: +Amazing pioneer work on NFTs by the following Dune users: * [https://dune.xyz/rchen8](https://dune.xyz/rchen8) * [https://dune.xyz/keeganead](https://dune.xyz/keeganead) * [https://dune.xyz/eliasimos](https://dune.xyz/eliasimos) -以下高级用户提供了多方面的帮助: +The following power users helped along the way in various ways: * [https://dune.xyz/0xBoxer](https://dune.xyz/0xBoxer) * [https://dune.xyz/danner\_eth](https://dune.xyz/danner\_eth) diff --git a/data-tables/data-tables/prices.md b/data-tables/data-tables/prices.md index 9d5ead6..9bb0300 100644 --- a/data-tables/data-tables/prices.md +++ b/data-tables/data-tables/prices.md @@ -1,48 +1,51 @@ -# 价格表(Prices) +# Prices -#### 中心化交易所交易数据 +#### Centralized exchanges trading data -代币成交量很好,但你通常想知道智能合约活动的美元价值。你可以使用我们从 coinpaprika API 中提取的数据轻松获取该信息并将其与链上数据相结合。 +Token volume is great, but more often than not you want to know the USD value of smart contract activity.\ +You can easily get and combine that information with on-chain data using the data we pull from the coinpaprika API. -价格是基于实时市场数据的成交量加权价格,转换为美元。 +The Price is the volume-weighted price based on real-time market data, translated to USD. **prices.usd** -该表支持一系列 erc20.tokens 。 +This table support a range of erc20.tokens. \ +If the token you desire is not listed in here, please make a pull request to our [github repository](https://github.com/duneanalytics/abstractions/tree/master/prices) **** or use the decentralized price feed **dex.view\_token\_prices.** -如果你想要的代币未在此处列出,请向我们的 [github 存储库](https://github.com/duneanalytics/abstractions/tree/master/prices) 提交拉取请求 **** 或使用去中心化价格馈送(price feed) **dex.view\_token\_prices.** - -|
列名
| 描述 | +|column name
| description | | ------------------------- | --------------------------------------------- | -| contract\_address | erc20 合约地址 | -| symbol | 资产的标识符(股票代码、现金标签) | -| price | 任何给定分钟内的资产价格 | -| minute | 此表是按分钟为单位计算的 | +| contract\_address | the contract address of the erc20 token | +| symbol | the identifier of the asset (ticker, cashtag) | +| price | the price of the asset in any given minute | +| minute | the resolution for this table is by minute | Note that `WETH` can be used for ETH price. **prices.layer\_1usd** -该表还支持其他区块链上的第 1 层(Layer 1)资产。 +This table also supports layer 1 assets on other blockchains. -| 列名 | 描述 | +| column name | description | | ----------------- | --------------------------------------------- | -| contract\_address | erc20 合约地址 | -| symbol | 资产的标识符(股票代码、现金标签) | -| price | 任何给定分钟内的资产价格 | -| minute | 此表是按分钟为单位计算的 | +| contract\_address | the contract address of the erc20 token | +| symbol | the identifier of the asset (ticker, cashtag) | +| price | the price of the asset in any given minute | +| minute | the resolution for this table is by minute | **** **dex.view\_token\_prices** -我们创建了一个去中心化的价格馈送(price feed),它根据去中心化的交易所交易数据计算价格。**此表涵盖的资产比 price.usd 多得多**。此表非常占用资源,因此只能每隔几个小时更新一次,使用时请记住这一点。 +We created a decentralized price feed that calculates prices based on decentralized exchange trading data. **This table covers much more assets than prices.usd.** This table is very resource intensive and can therefore only be updated every few hours, please keep that in mind when utilizing it. -该表目前仅在以太坊数据集中存在。 +This table currently only exists for Ethereum data. -| 列名 | 描述 | +| column name | description | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| contract\_address | erc20 合约地址 | -| sample\_size | 该资产在所有去中心化交易所发生的交易数量(如果数量非常少,你可能希望排除数据,这可能会导致不准确)。| -| median\_price | 任何给定小时内资产的中位数价格 | -| hour | 此表按每小时为单位计算 | +| contract\_address | the contract address of the erc20 token | +| sample\_size | the number of trades that occurred for this asset on all decentralized exchanges (If the number is very small you might want to exclude the data, it can lead to inaccuracies). | +| median\_price | the median price of the asset in any given hour | +| hour | the resolution for this table is hourly | + + + diff --git a/data-tables/data-tables/raw-data/README.md b/data-tables/data-tables/raw-data/README.md index 8b66a49..87dc82b 100644 --- a/data-tables/data-tables/raw-data/README.md +++ b/data-tables/data-tables/raw-data/README.md @@ -1,15 +1,15 @@ -# 原始数据表 +# Raw Data {% content-ref url="ethereum-data.md" %} -[以太坊数据(ethereum)](ethereum-data.md) +[ethereum-data.md](ethereum-data.md) {% endcontent-ref %} {% content-ref url="xdai-data.md" %} -[XDai 数据(xdai).md](xdai-data.md) +[xdai-data.md](xdai-data.md) {% endcontent-ref %} {% content-ref url="../solana-data/" %} -[Solana 数据(solana)](../solana-data/) +[solana-data](../solana-data/) {% endcontent-ref %} diff --git a/data-tables/data-tables/raw-data/ethereum-data.md b/data-tables/data-tables/raw-data/ethereum-data.md index 71ddd18..4d9d06e 100644 --- a/data-tables/data-tables/raw-data/ethereum-data.md +++ b/data-tables/data-tables/raw-data/ethereum-data.md @@ -1,109 +1,110 @@ --- -说明: >- - 我们的数据库自动获取以太坊区块链上每笔交易的不同方面, - 并根据表格关注的方面将它们解析为不同的表格。 +description: >- + Our Database automatically picks up different aspects of every transaction on + the Ethereum Blockchain and parses them into different tables depending on + which aspect that table is focused on. --- -# 以太坊数据(Ethereum) +# Ethereum data ## Ethereum.Blocks -| **列名** | **数据类型** | **说明** | +| **Column Name** | **datatype** | **Description** | | ------------------- | ------------ | ---------------------------------------------------------------------------------------- | -| time | timestamptz | 区块被开采的时间。 | -| number | numeric | 区块链的长度(以块为单位) | -| hash | bytea | 该区块的唯一标识符 | -| parent hash | bytea | 前一个区块的唯一标识符 | -| gas\_limit | numeric | 当前区块的gas限制 | -| gas\_used | numeric | 当前区块中使用的gas | -| miner | bytea | 矿工的地址 | -| difficulty | numeric | 开采区块所需的难度值 | -| total\_difficulty | numeric | 直到这个区块的总难度值 | -| nonce | bytea | 区块随机数,用于展示挖矿过程中的工作量证明 | -| size | numeric | 此块的大小(以字节为单位)(受限于 gas limit) | -| base\_fee\_per\_gas | numeric | 此区块的基本费用(由[EIP1559](https://eips.ethereum.org/EIPS/eip-1559))引入 | +| time | timestamptz | the time when the block was mined. | +| number | numeric | the length of the blockchain in blocks | +| hash | bytea | a unique identifier for that block | +| parent hash | bytea | the unique identifier for the prior block | +| gas\_limit | numeric | the gas limit of the current block | +| gas\_used | numeric | the gas used in this block | +| miner | bytea | the address of the miner | +| difficulty | numeric | the effort required to mine the block | +| total\_difficulty | numeric | total difficulty of the chain until this block | +| nonce | bytea | the block nonce is used to demonstrate the proof of work during mining | +| size | numeric | this block's size in bytes (limited by gas limit) | +| base\_fee\_per\_gas | numeric | this block's base fee (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | ## Ethereum.Logs -该表存储了智能合约生成的所有日志。它有时对于查询尚未解码或抗解码的合约很有用(我们需要一个 abi 密钥才能解码)。 +This Table stores all logs that get generated by smart contracts. It is sometimes useful for querying contracts that are not yet decoded or are resistant to being decoded(we need an abi key for that). -日志是一种以低廉的价格在以太坊区块链上存储少量数据的优雅方式。具体来说,事件日志有助于让其他人知道发生了什么事情,而不必单独查询合约。 +Logs are an elegant way to store tiny amounts of data on the Ethereum blockchain for a small price. Specifically, event logs are useful to let other people know something has happened without them having to query contracts individually. -关于此主题的更多信息请阅读 [这篇文章](https://medium.com/mycrypto/understanding-event-logs-on-the-ethereum-blockchain-f4ae7ba50378)。 +For more on this topic read [this article](https://medium.com/mycrypto/understanding-event-logs-on-the-ethereum-blockchain-f4ae7ba50378). -| **列名** | **数据类型** | **说明** | +| **Column Name** | **datatype** | **Description** | | ----------------- | ------------ | ------------------------------------------------ | -| block\_hash | bytea | 该区块的唯一标识符 | -| block\_number | int8 | 区块链的长度(以块为单位) | -| block\_time | timestamptz | 区块被开采的时间 | -| contract\_address | bytea | 发出日志的合约地址 | -| data | bytea | 事件数据 | -| topic1 | bytea | 事件的索引主题1 | -| topic2 | bytea | 事件的索引主题2 | -| topic3 | bytea | 事件的索引主题3 | -| topic4 | bytea | 事件的索引主题4 | -| index | numeric | 区块中的交易索引位置 | -| tx\_hash | bytea | 事件的交易哈希 | -| tx\_index | numeric | 交易索引 | - -[**请自行看看**](https://dune.xyz/queries/38957) +| block\_hash | bytea | a unique identifier for that block | +| block\_number | int8 | the length of the blockchain in blocks | +| block\_time | timestamptz | the time when the block was mined | +| contract\_address | bytea | The address of the contract that emitted the log | +| data | bytea | event data | +| topic1 | bytea | indexed _keys_ of the event | +| topic2 | bytea | indexed _keys_ of the event | +| topic3 | bytea | indexed _keys_ of the event | +| topic4 | bytea | indexed _keys_ of the event | +| index | numeric | the transactions index position in the block | +| tx\_hash | bytea | the transaction hash of the event | +| tx\_index | numeric | the index of the transaction | + +[**Take a look for yourself**](https://dune.xyz/queries/38957) ## Ethereum.Transactions -| **列名** | **数据类型** | **说明** | -|------------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| block\_time | timestamptz | 区块被开采的时间 | -| nonce | numeric | 该钱包独有的交易随机数 | -| index | numeric | 区块中的交易索引位置 | -| success | boolean | 显示代交易是否成功的真/假值 | -| from | bytea | 发送者的地址 | -| to | bytea | 接收者的地址。当是合约创建交易时为NULL | -| value | numeric | 在此交易中发送的以 wei 为单位的以太币数量。请注意,erc20 代币不会出现在这里。 | -| block\_number | int8 | 区块链的长度(以块为单位) | -| block\_hash | bytea | 该区块的唯一标识符 | -| gas\_limit | numeric | 以 wei 为单位的 gas 限制 | -| gas\_price | numeric | 以 wei 为单位的 gas 价格 | -| gas\_used | numeric | 以 wei 为单位的交易消耗的 gas | -| data | bytea | 事件数据 | -| hash | bytea | 交易哈希 | -| type | text | 交易类型:`Legacy, AccessList,` 或者 `DynamicFee` | -| access\_list | jsonb | 交易打算访问的地址和存储密钥的列表。参见 [EIP 2930](https://eips.ethereum.org/EIPS/eip-2930)。适用于交易类型为 `AccessList` 或 `DynamicFee` 的情况 | -| max\_fee\_per\_gas | numeric | 交易发送者愿意支付的每单位 gas 的最高费用总额(由 [EIP1559](https://eips.ethereum.org/EIPS/eip-1559) 引入) | -| max\_priority\_fee\_per\_gas | numeric | 交易发送者愿意向矿工支付的每单位 gas 的最高费用,以激励他们包含他们的交易(由 [EIP1559](https://eips.ethereum.org/EIPS/eip-1559) 引入) | -| priority\_fee\_per\_gas | numeric | 本次交易支付给矿工的优先权费用(由 [EIP1559](https://eips.ethereum.org/EIPS/eip-1559) 引入) | - -\*\*\*\*[**请自行看看**](https://dune.xyz/queries/38964)\*\*\*\* +| **Column Name** | **datatype** | **Description** | +| ---------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| block\_time | timestamptz | the time when the block was mined | +| nonce | numeric | the transaction nonce, unique to that wallet | +| index | numeric | the transactions index position in the block | +| success | boolean | a true/false value that shows if the transaction suceeded | +| from | bytea | address of the sender | +| to | bytea | address of the receiver. Null when its a contract creation transaction | +| value | numeric | the amount of ether sent in this transaction in wei. note that erc20 tokens do not show up here. | +| block\_number | int8 | the length of the blockchain in blocks | +| block\_hash | bytea | a unique identifier for that block | +| gas\_limit | numeric | the gas limit in wei | +| gas\_price | numeric | the gas price in wei | +| gas\_used | numeric | the gas consumed by the transaction in wei | +| data | bytea | event data | +| hash | bytea | the hash of the transaction | +| type | text | the type of the transaction: `Legacy, AccessList,` or`DynamicFee` | +| access\_list | jsonb | a list of addresses and storage keys the transactions intends to access. See [EIP2930](https://eips.ethereum.org/EIPS/eip-2930). Applicable if the transaction is of type `AccessList` or `DynamicFee` | +| max\_fee\_per\_gas | numeric | the maximum fee per gas the transaction sender is willing to pay total (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | +| max\_priority\_fee\_per\_gas | numeric | maximum fee per gas the transaction sender is willing to give to miners to incentivize them to include their transaction (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | +| priority\_fee\_per\_gas | numeric | the priority fee paid out to the miner for this transaction (introduced by [EIP1559](https://eips.ethereum.org/EIPS/eip-1559)) | + +\*\*\*\*[**Take a look for yourself**](https://dune.xyz/queries/38964)\*\*\*\* ## Ethereum.Traces -代交易可以触发修改以太坊虚拟机内部状态的更小的原子动作。有关这些操作执行的信息会被记录下来,并且可以存储为 EVM 执行跟踪,或者简称_跟踪(trace)_。 - -在[这里](https://medium.com/chainalysis/ethereum-traces-not-transactions-3f0533d26aa)阅读更多信息。 - -| **列名** | **数据类型** | **说明** | -| --------------- | ------------ | ------------------------------------------------------------------------------------------------ | -| block\_time | timestamptz | 区块被开采的时间 | -| tx\_success | boolean | 显示代交易是否成功的真/假值 | -| success | boolean | 显示跟踪操作是否成功的真/假值 | -| block\_hash | bytea | 该区块的唯一标识符 | -| block\_number | int8 | 区块链的长度(以块为单位) | -| tx\_hash | bytea | 事件的交易哈希 | -| from | bytea | 发送者的地址 | -| to | bytea | 接收者的地址。当是合约创建交易时为NULL | -| value | numeric | 在此交易中发送的以 wei 为单位的以太币数量。请注意,erc20 代币不会出现在这里。| -| gas | numeric | gas 限制 | -| gas\_used | numeric | 以 wei 为单位的交易消耗的 gas | -| tx\_index | numeric | 交易索引 | -| trace\_address | array\x2a7d..
(bytea)
0x2a7d...
(string)
\x2A7D...
(bytea)
在 Postgres 中工作
0x2a7d...
(string)
在 Spark 中必须小写。
可以通过 lower('0x2A7D...')
完成。
不要使用prices.usd
的 decimals 字段
获取json对象的差异
|("takerOutputUpdate"->
'deltaWei'->'value'
)decode(substring(("addressSet"->'baseAsset')::TEXT, 4,40), 'hex')
get_json_object(get_json_object(takerOutputUpdate,'$.deltaWei'),'$.value')
'0x'
\x2a7d..
(bytea)
0x2a7d...
(string)
\x2A7D...
(bytea)
Works in Postgres
0x2a7d...
(string)
Has to be lowercase in Spark.
Can be done via lower('0x2A7D...')
.
Don’t useprices.usd
decimals
Get json object
differences
("takerOutputUpdate"->
'deltaWei'->'value'
)decode(substring(("addressSet"->'baseAsset')::TEXT, 4,40), 'hex')
get_json_object(get_json_object(takerOutputUpdate,'$.deltaWei'),'$.value')
'0x'