Trades
Get Trade
Fetches a single trade by ID. Returns 404 until the indexer has written the row.
GET
Overview
Returns theTrade record for a trade_id. Because GRAIL’s indexer is the sole writer of trade rows, this endpoint returns 404 until the transaction has confirmed on-chain and been indexed (typically 10–15 seconds on devnet after submit).
Partner-scoped — returns 403 partner_mismatch if the trade belongs to a different partner.
Headers
A valid
PARTNER scope key.Path Parameters
Trade identifier (prefixed
trd_).Response
Trade identifier.
"buy" or "sell".Final status written by the indexer:
"confirmed" or "failed".USDC amount (input on buys, output on sells). For
failed trades, the value is from the transaction’s memo; the opposing side and fees are 0 because the on-chain program never computed them.$GOLD amount (output on buys, input on sells). Same caveat on failed trades.Gold price at the time the on-chain program executed.
Fee rate applied, in basis points.
Fee in USDC.
Solana transaction signature (base58).
ISO-8601 timestamp of row creation (when the indexer wrote the trade).
ISO-8601 timestamp of most recent update.
Errors
| HTTP | error | When |
|---|---|---|
| 401 | unauthorized | Missing or invalid x-api-key |
| 403 | partner_mismatch | Trade belongs to a different partner |
| 404 | trade_not_found | No trade row for this trade_id (often: indexer hasn’t caught up yet) |
