Web3 IMPT
Web3 IMPT / Articles / Consuming IMPT Retirements via Subgraph: ESG Team Guide

On-Chain Carbon Infrastructure

Consuming IMPT Retirements via Subgraph: ESG Team Guide

Published 2026-05-09 by the Web3 IMPT editors

Direct answer

Corporate ESG teams consume IMPT retirement data by querying a Graph Protocol subgraph that indexes Polygon smart contract events. The subgraph exposes GraphQL endpoints for retirement entities, booking metadata, and tonne-level carbon accounting—enabling real-time dashboards, compliance reporting, and programmatic verification without running a full node.

\n\n

Why Subgraphs Matter for On-Chain ESG Accounting

\n\n

Traditional carbon accounting relies on quarterly spreadsheets, PDF certificates, and email chains. When retirements happen on-chain—especially at the scale IMPT operates—ESG teams need a cryptographically verifiable, queryable data layer that doesn't require managing Polygon RPC infrastructure or parsing raw event logs.

\n\n

The Graph Protocol solves this. A subgraph is an open-source indexing layer that listens to smart contract events, transforms them into queryable entities, and exposes a GraphQL API. For a corporate sustainability team tracking hundreds or thousands of hotel bookings across Dublin, Cork, Galway, and beyond, this means real-time access to retirement proofs, carbon tonne totals, and booking metadata—without writing a single eth_getLogs call.

\n\n

IMPT's carbon mechanic is straightforward: 1 tonne of UN-verified CO₂ retired on-chain per booking—28× the average per-night hotel footprint. IMPT funds it from its commission, so the guest pays the standard nightly rate. Every retirement emits an event on Polygon; the subgraph indexes it; your ESG dashboard queries it.

\n\n

Subgraph Architecture: Entities, Mappings, and Schemas

\n\n

A typical IMPT subgraph defines three core entities:

\n\n\n\n

The subgraph manifest (subgraph.yaml) specifies which smart contract to track, which events to listen for (e.g., CarbonRetired, BookingLinked), and which AssemblyScript mapping functions to execute when those events fire. Mapping functions parse event parameters, instantiate entities, and save them to the subgraph store.

\n\n

Example Mapping: CarbonRetired Event

\n\n

When IMPT's retirement contract emits a CarbonRetired event, the subgraph mapping extracts the transaction hash, wallet address, tonne amount, and UN project ID, then creates a new Retirement entity. A second handler listens for BookingLinked, which associates the retirement with a specific hotel reservation—critical for ESG teams auditing trips to Limerick or Killarney.

\n\n

This two-step indexing ensures that every retirement is both cryptographically anchored (via transaction hash) and contextually rich (via booking metadata).

\n\n

Querying the Subgraph: GraphQL Patterns for ESG Teams

\n\n

Once deployed to The Graph's hosted service or decentralized network, the subgraph exposes a public GraphQL endpoint. Corporate ESG analysts can query it directly from a browser, Jupyter notebook, or internal dashboard.

\n\n

Query 1: Total Retirements for a Corporate Account

\n\n

To fetch aggregate retirement data for a specific enterprise wallet:

\n\n
\n
\n{\n  corporateAccount(id: "0xYourWalletAddress") {\n    totalTonnes\n    totalBookings\n    retirements(first: 100, orderBy: timestamp, orderDirection: desc) {\n      id\n      tonnes\n      timestamp\n      project\n      serialNumber\n    }\n  }\n}\n
\n
\n\n

This returns a rolling list of the 100 most recent retirements, each with a unique serial number traceable to the UN registry. For compliance teams preparing Scope 3 disclosures, this query becomes a single API call replacing weeks of manual CSV reconciliation.

\n\n

Query 2: Retirements Filtered by Location

\n\n

To isolate retirements tied to Irish hotel stays—useful for regional sustainability reports:

\n\n
\n
\n{\n  bookings(where: { hotelLocation_contains: "Ireland\