mantle/mantle-data-indexer
mantle-data-indexer
mantletechnical-doc🏛️ Officialconfidence highhealth 100%
v1.0.0·by mantle-xyz·Updated 4/14/2026
Overview
Use GraphQL or SQL indexers to answer historical questions on Mantle with reproducible queries, clear time boundaries, and source attribution.
Workflow
- Normalize request:
- objective (for example volume, swaps, user history)
- entities (wallet, pool, token, protocol)
- time range (absolute UTC start/end). If the user provides relative times like "past 7 days" or "last month", convert them to absolute UTC timestamps (e.g., "2026-03-18T00:00:00Z to 2026-03-25T00:00:00Z") and state the conversion explicitly.
- Resolve endpoint availability:
mantle-cli indexer subgraph --endpoint <url> --query <graphql> --jsonrequires an endpoint URL + query.mantle-cli indexer sql --endpoint <url> --query <sql> --jsonrequires an endpoint URL + query.- If endpoint config is missing, STOP and use the Blocked Output Format below. Do NOT proceed to step 3.
- WRONG: making up a URL like
https://api.thegraph.com/subgraphs/name/mantle-...orhttps://indexer.mantle.xyz/.... - RIGHT: responding with the Blocked Output Format and asking the user to provide the endpoint.
- In E2E
endpoint-configuredscenarios, skip whenE2E_SUBGRAPH_ENDPOINTorE2E_SQL_ENDPOINTis unset.
- Select source by availability and latency target:
- GraphQL indexer ->
mantle-cli indexer subgraph --endpoint <url> --query <graphql> --json - SQL indexer ->
mantle-cli indexer sql --endpoint <url> --query <sql> --json
- GraphQL indexer ->
- Build query from
references/query-templates.md. - Execute with pagination and deterministic ordering.
- Normalize units and decimals before aggregation.
- Produce output with query provenance, tool warnings, and caveats.
Guardrails
- Confirm chain scope is Mantle before querying.
- Use absolute timestamps and include timezone (
UTC). - Do not invent endpoint URLs. If missing, report blocked input and request an endpoint.
- Keep SQL read-only; avoid mutation statements.
- Do not merge datasets with mismatched granularity without labeling.
- Distinguish
no datafromquery failure. - Propagate tool warnings (for example
hasNextPage=trueor SQL truncation). - If indexer lag is known or suspected, disclose it.
Output Format
Mantle Historical Data Report
- objective:
- source_type: graphql | sql
- source_endpoint:
- queried_at_utc:
- time_range_utc:
- entity_scope:
Query Summary
- dataset_or_subgraph:
- filters_applied:
- pagination_strategy:
- records_scanned:
Results
- metric_1:
- metric_2:
- sample_rows:
Quality Notes
- indexer_lag_status:
- tool_warnings:
- assumptions:
- caveats:
- confidence:
Blocked Output Format
When the workflow cannot proceed (for example, no endpoint URL was provided), you MUST still use a structured output. NEVER fabricate an endpoint URL. Instead, use this format:
Mantle Historical Data Report -- BLOCKED
- objective:
- status: blocked
- blocked_reason: [explain exactly what is missing, e.g. "No GraphQL or SQL endpoint was provided"]
- action_required: [what the user must supply, e.g. "Provide a subgraph endpoint URL or SQL indexer endpoint URL"]
- time_range_utc: [convert any relative time to absolute UTC, e.g. "2026-02-23T00:00:00Z to 2026-03-25T00:00:00Z"]
- entity_scope:
Quality Notes
- tool_warnings: Endpoint missing -- cannot execute query. This is NOT a "no data" result; it is a configuration gap.
- assumptions: none
- caveats: No query was executed. Results will be available once an endpoint is provided.
- confidence: n/a
CRITICAL: If the user does not provide an endpoint URL and you do not have one configured, you MUST use the blocked format above. Do not guess, fabricate, or assume any endpoint URL.
References
references/indexer-selection-and-quality.mdreferences/query-templates.md