midnight-indexer:indexer-data-model

Map on-chain data into relational database tables for GraphQL analytics.

37|9|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-indexer-indexer-data-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: midnight-indexer:indexer-data-model
Source: https://github.com/devrelaicom/midnight-expert/tree/main/plugins/midnight-indexer/skills/indexer-data-model
Command: npx skills add https://github.com/devrelaicom/midnight-expert --skill midnight-indexer-indexer-data-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Midnight indexer collects and stores on-chain data in a relational database, enabling fast, flexible analytics and reliable data access for downstream apps.

Core Features & Use Cases

  • Data coverage: blocks, transactions, contract actions, contract balances, unshielded UTXOs, ledger events, DUST generation, system parameters, and SPO data.
  • Database schema and relationships: core tables, contract tables, token/UTXO tables, wallets, and governance structures with clear entity links.
  • Use cases: analytics dashboards, governance reporting, contract lifecycle tracing, and cross-entity queries across blocks, events, and assets.

Quick Start

Run a sample query against the indexer's GraphQL API to fetch blocks and related entities for a specific block height.

Frequently Asked Questions about midnight-indexer:indexer-data-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Midnight blockchain data for analytics using GraphQL?

You query Midnight blockchain data by mapping on-chain records into a relational database and accessing them through a GraphQL API. This enables fast, flexible queries across blocks, transactions, contract actions, and ledger events for analytics dashboards.

What on-chain entities are covered by the Midnight indexer data model?

The Midnight indexer data model covers blocks, transactions, contract actions, contract balances, unshielded UTXOs, ledger events, DUST generation, system parameters, and SPO data. These entities are structured in core tables with clear relationships for cross-entity querying.

How does the indexer lifecycle process block finalization to events?

The indexer lifecycle processes data from block finalization through to event processing, systematically mapping finalized on-chain data into relational database tables. This structured pipeline ensures reliable data access for downstream applications.

Can I trace contract lifecycles and governance structures using this indexer schema?

Yes, the indexer schema defines contract tables, token and UTXO tables, wallets, and governance structures with clear entity links. You can trace contract lifecycles and generate governance reporting by querying these related database tables.

What is the best way to run a sample query against the Midnight indexer?

The best way to start is running a sample query against the indexer's GraphQL API to fetch blocks and related entities for a specific block height. This allows you to verify data coverage and relationships across the relational schema.

Do I need a relational database setup to use the Midnight indexer for analytics?

Yes, the Midnight indexer requires a relational database to store on-chain data. It maps blocks, transactions, balances, and ledger events into core tables to enable fast queries and reliable data access for downstream apps.