Unit 5 / 11

On-Chain Data Analysis: Making Sense of Block, Transaction and Wallet Data

Gains:

  • Understanding that the safest contribution of artificial intelligence is data extraction query writing, that free interpretation is risky and that every number must be confirmed in the block explorer.
  • Ability to apply the discipline of pulling data from the source, knowing that requesting live chain data directly from artificial intelligence produces fake hashes/addresses
  • Understand that chain data proves visibility but not intent, and the ethical limits of de-anonymization and targeting

One of the greatest strengths of blockchain is its transparency: every transaction, every transfer, every contract interaction is publicly and permanently recorded. On-chain analysis—examining on-chain transaction, address, and money flow data—is the act of reading this public record and making sense of it: tracking a wallet, tracking a money flow, measuring the usage of a protocol. In this unit, we'll learn how to use AI as a data analysis assistant and—critically—how to validate each number.

Structure of on-chain data

Chain data is layered:

  • Block: A time-stamped unit in which transactions are grouped.
  • Transaction (tx): Call of value or contract from one address to another; It is identified with a unique hash.
  • Address/wallet: The identity where funds are kept and transacted.
  • Event (event/log): Structural records emitted by contracts describing what happened.
  • Token transfer: Changing hands of tokens such as ERC-20/ERC-721.

To view this data, block explorer (a site that displays chain data, such as Etherscan) or query platforms (such as Dune, The Graph) are used. The AI ​​does not "know" this data itself; It interprets the data you provide or writes the query to retrieve the data.

Caution: Telling the AI ​​to "fetch that wallet's transactions" is useless and dangerous — the AI ​​is not connected to the live chain and may generate fake hashes/addresses. Correct usage: you extract the data and give it to the AI, the AI ​​interprets it; Or the AI ​​writes you the query that will extract the data, and you run it.

Two key roles of AI in on-chain analysis

1. Query writing. In platforms like Dune Analytics, data is pulled with SQL-like queries. AI is powerful at writing these queries: "write the query that returns the daily transaction count of the following contract for the last 30 days." The query is deterministic; you run it and see the result — the risk of hallucination is low because the data source produces the result, not the AI.

2. Result interpretation. You give the data you captured to the AI ​​and ask, "What does this money flow show? Is there a pattern?" you ask. The risk of hallucinations is high here; Every comment must link to the source.

The risk profile of these two roles is different: query writing is relatively safe (the result comes from the source), free interpretation is relatively risky (the AI ​​can make it up).

Weak prompt / Strong prompt

Weak prompt:

Analyze transactions of the following wallet: 0x1234...

AI is not dependent on live data; This prompt pushes him to make things up.

Powerful prompt (for query):

Your role: on-chain data analyst. Write an SQL query for Dune: Return the DAILY unique sender address count and total transfer volume of the [following ERC-20 token] contract over the last 30 days. Describe the table and field names you used. If the query doesn't work, write down your assumptions so I can fix it. FITTING THE DATA; just generate the query.

Powerful prompt (for comments):

Below is the ACTUAL Dune result (I shot it). Interpret patterns based solely on the numbers ACTUALLY in this chart: volume increase/decrease, unusual jump, concentration. Show each comment with corresponding row/number. Do not add any numbers that are not in the table. Do not claim causality; Write possible explanations as "hypothesis."

Four copyable templates

1) Query generation:

Write a query for Dune/SQL: [time period] on [contract/address] for [metric]. Explain the tables you used and the JOIN logic. I will run and verify the result; data fabrication.

2) Money flow tracking outline:

I will give you a set of ACTUAL transfer records (address, amount, time). Turn these into a trackable flow narrative: where did the funds go, is there concentration? Only use the records I provide; connect each step to the corresponding line. Address fake.

3) Metric interpretation:

Comment on the real metrics table below: number of users, volume, average per transaction. State significant changes and possible causes (hypothesis). Adding data that is not in the table; establishing definitive causality.

4) Anomaly marking:

Baseline: this address normally handles ~[N] transactions, ~[X] volume per day. I will give you the real records. Mark only events that deviate from the baseline based on what ACTUALLY happened in the record; show each with a line. End comment with "needs review".

Three mini cases (in numbers)

Case 1 — Query 1 reduced the day to 20 minutes. An analyst was trying to manually extract a protocol's 90-day user growth. He made the AI ​​write a Dune query; Got a working query and graph in 20 minutes. The numbers were reliable because they came from the source. Lesson: query writing is AI's most secure and efficient contribution.

Case 2 — Fake hash caught. An analyst directly told the AI ​​to "summarize the recent transactions of that whale wallet." AI gave a fluent list; But when checked on Etherscan, most of the transaction hashes were fabrications that did not exist at all. Lesson: asking AI for live data produces hallucinations; data is pulled from the source.

Case 3 — Concentration pattern confirmed. An analyst gave the real transfer data he captured to AI and had it interpreted. YZ noted a pattern in which funds were concentrated in a few addresses. The analyst confirmed this address by address on the block explorer — the pattern was real and indicated a distribution risk. Lesson: interpretation with real data is valuable; But the confirmation is again from the source.

Privacy and ethics

While on-chain data is “open,” its analysis has ethical limits:

  • De-anonymization: Matching addresses to real persons (especially with leaked data) is a serious violation of privacy; done only in a legal and authorized context.
  • Harassment/targeting: It is unethical to track a wallet and target its owner.
  • Investment advice: Inferences such as "That whale is buying, you should too" are both misleading and cause liability.
  • Lack of context: Chain data does not indicate intent; A transfer can be a crime or an ordinary one. Over-interpretation is dangerous.
Tip: Measure every on-chain claim as "the data shows X", not "the person does Y". The chain makes the transaction visible but does not prove intent.

Common mistakes

  • Requesting live data directly from the AI. Generates fake hash/address.
  • Not linking the comment to the source. Each number must be confirmed in the block explorer.
  • Mistaking correlation for causation. The chain pattern does not prove intent.
  • Matching addresses with unconfirmed individuals. Risk of confidentiality breach and error.
  • Turning on-chain inference into investment advice. It is misleading and creates liability.
  • Sharing the query without documenting it instead of one big contract. Repeatability goes away.

In summary

  • On-chain analysis is the process of reading and extracting meaning from open chain data.
  • AI's safest contribution is query writing; The result comes from the source, the risk of hallucinations is low.
  • Free interpretation is risky; each number must be confirmed in the block explorer.
  • Chain data proves visibility but not intent; Excessive interpretation is avoided.
  • De-anonymization and targeting are done only in authorized context with ethical boundaries.

Application task

Choose a protocol or token. Write a query to the AI ​​with the "query generation" prompt that returns the daily transaction count of that token for the last 30 days (Dune is available for free). Run the query. Then have the AI ​​interpret the result with the "metric interpretation" prompt. Confirm each claim in AI's comment in the actual results table and note whether there is a claim that has no counterpart in the table.

checklist

  • [ ] I didn't ask for live data from the AI; I pulled it from the source.
  • [ ] I ran the query and verified the result.
  • [ ] I linked each comment to the actual data row.
  • [ ] I did not present correlation as causation.
  • [ ] I did not make the address-person matching without authorization.
  • [ ] I have not translated my interest into investment advice.
  • [ ] I documented the query in a reproducible way.