Skip to main content
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).
The partial-signed transaction expires in ~60 seconds (Solana recentBlockhash TTL). If you take too long to co-sign and submit, you’ll get broadcast_failed: Blockhash not found. Re-quote.

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.

Errors