Skip to main content
POST
/
api
/
trading
/
purchases
/
partner
curl -X POST https://oro-tradebook-devnet.up.railway.app/api/trading/purchases/partner \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "goldAmount": 1.0,
    "maxUsdcAmount": 5500
  }'
{
  "success": true,
  "data": {
    "purchaseId": "uuid-purchase-id",
    "goldAmount": 1.0,
    "quoteUsdcAmount": 5086.20,
    "maxUsdcAmount": 5500,
    "quotedGoldPrice": 5086.2,
    "status": "pending_signature",
    "transaction": {
      "serializedTx": "base64-encoded-transaction",
      "signingInstructions": {
        "walletType": "PARTNER_AUTHORITY",
        "signers": ["ExecutiveAuthorityAddress"],
        "expiresAt": "2024-01-15T10:35:00.000Z"
      }
    },
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}

Overview

Creates a purchase transaction for the partner to buy gold tokens for their reserves (PDA). Authorization Required: PARTNER_EXECUTIVE_AUTHORITY

Headers

x-api-key
string
required
Your API key for authentication

Request Body

goldAmount
number
required
Amount of gold to purchase (in troy ounces)
maxUsdcAmount
number
required
Maximum USDC willing to spend (slippage protection)
metadata
object
Optional transaction metadata

Response

success
boolean
Whether the request was successful
data
object

Notes

Transaction Type

This endpoint returns a Legacy Transaction which is compatible with all wallet libraries.

Fund Flow

  • USDC is deducted FROM the partner’s PDA (centralVaultAddress)
  • Gold is deposited TO the partner’s PDA
  • Requires USDC to be pre-funded in the PDA

Signing

Only the executive authority wallet signs this transaction.
curl -X POST https://oro-tradebook-devnet.up.railway.app/api/trading/purchases/partner \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "goldAmount": 1.0,
    "maxUsdcAmount": 5500
  }'
{
  "success": true,
  "data": {
    "purchaseId": "uuid-purchase-id",
    "goldAmount": 1.0,
    "quoteUsdcAmount": 5086.20,
    "maxUsdcAmount": 5500,
    "quotedGoldPrice": 5086.2,
    "status": "pending_signature",
    "transaction": {
      "serializedTx": "base64-encoded-transaction",
      "signingInstructions": {
        "walletType": "PARTNER_AUTHORITY",
        "signers": ["ExecutiveAuthorityAddress"],
        "expiresAt": "2024-01-15T10:35:00.000Z"
      }
    },
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}