Skip to main content
This tutorial shows how to access Stellar data through the Mobula API — REST endpoints, real-time WebSocket streams, and the TypeScript SDK — across four common needs: historical transaction lookups, token liquidity insights, contract interaction data, and live market streams. Every example is a live Stellar request, and MTT (open source) renders it all live.

What you can build

  • Trading bots & terminals — stream live trades and market depth, then execute off your own signals.
  • Portfolio & tax tools — reconstruct an account’s full history and current holdings.
  • Analytics dashboards — track liquidity, volume, and holder distribution per market.
  • Price & liquidity alerts — subscribe to streams and react to moves as ledgers close.
  • New-launch monitors — surface newly created Stellar pairs the moment they’re indexed and move first.
  • Telegram & Discord bots — forward live trades, price moves, and new pairs straight to a channel.
  • Compliance & reconciliation — resolve any transfer or swap by transaction hash.

What you’ll need

  1. A Stellar asset (CODE:ISSUER), a transaction hash, or a G… account.
  2. The chain identifier stellar:stellar (mainnet) or stellar:testnet.
  3. An API key from the Dashboard.
Base URLs & keys. The REST examples below use https://api.mobula.io and also run without a key on https://demo-api.mobula.io for quick evaluation. WebSocket streams always require an API key in the authorization field.

What Stellar supports

Mobula indexes Stellar on mainnet (stellar:stellar) and testnet (stellar:testnet), covering tokens, transfers, DEX markets (Aquarius, Soroswap, and the classic AMM), and wallet portfolios. Swap quote/execution routing and NFT holdings are not covered. Full per-network reference — chain identifiers, address formats, and every supported endpoint:

What to use for what


1. Historical transaction lookups

Use these when you need to resolve a specific transaction, reconstruct a token’s trade timeline, or pull an account’s full history. Add limit (and offset) to page through large result sets. Look up a single swap by transaction hash — for support, compliance or reconciliation:
Page a token’s trade history — newest first:
Pull an account’s transaction ledger — the full history for a G… account:

2. Token liquidity insights

Use these to rank venues by depth, monitor liquidity migrations across DEXes, or screen out thin pools. List an asset’s markets — reserves, 24h volume and price per venue (Aquarius, Soroswap, classic AMM):
Each market entry also carries bucketed volume, trade and trader counts (1min24h), price-change percentages, fees paid and holder-distribution metrics. Get token-level liquidity & market cap — a single aggregated figure:

3. Contract interaction data

Use this to build an account activity timeline mixing classic payments and Soroban contract calls, or to attribute value flows to specific contracts and counterparties. Fetch decoded account activity — transfers, swaps and vault operations per transaction:
Each transaction’s actions array is a decoded view of the interaction: transfer (value movements), swap (DEX trades) and vault (deposit/withdraw) models. Transaction-level fields (txBlockNumber = ledger sequence, txIndex = application order) let you order and reconcile activity exactly as it appears on-chain.

4. Live market streams

Use these to power live charts, trading terminals, and price or liquidity alerts — updates are pushed as ledgers close, so you never poll. All Stellar markets and tokens stream over wss://api.mobula.io; pass blockchain: "stellar:stellar" in the subscribe payload. Every subscribe payload must include your API key in the authorization field — streams reject unauthenticated connections. Connect and subscribe:
Subscribe to live trades on a Stellar market:
Subscribe to live market details for a Stellar pool:
Token Details and OHLCV follow the same connection pattern — set blockchain to stellar:stellar and see each stream’s reference for its payload fields. Be a first mover — stream newly launched Stellar pairs: Scope Pulse to stellar:stellar and sort by created_at to receive new pairs the moment they’re indexed.

5. Build with the SDK

The @mobula_labs/sdk wraps every endpoint above with typed methods and defaults to demo-api.mobula.io, so it works without a key for evaluation.
The same typed methods power MTT — Mobula’s open-source trading terminal and a full reference implementation that renders Stellar tokens live:

XSOLVBTC on MTT

mtt.gg/token/stellar:stellar/CAUP7NFA…772J — live chart, trades, liquidity and holders, all served by the endpoints on this page.
Source: github.com/MobulaFi/MTT.

Use cases in practice

Each use case is just a few of the calls above combined. A few worked examples: Portfolio tracker — an account’s current holdings plus its decoded activity feed:
Token dashboard — valuation, per-venue liquidity, and recent trades for one token:
New-launch monitor (first mover) — stream freshly created pairs, then pull each one’s liquidity to filter:
Live trading terminal — snapshot with REST, then keep it live over a stream:
Telegram bot — push new-pair or price alerts to a channel:
See the full build in Build a Telegram Buy Bot — the same pattern, pointed at stellar:stellar.

Need Help?

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

Support

Telegram

Support

Slack

Support

Discord

Email Support

Email