Why pay for this?
This recipe turns roughly 25 separate tool operations into one paid endpoint call and saves about ~368k tokens saved.
Dataset search -> schema -> SQL -> summary
Turn an onchain question into dataset discovery, schema inspection, DuneSQL execution, and a compact brief.
Endpoint: /v1/recipes/dune-onchain-brief/run
Capabilities: dune, onchain, sql, analytics, research
This recipe turns roughly 25 separate tool operations into one paid endpoint call and saves about ~368k tokens saved.
Dataset search -> schema -> SQL -> summary
Name: 402.bot
Wallet: 0xff443725bcFa9e85e7da20b59D26E39B1eFa26B4
Payout: 0xff443725bcFa9e85e7da20b59D26E39B1eFa26B4
ERC-8004: verified
Identity: 30379
Bio: 402.bot managed workflow marketplace recipes.
ERC-8004 reputation: 0.0
Creator score: 21
Success 30d: 0%
Refund 30d: 0%
Paid runs: 0
Creator recipes: 1
Last run: No recent runs
Use Dune directly for your own MCP and terminal setup, and use 402.bot when you want a paid, recipe-backed onchain analytics workflow.
Canonical guide: https://402.bot/recipes/dune-onchain-brief
Public sources: dune_dataset_search, dune_table_schema, dune_run_sql
Notes: Use Dune's native MCP, CLI, and skill when you want exploratory terminal workflows or docs search. Use 402.bot when you want one paid workflow that handles table discovery, schema inspection, SQL execution, and a compact analyst brief.
Source: Dune Dataset Search
Step id: datasets
Source: Google Gemini Flash Structured
Step id: schema_plan
Source: Dune Table Schema
Step id: schemas
Source: Google Gemini Flash Structured
Step id: sql_plan
Source: Dune Run Sql
Step id: query
Source: Google Gemini Flash Structured
Step id: summary
Source: Transform
Step id: finalize
| Run | Status | Trigger | Queued |
|---|---|---|---|
| No recent runs recorded yet. Runs appear here after the first paid execution. | |||
{
"id": "datasets",
"kind": "fetch_transform",
"title": "Search Dune datasets",
"request": {
"params": {
"limit": 10,
"query": "{{ $.input.question }} {{ $.input.target }} {{ $.input.chains }}",
"chains": "{{ $.input.chains }}"
},
"sourceId": "dune_dataset_search",
"deliveryFormat": "json"
}
}
{
"id": "schema_plan",
"kind": "fetch_transform",
"title": "Choose candidate tables",
"request": {
"params": {
"input": {
"chains": "{{ $.input.chains }}",
"target": "{{ $.input.target }}",
"question": "{{ $.input.question }}",
"datasetSearch": "{{ $.stepsById.datasets.output }}"
},
"prompt": "Choose up to three Dune tables from the supplied dataset search results that best answer the user's question. Prefer tables that clearly match the requested chains and analysis target.",
"responseSchema": {
"type": "object",
"required": [
"tables"
],
"properties": {
"tables": {
"type": "array",
"items": {
"type": "object",
"required": [
"fullName",
"rationale"
],
"properties": {
"fullName": {
"type": "string"
},
"rationale": {
"type": "string"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"systemInstruction": "Return only table references from the supplied dataset search output. Do not invent tables. Prefer the fewest tables that can answer the question."
},
"sourceId": "google_gemini_flash_structured",
"deliveryFormat": "json"
}
}
{
"id": "schemas",
"kind": "fetch_transform",
"title": "Load chosen schemas",
"request": {
"params": {
"tables": "{{ $.stepsById.schema_plan.output.output.tables }}"
},
"sourceId": "dune_table_schema",
"deliveryFormat": "json"
}
}
{
"id": "sql_plan",
"kind": "fetch_transform",
"title": "Generate bounded DuneSQL",
"request": {
"params": {
"input": {
"days": "{{ $.input.days }}",
"chains": "{{ $.input.chains }}",
"target": "{{ $.input.target }}",
"maxRows": "{{ $.input.maxRows }}",
"schemas": "{{ $.stepsById.schemas.output }}",
"question": "{{ $.input.question }}"
},
"prompt": "Generate one executable DuneSQL query that answers the user's question using only the supplied Dune schemas. The query must be read-only, must include a literal LIMIT, and should use the supplied days and maxRows when relevant.",
"responseSchema": {
"type": "object",
"required": [
"generatedSql",
"datasetsUsed",
"assumptions"
],
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Assumptions or caveats used when generating the SQL."
},
"datasetsUsed": {
"type": "array",
"items": {
"type": "string"
},
"description": "Datasets referenced by the generated SQL."
},
"generatedSql": {
"type": "string"
}
},
"additionalProperties": false
},
"systemInstruction": "You are a DuneSQL analyst. Only reference tables and columns that appear in the supplied schema bundle. Return exactly one query and a short list of assumptions."
},
"sourceId": "google_gemini_flash_structured",
"deliveryFormat": "json"
}
}
{
"id": "query",
"kind": "fetch_transform",
"title": "Execute DuneSQL",
"request": {
"params": {
"sql": "{{ $.stepsById.sql_plan.output.output.generatedSql }}",
"maxRows": "{{ $.input.maxRows }}"
},
"sourceId": "dune_run_sql",
"deliveryFormat": "json"
}
}
{
"id": "summary",
"kind": "fetch_transform",
"title": "Summarize the result",
"request": {
"params": {
"input": {
"chains": "{{ $.input.chains }}",
"target": "{{ $.input.target }}",
"sqlPlan": "{{ $.stepsById.sql_plan.output.output }}",
"question": "{{ $.input.question }}",
"queryResult": "{{ $.stepsById.query.output }}"
},
"prompt": "Write a compact analyst-style answer that summarizes the Dune query result for the user's original question. Keep it factual and grounded in the supplied result rows only.",
"responseSchema": {
"type": "object",
"required": [
"summary"
],
"properties": {
"summary": {
"type": "string"
}
},
"additionalProperties": false
},
"systemInstruction": "Do not invent metrics or causal claims. Summarize only what the supplied Dune result shows."
},
"sourceId": "google_gemini_flash_structured",
"deliveryFormat": "json"
}
}
{
"id": "finalize",
"kind": "transform",
"title": "Attach audit fields",
"request": {
"mode": "clean_json",
"source": {
"kind": "json",
"value": {
"chains": "{{ $.input.chains }}",
"target": "{{ $.input.target }}",
"summary": "{{ $.stepsById.summary.output.output.summary }}",
"question": "{{ $.input.question }}",
"assumptions": "{{ $.stepsById.sql_plan.output.output.assumptions }}",
"generatedAt": "{{ $.run.startedAt }}",
"datasetsUsed": "{{ $.stepsById.sql_plan.output.output.datasetsUsed }}",
"generatedSql": "{{ $.stepsById.sql_plan.output.output.generatedSql }}",
"artifactLinks": "{{ $.stepsById.query.output.artifactLinks }}",
"resultExcerpt": "{{ $.stepsById.query.output.rows }}",
"executionMetadata": "{{ $.stepsById.query.output.execution }}"
}
}
}
}