RFQ (Request for Quote)
Real-time quote workflow for OTC trading with external dealers
RFQ (Request for Quote)
RFQ is the primary workflow for OTC trading on PRIME. It allows clients to request real-time quotes from external dealers, with PRIME acting as intermediary.
Overview
The RFQ workflow operates over WebSocket and consists of three phases:
- Request quotes - Client requests quotes for a specific pair and quantity
- Receive streaming quotes - Dealers stream bid/ask quotes in real-time
- Accept or stop - Client accepts a quote to execute the trade, or stops the session
Important Notes
Field naming convention: Unlike other WebSocket messages, RFQ messages use PascalCase field names (e.g.,
RfqID,Quantity,Token) rather than camelCase. This applies to both requests and responses.
WebSocket Topics
| Topic Pattern | Purpose |
|---|---|
{subAccountId}@quotes | Start quoting, receive streaming quotes |
{subAccountId}@accept | Accept a quote |
{subAccountId}@stop | Cancel an RFQ session |
All RFQ topics require authentication.
Start Quoting
Request quotes for a trade.
Topic: {subAccountId}@quotes
Request
{
"e": "tdx:rfq",
"t": "7376524e-6b6b-4137-9719-7e07a7709804@quotes",
"a": "jwt_token",
"d": {
"Pair": "BTC/USD",
"Quantity": "1.0",
"RequestID": "optional-request-uuid"
}
}| Field | Type | Required | Description |
|---|---|---|---|
Pair | string | Yes | Trading pair symbol |
Quantity | string | Yes | Quantity to trade |
RequestID | string | No | Client-provided request ID for correlation |
Quotes Event
Streaming quotes from dealers. These arrive continuously while the RFQ session is active.
{
"e": "tdx:quotes",
"t": "7376524e-6b6b-4137-9719-7e07a7709804@quotes",
"d": {
"RfqID": "rfq-123",
"RequestID": "req-456",
"Bid": {
"Token": "encrypted_token_1",
"Amount": "50000.00"
},
"Ask": {
"Token": "encrypted_token_2",
"Amount": "50100.00"
}
}
}| Field | Type | Description |
|---|---|---|
RfqID | string | RFQ session identifier |
RequestID | string | Client-provided request ID (if provided) |
Bid | object | Best bid quote |
Bid.Token | string | Encrypted token to accept this bid |
Bid.Amount | string | Bid price |
Ask | object | Best ask quote |
Ask.Token | string | Encrypted token to accept this ask |
Ask.Amount | string | Ask price |
Termination Event
Sent when the RFQ session ends (timeout, no dealers available, etc.).
{
"e": "tdx:termination",
"t": "7376524e-6b6b-4137-9719-7e07a7709804@quotes",
"d": {
"RfqID": "rfq-123",
"Reason": "TIMEOUT"
}
}| Field | Type | Description |
|---|---|---|
RfqID | string | RFQ session identifier |
Reason | string | Termination reason |
Accept Quote
Accept a received quote to execute the trade.
Topic: {subAccountId}@accept
Request
{
"e": "tdx:rfq",
"t": "7376524e-6b6b-4137-9719-7e07a7709804@accept",
"a": "jwt_token",
"d": {
"RfqID": "rfq-123",
"QuoteToken": "encrypted_token_1",
"Comment": "optional comment"
}
}| Field | Type | Required | Description |
|---|---|---|---|
RfqID | string | Yes | RFQ session identifier |
QuoteToken | string | Yes | Token from the quote to accept |
Comment | string | No | Optional comment for the trade |
Confirmation Event
Sent when the quote is successfully accepted and trade executed.
{
"e": "tdx:confirmation",
"t": "7376524e-6b6b-4137-9719-7e07a7709804@accept",
"d": {"RfqID": "rfq-123"}
}Rejection Event
Sent when the quote acceptance fails (quote expired, insufficient balance, etc.).
{
"e": "tdx:rejection",
"t": "7376524e-6b6b-4137-9719-7e07a7709804@accept",
"d": {"RfqID": "rfq-123"}
}Stop Quoting
Cancel an active RFQ session without accepting any quote.
Topic: {subAccountId}@stop
Request
{
"e": "tdx:rfq",
"t": "7376524e-6b6b-4137-9719-7e07a7709804@stop",
"a": "jwt_token",
"d": "rfq-123"
}The d field contains just the RFQ ID as a string.
RFQ Workflow Example
Client PRIME Dealers
│ │ │
│──── tdx:rfq @quotes ────────>│ │
│ (Pair, Quantity) │──── Request quotes ─────────>│
│ │ │
│<──── tdx:quotes ─────────────│<──── Stream quotes ──────────│
│ (RfqID, Bid, Ask) │ │
│<──── tdx:quotes ─────────────│<──── Stream quotes ──────────│
│ (updated quotes) │ │
│ │ │
│──── tdx:rfq @accept ────────>│ │
│ (RfqID, QuoteToken) │──── Execute trade ──────────>│
│ │ │
│<──── tdx:confirmation ───────│<──── Trade confirmed ────────│
│ │ │
Related
Updated 5 days ago
