Injective Data: Index Exchange Module Events, Orders, and Trades

Index Injective's onchain exchange module events, derivative orders, executions, positions, and transfers, delivered to your own database. Real-time and complete historical data, no node to run.


Injective is a high-performance layer one blockchain built for finance, with sub-second finality, built-in DeFi primitives, and native cross-chain interoperability. It runs on the Cosmos SDK and CometBFT, and its signature feature is an onchain exchange module: a native orderbook for spot and derivative markets that applications plug into instead of deploying their own matching contracts. Injective also supports CosmWasm contracts and an EVM layer whose precompiles reach into those native modules.

For indexing, that means the most valuable Injective data is not contract logs. It is the exchange module's own events: new orders, cancellations, batch executions, position updates, funding updates, and orderbook changes, emitted both inside transactions and at the block level. Indexing Co ingests Injective blocks with their transaction results and ABCI events and delivers the rows you shape to your PostgreSQL, warehouse, or webhook. See how the team frames it at injective.com.

Source Injective blocks
Ingest tx + block events
Decode exchange events
Transform your JavaScript
Deliver your database

Why Injective data is hard

The Exchange Lives in the Chain Orders, matches, and positions are handled by a native module, not by contracts you can point an ABI at. Trading data comes out as typed exchange events like EventNewDerivativeOrders and EventBatchDerivativeExecution, each with nested JSON payloads of orders, trades, and subaccounts.
Half the Action Is Block-Level Batch executions, funding updates, position snapshots, deposit updates, and orderbook changes are emitted in finalize_block_events, not only in transaction results. An index that reads tx results alone misses much of the market.
Versioned Event Types The exchange module currently emits each event under both injective.exchange.v1beta1 and injective.exchange.v2 type names. Count both and you double every trade. Your pipeline has to pick one and stay consistent.
Many Execution Paths Activity arrives through direct exchange messages, authz MsgExec wrappers, and CosmWasm contracts that emit their own wasm events, alongside an EVM layer. Attributing an order to the account and app behind it means following those paths.

What Indexing Co delivers for Injective

The DIY Path

Stand up and maintain the Injective indexing stack yourself.

  • Run an injectived node, or rent CometBFT RPC.
  • Fetch block and block_results for every height, at sub-second block times.
  • Parse nested exchange event payloads and dedupe v1beta1 and v2 types.
  • Build backfill, upgrade handling, and real-time delivery from scratch.
Indexing Co

Injective blocks, tx results, and events, shaped by you, delivered to your store.

  • Exchange module events from transactions and from finalize_block_events.
  • Transaction results with code, gas used, fees, and events.
  • Lands in your PostgreSQL, BigQuery, warehouse, or webhook.
  • Real-time delivery plus complete backfilled history. No node to run.

What you can index

Injective event type What it carries
injective.exchange.v2.EventNewDerivativeOrders, EventNewSpotOrders, EventCancelDerivativeOrder, EventOrderFail Market ID, buy and sell orders, subaccounts, cancellations, failures
injective.exchange.v2.EventBatchDerivativeExecution Market ID, trades, buy side, execution type, liquidation flag, cumulative funding
EventBatchDerivativePosition, EventPerpetualMarketFundingUpdate, EventOrderbookUpdate, EventBatchDepositUpdate (block level) Positions, funding rate and mark price, orderbook deltas, subaccount deposits
injective.oracle.v1beta1.EventOraclePriceUpdate, EventSetChainlinkDataStreamsPrices Oracle price updates
wasm, wasm-*, execute CosmWasm contract address and contract-defined attributes
transfer, coin_spent, coin_received, tx, message Token movements, fees, fee payer, message action

A transform, not a subgraph

You write the transform in JavaScript, not AssemblyScript, and change it without re-indexing from block zero. Indexing Co runs your function over each block server-side: read exchange events from both the tx results and the block-level events, keep one version, and return rows for your destination.

// Indexing Co transform: Injective exchange module events, from txs and block-level events
function transform(block) {
  const results = [];
  const height = Number(block.height);
  const time = block.block?.header?.time;
  const prefix = 'injective.exchange.v2.';

  const push = (event, source, txIndex) => {
    if (!event.type.startsWith(prefix)) return;
    const attrs = {};
    for (const a of event.attributes || []) attrs[a.key] = a.value;
    results.push({
      chain: block._network,
      block: height,
      block_time: time,
      source,
      tx_index: txIndex,
      event_type: event.type.slice(prefix.length),
      market_id: attrs.market_id ? JSON.parse(attrs.market_id) : null,
      payload: attrs,
    });
  };

  (block.txs_results || []).forEach((tx, i) => (tx.events || []).forEach((e) => push(e, 'tx', i)));
  (block.finalize_block_events || []).forEach((e) => push(e, 'finalize_block', null));
  return results;
}

Injective with Indexing Co

Run it yourself if

You want full control of Injective infrastructure and have the team to operate injectived at sub-second block times, parse exchange event payloads, and build backfill and delivery in-house.

Use Indexing Co if

You want Injective orders, executions, positions, funding, and transfers delivered to your own database, shaped by your transform, with real-time plus complete history and no node to run.

Get a DemoOpen the Console

Related Reading

FAQ

Do I need to run an Injective node?

No. Indexing Co sources Injective blocks and transaction results for you, including history, so you do not operate injectived or an archive node.

Can I index derivatives trades on Injective?

Yes. EventBatchDerivativeExecution carries the market ID and the executed trades, and EventBatchDerivativePosition and EventPerpetualMarketFundingUpdate carry positions and funding. Your transform flattens those payloads into rows.

Why do I see each exchange event twice?

The exchange module currently emits each event under both a v1beta1 and a v2 type name. Filter on one prefix, as the transform above does with injective.exchange.v2, to avoid double counting.

What about Injective's EVM layer?

Injective runs an EVM layer alongside its native modules. This page covers the CometBFT block data: transaction results and ABCI events, including the exchange module. If you need Solidity contract logs decoded against ABIs, talk to us about your contracts first.

Where does the Injective data go?

Into your own destination: PostgreSQL, BigQuery, a warehouse, or a webhook. You define the output schema and own the storage.

Get Started

Index Injective in minutes. Set up your first orders, trades, or transfers pipeline without running a node.

Get a DemoOpen the Console