Endpoint & subscription
Connect, send a subscription, get an acknowledgment (
"event": "subscribed"), then matching events as ledgers close. Ignore {"event":"ping"} keepalives, and unsubscribe with {"type":"unsubscribe","authorization":"YOUR_API_KEY","payload":{"subscriptionId":"..."}}. Multiple subscriptions share one socket; the subscriptionId echoed on every frame routes each event back to the subscription that matched it.
Filters run server-side; operators are eq, neq, lt, lte, gt, gte, in, nested with and / or — see the filters reference.
Stellar address forms
Five address forms appear in the frames, and casing matters in filters:Swaps
Stream every swap
amount0/amount1 are decimal-adjusted deltas — positive is what the trader paid into the pool, negative is what they received — with rawAmount0/rawAmount1 as the on-ledger integers and amountUSD/priceUSDToken0/priceUSDToken1 pre-computed. transactionSenderAddress is the trading account, and transactionSwapsCount tells you how many legs the transaction has (path payments produce several).
Swaps on one pool
Classic AMM market — lowercaselp: form:
C… contracts — same filter, uppercase address:
Swaps over $100 on one pool
and an amount threshold onto the pool:
Swaps by venue
All classic-AMM trades — works the same withsoroswap, aquarius, aquarius-stable, aquarius-concentrated:
A wallet’s trades
Swaps identify the trader astransactionSenderAddress:
Transfers
Stream every transfer
transactionFrom/transactionTo are the envelope-level source and destination accounts; from/to are the transfer leg itself — a G… account, a C… contract, an lp: pool, or the zero address on mints and burns. contract is the asset moved and amount is the raw on-ledger integer — divide by 10⁷ for XLM and classic assets. transactionFees is in stroops.
A wallet’s transfers, both directions
Transfers filter on the envelope fields —or the two directions:
All movements of one token
Native XLM via the sentinel — or any classic asset by itsCODE:ISSUER:
Whale transfers — 1,000+ XLM
Raw units: 1,000 XLM = 10¹⁰ stroops. In live testing this caught a 22,500 XLM movement within seconds:Filter on the right wallet field per event type. It’s
transactionSenderAddress on swaps but transactionFrom/transactionTo on transfers — they are not interchangeable. The transfer leg fields from/to (and swapSenderAddress on swaps) appear in every frame for client-side use but do not match in server-side filters.Putting it together — a pool watcher
Big-swap alerts on one market plus an XLM whale feed, on a single socket. Runs as-is with Node 22+ or Bun:Going further
- Testnet — same endpoint,
chainIds: ["stellar:testnet"]. - Alerting — pipe the handler into a Telegram or Discord webhook; see Build a Telegram buy bot for the pattern.
- Reference — Swaps stream, Transfers stream, filters, How the Stellar indexer works, How to use Stellar data.