WebSocket
Create Custom RFQ
Create a Custom Request For Quote (RFQ) to receive price quotes for a specific trading pair and quantity. Has to be accepted within the time limit through AcceptRequestForQuote.
Auth:API Key
Tags:
Trading
Command Name
CreateRequestForQuoteWithCustomExpirationCommand Arguments
| Field | Type | Required | Description |
|---|---|---|---|
ClientId | string | Required | Custom client ID for tracking (max 36 characters) Example: "my-client-456" |
PairName | string | Required | Trading pair (e.g., BTCUSDT) Example: "BTCUSDT" |
Side | string | Required | RFQ side ("buy" or "sell") Example: "buy" |
Size | number | Required | Quantity for the RFQ Example: 0.5 |
Amount | number | Required | Total amount for the RFQ (optional) Example: 15000 |
ExpirationInSeconds | number | Required | Expiration time in seconds for the RFQ (default 15, max 240) Example: 60 |
ClientIdRequired
Type:
string
Description:
Custom client ID for tracking (max 36 characters)
Example:
"my-client-456"PairNameRequired
Type:
string
Description:
Trading pair (e.g., BTCUSDT)
Example:
"BTCUSDT"SideRequired
Type:
string
Description:
RFQ side ("buy" or "sell")
Example:
"buy"SizeRequired
Type:
number
Description:
Quantity for the RFQ
Example:
0.5AmountRequired
Type:
number
Description:
Total amount for the RFQ (optional)
Example:
15000ExpirationInSecondsRequired
Type:
number
Description:
Expiration time in seconds for the RFQ (default 15, max 240)
Example:
60Command Invocation
Command Arguments Example:
[
"my-client-456",
"BTCUSDT",
"buy",
0.5,
15000,
60
]Invocation Example:
connection.invoke('CreateRequestForQuoteWithCustomExpiration', 'my-client-456', 'BTCUSDT', 'buy', 0.5, 15000, 60)Response Event
Event Name
executionEventsSubject
account.requestForQuote.createdEvent sent when the custom RFQ is created
| Field | Type | Description |
|---|---|---|
requestForQuoteId | string | Unique RFQ identifier |
userId | string | Unique user identifier |
instrument | string | Trading pair (e.g., BTCUSDT) |
baseCurrency | string | Base currency of the trading pair |
quoteCurrency | string | Quote currency of the trading pair |
side | string | RFQ side buy→ Buysell→ Sell |
size | number | Quantity for the RFQ |
price | number | Quoted price for the RFQ |
amount | number | Total amount for the RFQ |
status | number | RFQ status 0→ Created1→ Executed2→ Cancelled3→ Pending |
requestDateTime | string | Timestamp when the RFQ was created |
expireDateTime | string | Timestamp when the RFQ expires |
Example Response
{
"data": {
"requestForQuoteId": "rfq-789",
"userId": "user-123",
"instrument": "BTCUSDT",
"baseCurrency": "BTC",
"quoteCurrency": "USDT",
"side": "buy",
"size": 0.5,
"price": 30000,
"amount": 15000,
"status": 0,
"requestDateTime": "2024-01-01T12:00:00Z",
"expireDateTime": "2024-01-01T12:05:00Z"
}
}Code Examples
const signalR = require('@microsoft/signalr');
const apiKey = 'YOUR_API_KEY_HERE';
const connection = new signalR.HubConnectionBuilder()
.withUrl('https://publicapi.sandbox.hercle.financial/ExecutionLiveServer/v1', {
accessTokenFactory: () => apiKey,
})
.build();
connection.start()
.then(() => {
console.log('Connected to WebSocket');
// Invoke command
connection.invoke('CreateRequestForQuoteWithCustomExpiration', "my-client-456", "BTCUSDT", "buy", 0.5, 15000, 60)
.then(() => {
console.log('Command sent successfully');
})
.catch(err => {
console.error('Command failed:', err);
});
})
.catch(err => {
console.error('Connection failed:', err);
});
// Listen for events
connection.on('executionEvents', (data) => {
console.log('Received event:', data);
});SignalR API Tester
Test this command in the sandbox environment
Disconnected
Your API key is only used locally and never stored