Introduction
The Oro TradeBook API provides distribution partners with a convenient interface to integrate with the Oro Gold ecosystem. The API abstracts Solana blockchain complexity while providing full access to the on-chain TradeBook program for gold token trading and user management.Base URL
Authentication
All endpoints (except public ones like/health and /api/trading/gold/price) require API key authentication via the x-api-key header:
API Key Scopes
| Scope | Description |
|---|---|
ADMIN | System admin operations (partner creation) |
PARTNER_EXECUTIVE_AUTHORITY | Trading operations (buy, sell, user creation) |
PARTNER_UPDATE_AUTHORITY | Partner settings updates |
PARTNER_WITHDRAWAL_AUTHORITY | Withdrawal operations |
Getting an API Key
- Call
POST /api/auth/challengewith your wallet address - Sign the challenge message with your wallet
- Call
POST /api/auth/api-keywith the signature
Partner Types
Custodial
Partner manages user funds. Users don’t have wallets - the partner holds gold on their behalf.Self-Custody
Users control their own wallets. Partner facilitates transactions but users sign and own their assets.Transaction Flow
Most operations return a serialized transaction that needs to be signed before submission:Signing Instructions
Each transaction response includes:Key Concepts
Partner PDA (Central Vault)
Each partner has a Program Derived Address (PDA) that holds their trading funds (USDC and Gold). This is thecentralVaultAddress returned when creating a partner.
- Partner purchases: USDC from PDA → Gold to PDA
- Partner sales: Gold from PDA → USDC to PDA
- Withdrawals: Funds from PDA → Destination wallet
User PDA
Each user has a compressed account (PDA) that tracks their KYC hash and balances.Gold Pricing
Gold prices are sourced from Pyth Network oracle for real-time market data. Use the/api/trading/gold/price endpoint to get current prices.
Rate Limits
- Authentication endpoints: 1 request per second
- Trading endpoints: Standard rate limits apply
Error Handling
All errors return a consistent format:400- Bad request (invalid parameters)401- Unauthorized (missing or invalid API key)403- Forbidden (insufficient permissions)404- Not found500- Internal server error
API Groups
Authentication
API key management - create, list, and revoke keys
Distribution
Partner management - create and configure partners
Users
User management - create and query users
Trading
Trading operations - buy, sell, withdraw gold
Transactions
Submit signed transactions to Solana
General
Health checks and system status
