Trading
Trading Domain
The trading domain handles order management, trade execution, and OTC workflows.
Trading Venues
*Stop and Stop Limit orders are created by adding stopParams to a Limit or Market order. See OTC Trading.
Order Lifecycle
Key Concepts
Pair Constraints
Every order must respect the pair’s constraints:
Side
Exchange Trading
Exchange trading uses a central limit order book where orders are matched automatically.
Exchange Order Types
Exchange Time in Force
Exchange Endpoints
All endpoints below are relative to /api/rest/v1.
Exchange Order Request Schema
Exchange Orders Only
The following request schema applies to Exchange orders (POST /orders). For OTC order schemas, see OTC Trading.
Required Fields
Order Request Example
Dry-Run Mode
To validate an order without actually placing it, set dry: true in the request:
Dry-run mode performs all validation checks (balance, constraints, permissions) without creating the order. Use this to verify orders before submission.
Exchange Order Response Schema
When creating or retrieving an order, the response contains the full order object:
Order Fields
Order Status Values
Time in Force Values
Exchange Order List Filtering
When listing orders via GET /orders/by-sub-account/{subAccountId}, the response is paginated. See Making Requests for pagination details.
Available Filters
Sorting
OTC Trading
OTC (Over-the-Counter) trading enables trades with external dealers where PRIME acts as an intermediary. OTC trading offers two distinct approaches:
OTC Trading Methods
RFQ (Request for Quote)
RFQ is a real-time WebSocket workflow for negotiating quotes with external dealers. The investor requests quotes, dealers respond with prices, and the investor can accept a quote to execute the trade.
For complete RFQ documentation including WebSocket message formats and workflows, see RFQ (Request for Quote).
Field Naming Convention
RFQ WebSocket messages use PascalCase field names (RfqID, Quantity, Token), while OTC REST endpoints use camelCase (pairId, quantity).
OTC Orders
OTC Orders use the REST API for placing orders that execute with external dealers. Unlike Exchange orders, OTC orders support additional order types like TWAP (Time-Weighted Average Price) and can include scheduling parameters.
For complete OTC order schemas and workflows, see OTC Trading Use Case.
OTC Endpoints
All endpoints below are relative to /api/rest/v1.
Balance Impact
When placing orders:
- Buy Order: Quote currency reserved (price × quantity)
- Sell Order: Base currency reserved (quantity)
Reserved funds become available again if order is cancelled.
WebSocket Events
Exchange WebSocket Topics
OTC WebSocket Topics
OTC trading uses WebSocket for the RFQ workflow. See RFQ (Request for Quote) for complete WebSocket message formats.
Related
- RFQ (Request for Quote) - OTC trading via RFQ workflow
- Trading Data Use Case
- OTC Trading Use Case