Trades
Quote Sell
Stateless quote for selling $GOLD for USDC. Returns a partially-signed Solana transaction to co-sign and submit.
POST
Overview
Builds a sell transaction ($GOLD → USDC) and returns it partially-signed by GRAIL. The client must co-sign with the partner wallet and the user wallet, then either call Submit Sell or broadcast directly to a Solana RPC.
Stateless — no database row is created at quote time. The Trade row is written by the indexer once the transaction confirms on-chain.
Headers
A valid
PARTNER scope key.Request Body
GRAIL user ID (prefixed
gu_). User must belong to the authenticated partner, be active, and have kyc_level: "full".$GOLD the user will sell, in human decimal. Must be positive.Slippage tolerance in basis points. Default
50 (0.5%). Ignored if min_usdc_out is provided.Absolute minimum USDC to receive (human decimal). If supplied, overrides
slippage_bps.Response
Trade identifier, prefixed
trd_.Always
"sell".Base64-encoded Solana transaction, signed by GRAIL. Co-sign with partner + user and submit.
Errors
Same error set as Quote Buy:invalid_request, kyc_level_insufficient, onchain_config_missing, wallet_missing, partner_mismatch, user_suspended, user_not_found, pricing_unavailable.
