> For the complete documentation index, see [llms.txt](https://chusdrter.gitbook.io/stellar-trade-processor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chusdrter.gitbook.io/stellar-trade-processor/what-is-stellar-trade-processor.md).

# What is Stellar Trade Processor

Stellar Trade Processor is a Go library that reads Stellar ledger data and produces standardized trade events from it. It handles three kinds of trade: classic DEX offer fills (from `ManageSellOffer`, `ManageBuyOffer` and `CreatePassiveSellOffer`), path payments (`PathPaymentStrictSend` and `PathPaymentStrictReceive`, one event per hop), and Soroban AMM swaps, which in v1 means Soroswap. Whatever the venue, you get the same struct back: `event.TradeEvent`, with the assets, the amounts, the price, the accounts involved, and where in the chain it happened. A small CLI ships with it for people who want JSON lines rather than a Go dependency.

It is a sibling to Stellar's official [Token Transfer Processor](https://github.com/stellar/go-stellar-sdk/tree/main/processors/token_transfer) (TTP), which does the equivalent job for token transfers: TTP turns payments, mints, burns and clawbacks into one standardized transfer event, and this package does the same for trades. The conventions are deliberately the same as the `go-stellar-sdk` ingest SDK. Ledgers arrive from a `ledgerbackend.LedgerBackend`, transactions are read with `ingest.LedgerTransactionReader`, and processing a ledger means walking its transactions and handing each one to a transformer.

The whole package is a library plus a thin CLI. There is no database, no server, no hosted API, and no UI. You decide where the events go by implementing one interface with two methods.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://chusdrter.gitbook.io/stellar-trade-processor/what-is-stellar-trade-processor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
