New to analyzing NEAR data and want to learn? Then you’re in the right place! Whether you’re a Dune veteran or just starting out this course will cover everything you need to know to get started analyzing the NEAR blockchain using Dune.
This guide is accompanied by a detailed video tutorial for those who prefer learning visually.
This course is for all levels:
- If you are new to NEAR, spend some extra time on the beginning sections understanding how NEAR transactions, receipts, and sharding work. This will help set your foundation as we learn which tables to pull information from
- If you are familiar with NEAR but new to Dune, focus on the ‘Getting Started with Dune’ section of the guide. Navigating the Dune UI and finding the right tables will make your learning journey smooth.
- If you are familiar with both NEAR and Dune, feel free to dive right into the educational queries. We’ll cover beginner, intermediate, and advanced queries.
- Follow Dune on socials
Stay updated by following us on X (formerly Twitter), LinkedIn, and signing up for our newsletter. You’ll get new tutorials, product updates, and resources to level up your skills. - Join the Dune Discord
Connect with a community of fellow wizards, ask questions, share tips, and get inspired by other analysts working with NEAR data. - Document your learning journey
Share your experiences on socials! Tag @Dune and use #NEARwizard to amplify your posts and engage with the community. - What inspired you to become a NEAR Data Wizard?
- Highlights from your learning journey: a simple SQL query, new datasets you discovered, or complex questions you’re tackling.
- Dashboards or charts you’ve built after following this guide.
- Insights you’ve uncovered about the NEAR blockchain ecosystem.
- Feedback about the tutorials, the Dune platform, or NEAR blockchain itself.
- Anything else you want to share—your creativity is the limit!
Note:Note:Note: This guide is structured into daily lessons to guide you through the process step by step. However, feel free to learn at your own pace and explore the areas that interest you most!
Getting Started
Day 1:
Overview of NEAR blockchain
NEAR is a layer one, sharded, proof-of-stake blockchain. That was a lot. So what does this all mean?
- Sharding for Efficiency: NEAR employs sharding to split the network into parallel processing units to increase transaction speed and performance.
- Proof-of-Stake Consensus: By using a proof-of-stake mechanism, NEAR minimizes energy consumption.
- Human readable accounts/addresses:
NEAR uses human-readable account names likesector.near, instead of hexadecimal-encoded addresses such as0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48used on EVM (Ethereum Virtual Machine). You can think of this like using ENS names natively. - Native Account Abstraction
User accounts can also be contracts! You also don’t always need your own gas to transact. - Raw data tables have human readable actions and logs on Dune!
- Navigate to Data Explorer on the left menu.
- Scroll down and click on "Raw Blockchain Data". This will display raw datasets for all chains supported by Dune.
- Scroll down the list or use the search bar to type "NEAR".
- Select NEAR from the list to access its datasets.
- A transaction is a high-level operation submitted by a user/account to interact with the blockchain.NoteNote
Note: Unlike many blockchains with atransactionstable on Dune, NEAR does not have anear.transactionstable. Instead, transaction-related data is captured in thenear.actionstable. This table breaks down transactions into their individual actions, with each row representing a unique action. So what are actions? I’m glad you asked. - An action is a discrete operation within a transaction that defines what the transaction aims to accomplish. A transaction can include multiple actions, such as transferring tokens or calling a smart contract. Here is the full list of available actions available:
- CreateAccount
- DeployContract
- FunctionCall
- Transfer
- Stake
- AddKey
- DeleteKey
- DeleteAccount
- Delegate - These actions are grouped together within a single transaction and processed sequentially or asynchronously, depending on their complexity.
- After a transaction is submitted and executed (via the ExecutionOutcome), it is converted into a series of one or more receipts. These receipts are used to process the actions specified in the transaction, enabling asynchronous execution. This structure is critical for cross-shard operations and can get quite complex. For now, all you need to know is that transactions are converted into receipts, which carry the necessary information to interact with smart contracts and execute the desired actions.
- Finally, after a receipt is executed, logs are emitted by the smart contracts. We’ll be using
near.logson Dune to extract useful information. - All successful transaction actions get converted into one or more receipts. Note: Not all actions generate a unique receipt.
- An additional unique receipt is created when an action requires further asynchronous execution (e.g., cross-contract calls or sending funds to another account).
- Actions that are resolved immediately (e.g., token transfers or local contract calls) do not generate additional receipts.
- Initial Receipt: A receipt is first created when a transaction is submitted, representing the set of actions in the transaction.
- Execution Receipts: If a transaction involves cross-contract calls or complex interactions, additional execution receipts are created to handle the intermediate steps.
- Final Outcome: The receipt system ensures that all actions within the transaction are executed, even if they span multiple shards or contracts.
- Official NEAR Docs
- Additional Documentation
- Working with JSON, VARCHAR, ARRAY data types
Dune documentation
Trino DocumentationTrino-Oreilly-Guide.pdfTrino-Oreilly-Guide.pdf
Trino-Oreilly-Guide.pdf - Let's look at a transaction example:
dune.com/queries/4575420 - How many successful transactions occurred on 2025-01-01?
Answer: dune.com/queries/4575423 - How many times was each action_kind called on 2025-01-01?
Answer: dune.com/queries/4575426 - Find all 'simple pools' deployed on ref-finance
Answer: dune.com/queries/4575590 - What are the weekly number of pools deployed? Deployers?
Answer: dune.com/queries/4575594 - What is the most common 'simple pool' pair(tokenA-tokenB) deployed?
Answer: dune.com/queries/4575601 - Bonus Questions: Find power users: Top 10 Pool Deployers
- Find all swap on Ref.Finance after 2025-01-01
Answer: dune.com/queries/4575620
Note: I technically should have joined the near.actions table with the near.logs table to verify the parent transaction was successful, not just the receipt. - What was the daily number of swaps for all USDC/wNEAR pairs?
Answer: dune.com/queries/4575631 - What was the daily swap volume for all USDC/wNEAR pair?
Answer: https://dune.com/queries/4575638
Note: I made a silly mistake carrying incorrect decimals in the video tutorial. I’ve fixed this on the linked query. - Bonus Questions:
How many users (accounting for relayers) have swapped USDC AND wNEAR in 2025?
Find the top ten users that have gained the most swap referral fees on Ref.Finance?
Find the amount of liquidity added and removed from any pool. What is the current liquidity of the pool? Which pool has the most liquidity?
Day 7:
Final Challenge
Now that you’ve learned the fundamentals, it’s time to put your skills into action!
Find a protocol you’re passionate about, analyze its data, and share your findings with the community on twitter. Make sure to tag @0xSector and @Dune team as we’d love to see your results and provide feedback to help you refine your analysis!
Congratulations on mastering the basics of NEAR data on Dune! 📊
You’ve just taken a huge step toward understanding and analyzing NEAR’s blockchain data. From crafting queries to building dashboards, you’re now equipped to explore insights that power the NEAR ecosystem.
Remember, data is only as powerful as the questions you ask. Keep experimenting and refining your skills. If you have any questions or feedback my DM’s on Twitter are always open. Let’s keep learning together.


