Trades
Quote Buy
Stateless quote for buying $GOLD with USDC. Returns a partially-signed Solana transaction to co-sign and submit.
POST
Overview
Builds a buy transaction (USDC →$GOLD) and returns it partially-signed by GRAIL. The client must co-sign with the partner wallet and the user wallet, then either call Submit Buy or broadcast directly to a Solana RPC.
This endpoint is stateless — no database row is created at quote time. The Trade row is written by the indexer once the transaction confirms on-chain (confirmed or failed).
Headers
string
required
A valid
PARTNER scope key.Request Body
string
required
GRAIL user ID (prefixed
gu_). User must belong to the authenticated partner, be active, and have kyc_level: "full".number
required
USDC the user will spend, in human decimal (e.g.,
100 = 100 USDC). Must be positive.integer
Slippage tolerance in basis points. Default
50 (0.5%). Ignored if min_gold_out is provided.number
Absolute minimum
$GOLD to receive (human decimal). If supplied, overrides slippage_bps. If omitted, computed as quoted_gold * (10000 - slippage_bps) / 10000.Response
string
Trade identifier, prefixed
trd_. Use with Submit Buy and Get Trade.string
Always
"buy".object
string
Base64-encoded Solana transaction, already signed by GRAIL. Co-sign with partner + user and submit.
