Skip to content

Commit 0724055

Browse files
committed
Adjust folder structure according to master
1 parent 4652d46 commit 0724055

File tree

200 files changed

+1613
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+1613
-2
lines changed

docs/zh/.hackathon-guide.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: insert_hackathon_name Hacker Guide
3+
description: Welcome to the Dune API ETHSF Hackers! Get started here.
4+
---
5+
6+
Hello ETHSF hackers, welcome to the wonderful world of Dune, we're excited to see what you build with our API!
7+
8+
## Getting an API Key
9+
10+
To get started building on our API, [first create a Dune account here](https://dune.com/auth/register) (if you don't already have one 🧙).
11+
12+
[Then fill out this form](https://forms.gle/JgToag62ZGY58nBh6) and we'll send you an API key as soon as we can (stop by our booth and bug us if you're waiting too long 🪄).
13+
14+
## Important Links
15+
16+
- Our [API Welcome page here](api/index.md) to learn about how our API works
17+
- Our [Quick Start Guides](api/quick-start/index.md) (for Python and JS) to learn how to setup your environment and start executing.
18+
- Our [API Reference](api/api-reference/index.md) section for specifics about our Endpoints
19+
- Our [#dune-api Discord channel](https://discord.com/channels/757637422384283659/1019910980634939433) for questions and support!
20+
21+
## Picking a Programming Language
22+
While you can consume our API in the language of your choice - see the [API Reference section](api/api-reference/authentication.md) - we currently have quick start guides for [Python](api/quick-start/api-py.md) and [Node.js](api/quick-start/api-js.md).
23+
24+
## What to Build
25+
26+
With Dune, you have access to almost all of the data from today's most popular blockchain ecosystems. There is no limit to what you can build on top of this data!
27+
28+
With so many possibilities, it can be challenging to figure out what to work on at times, so here are some ideas to help you ideate:
29+
30+
### ETHSF Sponsor Bounties
31+
32+
Of course, [we have a Bounty available](https://ethglobal.com/events/ethsanfrancisco2022/prizes#dune) for you to earn cash and prizes for doing cool things with our API.
33+
34+
You can also find inspiration from our awesome fellow sponsors.
35+
36+
### Previous Hackathons
37+
38+
Awesome projects from previous hackathons are also a great way to get some cool ideas:
39+
40+
- [ETHBerlin](https://dunedigest.substack.com/p/dune-digest-48)
41+
42+
### New Kinds of Interfaces for Blockchain Data
43+
44+
Our community champion [@0xBoxer](https://dune.com/0xBoxer) has this [tutorial](https://youtu.be/ez3VfcfNwvc) where he walks us through creating a [dashboard](https://dune.com/0xBoxer/gas-tracker-dashboard) for personalized metrics for any wallet.
45+
46+
With the Dune API it's possible to build a much nicer interface for this or any dashboard on Dune inside of your own super-smooth, super-cool app UX.
47+
48+
Or Excel, Google sheets, Notion Pages, Discord Bots, Telegram Bots, there are no limits.
49+
With the API, the Data Can Flow anywhere!
50+
51+
### Real World Examples from Cow Protocol
52+
53+
[@bh2smith](https://dune.com/bh2smith) from our community (and [Cow Protocol](https://dune.com/cowprotocol)), gave a talk Thursday at [DuneCon](https://dunecon.com) where he walked us through some real-world examples of how Cow Protocol has been using the API.
54+
55+
[Check out the replay here](https://youtu.be/VEvk-iqxXIM?t=404)!
56+
57+
## About Dune @ ETHSF
58+
59+
Dune is the leading community-powered crypto analytics platform. Every day, thousands of Dune wizards 🧙 create, find and fork dashboards on Dune to discover and share insights in crypto.
60+
61+
Just by writing SQL, you can query data from all popular L1 + L2 blockchain networks, decoded contracts, and community built “spells” for DEXes, NFTs, stablecoins and more.
62+
63+
Our API is the #1 requested feature and is available in private beta today. With the Dune API, you can custom build an endpoint for your application, and query that data programmatically. Whether you’re building a web3 market intelligence tool or powering the latest in trading strategies, Dune is ready to power your data layer.
64+
65+
66+
🏆 PRIZE OVERVIEW
67+
68+
🥇 5x bounties of $2,000 each
69+
🧢 Limited edition swag for winners
70+
👕 Swag for everyone who uses Dune in their project
File renamed without changes.
File renamed without changes.
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
title: Decoding Contracts
3+
description: Here's everything you need to know about Decoded contracts and how to submit them!
4+
---
5+
6+
Dune contains an extensive catalog of Decoded Contracts, brought into the platform through Wizard submissions!
7+
8+
Instead of working with raw transaction, log, and trace data, contracts are decoded into human-readable tables for each event and function defined in the smart contract's ABI ([Application Binary Interface](https://www.alchemy.com/overviews/what-is-an-abi-of-a-smart-contract-examples-and-usage)).
9+
10+
Learn more about how Decoding works and what Decoded tables are available [here](../../tables/decoded/).
11+
12+
## Submitting a new contract for decoding
13+
14+
![type:video](https://www.youtube.com/embed/4v9zEYZvv34)
15+
16+
Contracts can be submitted for decoding through:
17+
18+
- [The New contract form](https://dune.com/contracts/new)
19+
- The [My Creations > Contracts Tab](https://dune.com/browse/contracts/authored)
20+
- Within the dataset explorer in the Query editor's sidebar:
21+
22+
![Add a new contract](images/add-new-contract-link.png)
23+
24+
The contract submission form, which consists of 2 steps:
25+
26+
### 1. Blockchain and address
27+
28+
We first ask for the contract's address and blockchain. Requesting this data first has two purposes:
29+
30+
1. To enable us to review for potential duplicate contracts and pending submissions.
31+
2. To automate parts of the submission process where we can.
32+
33+
The latter is usually accomplished by fetching potentially useful metadata from Dune and other third party sources where relevant.
34+
35+
For instance, below here's an example of submitting the USDT contract (`0x94b008aA00579c1307B0EF2c499aD98a8ce58e58`) in Optimism:
36+
37+
![Submit smart contract](images/submit-smart-contract.png)
38+
39+
If we can find the contract through a third party source, we will show a green check mark next to the address field.
40+
41+
This means we were able to fetch information such as the contract's name and ABI (Application Binary Interface).
42+
43+
### 2. Contract details
44+
45+
After pressing Next, we ask for other information about the contract that we need in order to decode it:
46+
47+
![Submit smart contract 2](images/submit-smart-contract-2.png)
48+
49+
If we found the contract through other third party sources, you will only have to fill in the project name.
50+
51+
We have some naming conventions on that, partly due to our technical setup and also to make finding data more predictable.
52+
53+
**Project Names Rules**
54+
55+
- All lowercase
56+
- No spaces (underscore "_" if needed)
57+
- Added "_v2" or other version names at the end if applicable
58+
59+
eg `augur`, `tornado_cash`, `uniswap_v2`
60+
61+
Once you submit it, you are done! The contract will be stored in our queue, which we manually review for quality assurance purposes.
62+
63+
!!! note
64+
65+
Submission might take a few days to get processed, please be patient with us! 🙏
66+
67+
### Advanced options
68+
69+
In some instances, Dune can automatically detect and index multiple contract addresses under the same submission. This is useful for examples such as AMM pools where there often exists one contract instance per pair.
70+
71+
We have two strategies for detecting other contracts for decoding:
72+
73+
1. **Bytecode match.** We use the bytecode of the contract address in the submission to find other matches in the whole chain history.
74+
2. **Factory instances.** We find all other contracts created by the same address as the one responsible for creating the submitted contract.
75+
76+
In both cases, we assume that all the contracts found through either method correspond to the same blockchain, project name, contract name and ABI.
77+
78+
If you want us to index more than one contract, toggle on Advanced options and select "Yes" to the first question, "Are there several instances of this contract?"
79+
80+
Then, to the second question - "Is it created by a factory contract?" - select "No" to index all other contracts with the same bytecode or "Yes" to index all other contracts originating from the same creator:
81+
82+
![new-contract-advanced-options](images/new-contract-advanced-options.png)
83+
84+
!!! warning
85+
86+
Only use these options if you know what you're doing and are extremely familiar with the project's architecture and deployment hierarchy. Incorrectly applying these settings may lead to a rejected submission.
87+
88+
## Tracking your submissions
89+
90+
You can view your submissions and their processing status at any time by navigating to [My Creations > Contracts](https://dune.com/browse/contracts/authored):
91+
92+
![Track your submission](images/track-your-submission.png)
93+
94+
### Frequently Asked Questions
95+
96+
#### How do I submit contract information manually?
97+
98+
!!! note
99+
If the contract being manually submitted is a Proxy contract, we recommend you to move on to the next section.
100+
101+
Although we try to fetch contract information such as the ABI, sometimes this information might not be available through our sources.
102+
103+
In those instances, you will need to manually input the contract's name and its ABI.
104+
105+
If the contract has been verified by the chain's block explorer, you should be able to find this information there.
106+
107+
[Find a list of each chain's main block explorer here](../reference/wizard-tools/blockchain-explorers.md)!
108+
109+
#### How do I submit a Proxy contract?
110+
111+
In order to properly decode transactions towards contracts that fit the [Proxy pattern](https://blog.openzeppelin.com/proxy-patterns/), Dune needs to map the Proxy contract's address with the implementation contract's ABI.
112+
113+
We avoid monitoring the implementation contract's address because its logic is accessed in transactions via the [`DelegateCall` function](https://medium.com/coinmonks/delegatecall-calling-another-contract-function-in-solidity-b579f804178c).
114+
115+
If we did monitor the implementation contract's address directly, we would miss out on any event logs in its logic since these are actually fired by the caller (the Proxy in this case) when calling a function through `DelegateCall`.
116+
117+
!!! warning
118+
When submitting Proxy-patterned contracts to Dune, you should input the Proxy contract's address and, if you have it, the Implementation contract's ABI.**
119+
120+
When you submit the Proxy contract's address, we'll attempt to fetch the proxy's contract name and the implementation address it's pointing towards to source the Implementation contract's ABI.
121+
122+
If we can't find the Implementation contract's ABI, you'll need to find it using [the relevant chain's blockchain explorer](../reference/wizard-tools/blockchain-explorers.md) and input it manually.
123+
124+
125+
#### How do I re-submit a contract?
126+
127+
Dune assumes each address in the blockchain can map to at most 1 contract. For this reason, submitting a contract with an address that already exists in `[blockchain].contracts` will override it for Decoding purposes.
128+
129+
This has a couple potential dangerous side effects:
130+
131+
- If the project or contract name has changed, we will generate new tables for all of the contract's methods and events. In turn, previous tables will stop updating, data will be fragmented, and Queries will stop working.
132+
- If the ABI has changed in a way that modifies an existing table's parameters, Queries that depend on such table might break or become inaccurate.
133+
134+
If you attempt to submit a contract that already exists, we'll first present a warning note and ask you to confirm you want to proceed:
135+
136+
![new contract resubmission warning](images/new-contract-resubmission%20warning.png)
137+
138+
Then, at the bottom of the Details page, we'll ask you to explain why you're resubmitting the contract so we can assess whether it's worth overriding the contract's data:
139+
140+
![new contract resubmission reason](images/new-contract-resubmission-reason.png)
141+
142+
If we believe the risk of accepting a re-submission is higher than the added value, we'll reject your resubmission.
143+
144+
If you think we're wrong (we're only human!), feel free to reach out in our [#decoding Discord channel](https://discord.com/channels/757637422384283659/850326962152538122) and we'll discuss it further with you!
145+
146+
#### How do I submit Diamond Proxy contracts?
147+
148+
Similar to vanilla Proxy contracts, [EIP-2535](https://eips.ethereum.org/EIPS/eip-2535) contracts can be supported by passing in the address of the Diamond Proxy as well as **a single ABI representing the totality of all the facets interfaces**.
149+
150+
#### My submission got rejected, why?
151+
152+
In the interest of data quality, we reject duplicative, incorrect or low quality submissions. To avoid rejection, be sure to submit accurate contract information! 🙏
153+
154+
#### For all other questions:
155+
156+
Head over to the [#decoding Discord channel](https://discord.com/channels/757637422384283659/850326962152538122) and we'll be happy to help!

docs/zh/getting-started/embeds.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: Embeds
3+
description: Embeds allow you to enjoy beautiful, updating dune charts across the web!
4+
---
5+
6+
**Screenshots are boring tech of the past.**
7+
8+
To save you from having to take screenshots that might not look so great but will definitely be out of date a few minutes after you take them, we've built a native embed function that works across most web platforms.
9+
10+
You can generate embed links by clicking on any query title and selecting the embed function in the top right corner.
11+
12+
!!! note
13+
The embed button works as a stand alone link and as a way to embed your live graphs into websites/apps. If a Query has no Visualizations, the link will be to the Query Results table. If you have multiple Visualizations, the link will be for whichever Visualization you've selected when you clicked the Embed button.
14+
15+
![generating an embed link](images/embed-link.gif)
16+
17+
## Using Embeds on different platforms
18+
19+
### Twitter
20+
21+
Twitter renders and updates Dune Visualizations automatically!
22+
23+
Simply paste your embed link and let the magic happen. 🪄
24+
25+
![Twitter automatically renders the embed link correctly](images/twitter.gif)
26+
27+
### Discord
28+
29+
Dune embeds work very well in Discord, simply drop the embed link in the chat and the corresponding Visualization will be displayed.
30+
31+
This also lends itself very well to programming a bot to return the corresponding charts on command.
32+
33+
![Discord](images/discord.gif)
34+
35+
### Web Pages
36+
37+
You can use Dune's embed links to add live Visualizations to any web page using an `iframe`
38+
39+
Here is a code snippet example:
40+
41+
`<iframe src="https://dune.com/embeds/208941/391702/2cbe40da-a0e4-43ac-896b-fef6d4d9fda7" height="500" width="500" title="chart 1"></iframe>`
42+
43+
A great showcase for this is the [cryptoart.io](https://cryptoart.io/data) website.
44+
45+
### Mirror.xyz
46+
47+
Dune Visualizations can easily be embedded into articles on mirror.xyz. Simply generate an embed link and postfix it with `?display=iframe`
48+
49+
EG:
50+
51+
`https://dune.com/embeds/208941/391702/34ee3319-1cac-40e1-a08d-160bd93693cc?display=iframe`
52+
53+
### Known Issues
54+
55+
Unfortunately, embeds do not work in a couple of fairly popular web platforms, including:
56+
57+
* Substack
58+
* Medium
59+
* GitBook
60+
61+
## Parameterized embeds
62+
63+
Embed links also work with parameterized Queries, but it is a bit tricky to get them to work:
64+
65+
The embed link you generate won't include the necessary parameters yet, even if you ran the Query with them.
66+
67+
We are working on automating this, but for now you'll need to manually prefix the parameter link with the parameters:
68+
69+
`link?[name_of_parameter_1]=[xxxx]&?[name_of_parameter_2]=[yyyy]&[...]`
70+
71+
EG:
72+
73+
`https://dune.com/embeds/118220/238460/aa002dd3-f9e2-4d63-86c8-b765569306c6NFT?address=0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7&rolling_n_trades=500`
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nav:
2+
- ...
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Dune Guides
3+
---
4+
5+
Some of our best Wizard Community Members have produced outstanding written tutorials for Dune.
6+
7+
These guides are all great and we recommend reading all of them, **BIG THANK YOU** to the Wizards who created them.
8+
9+
You are amazing! 🪄
10+
11+
## The general process for surfacing data with Dune
12+
13+
1. **Compile a List of all relevant contracts and submit them for** [**decoding**](../decoding-contracts.md)**.**
14+
2. **Surface the data using SQL queries**
15+
3. **Visualize the results**
16+
4. **Assemble Visualizations on a Dashboard.**
17+
5. **Make the Dashboard pretty**
18+
6. **Enjoy your data**
19+
20+
21+
=== "PostgreSQL"
22+
23+
### [Andrew Hong](https://dune.com/ilemi) [:material-twitter:](https://twitter.com/andrewhong5297) [:material-youtube:](https://www.youtube.com/channel/UCYG9WSr8G4khYLaxP9tLCkQ)
24+
25+
* [Your guide to basic SQL while learning Ethereum at the same time](https://towardsdatascience.com/your-guide-to-basic-sql-while-learning-ethereum-at-the-same-time-9eac17a05929) (Part 1)
26+
* [Your guide to intermediate SQL while learning Ethereum at the same time](https://towardsdatascience.com/your-guide-to-intermediate-sql-while-learning-ethereum-at-the-same-time-7b25119ef1e2?source=user\_profile---------6----------------------------) (Part 2)
27+
* [Learning SQL and Ethereum](https://towardsdatascience.com/learning-sql-and-ethereum-part-3-5422f080ad36) (Part 3)
28+
* [SQL on Ethereum: How to Work With All the Data from a Transaction](https://ath.mirror.xyz/mbR1n\_CvflL1KIKCTG42bnM4HpfGBqDPNndH8mu2eJw)
29+
30+
### [Alex Manuskin](https://dune.com/ksunama) [:material-twitter:](https://twitter.com/amanusk\_)
31+
32+
* [How to get started with querying on Dune Analytics](https://dune.com/blog/get-started-guide)
33+
34+
### [Paul Pivat](https://dune.com/paulapivat) [:material-twitter:](https://twitter.com/paulapivat)
35+
36+
* [Lean foundational Ethereum topics with SQL](https://ethereum.org/en/developers/tutorials/learn-foundational-ethereum-topics-with-sql)
37+
38+
### [Alex Kroeger](https://dune.com/kroeger0x) [:material-twitter:](https://twitter.com/alex\_kroeger)
39+
40+
* [How to use Dune Analytics like a degen](https://mirror.xyz/0x7B542178633f16940a131F8F6d670ffdbBe6b2Ab/0C3EQBtFqAK4k2TAGPZhg0JMY-upfTAxuTD-o91vBPc)
41+
42+
### [Chuxin](https://dune.com/chuxin) [:material-twitter:](https://twitter.com/chuxin\_h)
43+
44+
* [Select \* from web3](https://www.chuxinhuang.com/blog/select-from-web3)
45+
46+
### Gracelily [:material-twitter:](https://twitter.com/\_grace\_lily)
47+
48+
* [PostgreSQL Query Optimization Tricks - How to Make Queries Faster in Dune Analytics](https://gracelily.medium.com/postgresql-query-optimization-tricks-6d5b7358d7fa)
49+
50+
### Twigblock
51+
52+
* [Build an Ethereum Metrics Dashboard](https://www.twigblock.com/projects/eth-intro-dune/t/eit-overview)
53+
* [Learn to Analyze Ethereum Gas Prices](https://www.twigblock.com/projects/eth-gas-analysis/t/eg-overview)
54+
55+
=== "Databricks SQL"
56+
57+
### [0xPhilan](https://dune.com/phillan) [:material-twitter:](https://twitter.com/0xPhillan)
58+
59+
* [Dune Analytics: A Guide for Complete Beginners](https://mirror.xyz/phillan.eth/17VAXsMPpwJg4OQNBHKTYAQTWfJMwFuXZQDAxPStf0o)
60+
61+
### [James Bachini](https://dune.com/jamesbachini) [:material-twitter:](https://twitter.com/james_bachini)
62+
63+
* [Dune Analytics Tutorial | How To Create A Dune Analytics Dashboard](https://jamesbachini.com/dune-analytics-tutorial/)
64+
65+
### [Kirubakumaresh](https://twitter.com/kirubakumaresh)
66+
67+
* [Buid Ethereum Metrics Dashboard](https://www.twigblock.com/projects/eth-intro-dune/t/eit-overview)
68+
69+
## OurNetwork Course
70+
71+
!!! note
72+
This course is based on Dune's V1 engine. Much of the content is still applicable, but the SQL dialect and some table names have changed in Dune V2.
73+
74+
In collaboration with the Dune Team and Community, our friends at OurNetwork created a course with an ambitious goal: teach 30 people web3 data analytics in 30 days.
75+
76+
Hosted by some of our community's top Wizards, you can now access the presentations for free!
77+
78+
As it covers all of the important topics you'll need to know to effectively analyze blockchain data and become a full-fledged Dune Wizard, it's one of the best places to start your Dune Journey.
79+
80+
More details and all of the course materials can be found here:
81+
82+
<div class="cards grid" markdown>
83+
- [OurNetwork Course](https://ournetwork.mirror.xyz/gP16wLY-9BA1E_ZuOSv1EUAgYGfK9mELNza8cfgMWPQ)
84+
</div>
85+
86+
Please consider buying an edition of the Mirror post to support the teachers of this course.
87+
88+
Videos are also available on YouTube:
89+
90+
![type:video](https://www.youtube.com/embed/yDSmTUrpdoQ)

0 commit comments

Comments
 (0)