Skip to main content

Stellar Trades API

Analyze Stellar DEX trade effects — prices, buy/sell amounts, asset issuers, and counterparties — through the Bitquery GraphQL API.

What are Stellar Trade Effects?

Trade effects are ledger-level records generated by successful operations on the Stellar DEX. Each record captures the buy and sell asset pair, amounts exchanged, the price ratio, and the counterparty accounts.

Getting Started

New to Bitquery? Here's how to get started:

  1. Create a free account - Get instant access to our GraphQL IDE
  2. Generate your Access token - Required for API access

Need help crafting a query or subscription? Message us on support.

Get Stellar Trade Effects for a Token by Buy Currency

Retrieve DEX trade effects for a given token by filtering on buyCurrencyName. The priceAmount field returns the sell-per-buy asset ratio for precise pricing, and aliased fields like sell_amount_usd convert values to USD. Run the query on the IDE.

Variations: Replace buyCurrencyName with sellCurrencyName to filter by the sell side, widen the time window for longer lookbacks, or add a sellCurrency filter to isolate a specific trading pair.

query {
stellar(network: stellar) {
tradeEffects(
options: { desc: "block", asc: "transaction.index", limit: 10, offset: 0 }
time: { since: "2025-11-24T01:05:00.000Z", till: "2025-11-25T13:35:00.999Z" }
buyCurrencyName: { is: "AQUA [GBNZILSTVQZ4R7IKQDGHYGY2QXL5QOFJYQMXPKWRRM5PAV7Y4M67AQUA]" }
) {
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
}
block
transaction {
hash
index
}
sellAmount
sell_amount_usd: sellAmount(in: USD)
sellCurrency {
symbol
name
}
sellIssuer {
address
annotation
}
buyAmount
priceAmount
buy_amount_usd: buyAmount(in: USD)
buyCurrency {
symbol
name
}
buyIssuer {
address
annotation
}
}
}
}

Get Latest Stellar Trade Effects with Full Trade Details

Fetch the most recent trade effects across the entire Stellar DEX, covering seller address, buy/sell currencies and issuers, price ratio, and operation type. Run the query on the IDE.

Variations: Add a buyCurrency or sellCurrency filter to focus on one asset, raise limit for deeper history, or include an address filter to follow a single trader's activity.

query MyQuery {
stellar(network: stellar) {
tradeEffects(
date: {is: "2024-07-17"}
options: {limit: 10, desc: "timestamp.time"}
) {
address {
address
}
effectIndex
buyIssuer {
address
}
buyCurrency {
name
address
}
buyAmount
sellAmount
priceAmount
order
operation {
name
}
seller {
address
}
sellIssuer {
address
}
sellCurrency {
name
address
}
timestamp {
time
}
}
}
}