> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How the Stellar Indexer Works

> How Mobula's Stellar indexer works: supported environments, chain identifiers and address formats, coverage across tokens, transfers, DEX markets and wallet portfolios, the ingestion pipeline, and production latency.

A blockchain indexer continuously reads a chain's ledgers, decodes them, and turns them into structured, queryable data. Mobula's Stellar indexer converts XDR-encoded ledgers and Soroban contract events into normalized tokens, trades, prices, liquidity, transfers, and wallet balances — served over the same REST API and WebSocket streams as every other chain, so you never run a Stellar node or decode XDR yourself.

This page covers what's available, how ledgers are indexed, and the semantics you'll need to consume the data.

### Environments & identifiers

Both mainnet and testnet run in production.

| Environment | `chainId` / `blockchain` | Native asset     |
| ----------- | ------------------------ | ---------------- |
| Mainnet     | `stellar:stellar`        | XLM (7 decimals) |
| Testnet     | `stellar:testnet`        | XLM (7 decimals) |

**Address formats you'll pass to the API:**

* **Account** — `G…` (e.g. `GDHF3HIKWM5KJAVLZBSZWUFDOEOT7IBMY22UXG4QBE326O354INLPAND`)
* **Asset** — `CODE:ISSUER` (e.g. `AQUA:GBNZILSTVQZ4R7IKQDGHYGY2QXL5QOFJYQMXPKWRRM5PAV7Y4M67AQUA`)
* **Contract / market** — `C…` (e.g. `CBRUQ7I6C6OGHMDYWD6XQUZFB6KJ3LLPNE34EPKSPFZ2YMBJ2GIWYYZ7`)
* **Native XLM** is addressable as the sentinel `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`.

### What's available

| Category                     | Indexed                                                                                                                                 |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Tokens & metadata**        | Price, market cap, liquidity, supply, and socials                                                                                       |
| **Transfers & transactions** | Classic payments and Soroban token movements, unified through the CAP-67 event model                                                    |
| **DEX markets**              | Aquarius (constant-product, stableswap, concentrated), Soroswap, and the classic AMM — per-market reserves, volume, trades, and pricing |
| **Wallet portfolios**        | Holdings, decoded activity feeds, and historical net worth for any `G…` account                                                         |

<Note>
  Not covered on Stellar: swap **quote/execution routing** (read-only DEX data only) and **NFT holdings**.
</Note>

### Indexing

A dedicated Stellar listener ingests every ledger as it closes. One ledger maps 1:1 to a block and is processed in order — there's no shard or slot reconciliation — so trades, transfers, and pool state are decoded and served within about one ledger of the network.

Stellar also differs from most chains in how its data is exposed: rather than a single archive node serving everything, its RPC retains only a short window of recent ledgers. Mobula reads from both source types:

* **Real-time** — new ledgers are read from Stellar RPC as they close.
* **Historical** — because RPC retention is short, earlier ledgers are backfilled from Horizon and other archival providers.

**Latency (production, mainnet):** head lag p50 ≈ 5.3 s, p95 ≈ 7.0 s — roughly one Stellar ledger period (\~5.6 s), i.e. the listener sits at live tip.

Every ledger is indexed in sequence — no sampling, no gaps — and because Stellar ledgers are final on close (no reorgs), indexed data is never reverted.

### Working with Stellar data

A few Stellar-specific semantics to know before you consume the API:

| Concept            | What to know                                                                                                                                                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Asset identity** | The same asset can appear as `CODE:ISSUER` (classic), its Soroban contract / SAC (`C…`), or `native` (XLM). All resolve to one canonical asset — query by any form. |
| **Muxed accounts** | Muxed addresses (`M…`) are resolved to their underlying account address (`G…`).                                                                                     |
| **Units**          | XLM and most Stellar assets use **7 decimals** (stroops). Amounts are returned both human-readable and raw.                                                         |
| **Ordering**       | Data is ordered by ledger sequence and application order within a ledger, matching on-chain execution.                                                              |

### Your first call

Fetch metadata for a Stellar asset — nothing to set up beyond the request:

**Using cURL**:

```bash theme={null}
curl -X GET "https://api.mobula.io/api/1/metadata?asset=AQUA:GBNZILSTVQZ4R7IKQDGHYGY2QXL5QOFJYQMXPKWRRM5PAV7Y4M67AQUA&blockchain=stellar:stellar"
```

```json theme={null}
{
  "data": {
    "name": "Aquarius",
    "symbol": "AQUA",
    "decimals": [7],
    "price": 0.000338,
    "liquidity": 1086674.84,
    "market_cap": 12147718.70
  }
}
```

An API key from the [Dashboard](https://admin.mobula.io) is required for production use (the API is usable without a key in development).

### Next steps

* **[How to Use Stellar Data](/guides/how-to-use-stellar-data)** — a tutorial covering historical transaction lookups, token liquidity insights, contract interaction data, and real-time streams.
* **[Stellar API Reference](/blockchains/stellar)** — full endpoint list, chain identifiers and address formats.

### Need Help?

Our support team is available to assist with your queries or integration issues.

<CardGroup>
  <Card title="Support" icon="Telegram" href="https://t.me/mobuladevelopers">
    Telegram
  </Card>

  <Card title="Support" icon="Slack" href="https://join.slack.com/t/mobulaapi/shared_invite/zt-29zrrpjnl-I0tyD73sy7zKy8q~KLL3Ug">
    Slack
  </Card>

  <Card title="Support" icon="Discord" href="https://discord.gg/JVT7xKm3AD">
    Discord
  </Card>

  <Card title="Email Support" icon="envelope" href="mailto:contact@mobulalabs.org">
    Email
  </Card>
</CardGroup>
