Hercle
WebSocket

Accept RFQ

Accept a Request For Quote (RFQ) within the time limit to execute the trade.

Auth:API Key
Tags:
Trading
Command Name
AcceptRequestForQuote

Command Arguments

ClientId
Required
Type:
string
Description:

Custom client ID for tracking (max 36 characters)

Example: "my-client-456"
RequestForQuoteId
Required
Type:
string
Description:

Unique identifier of the RFQ to accept

Example: "rfq-789"

Command Invocation

Command Arguments Example:
[
  "my-client-456",
  "rfq-789"
]
Invocation Example:
connection.invoke('AcceptRequestForQuote', 'my-client-456', 'rfq-789')

Response Event

Event Name
executionEvents
Subject
execution.order.executed
FieldTypeDescription
tradeIdstringUnique identifier for the executed trade
sidestring
Indicates if the trade was a buy or sell
buyBuy
sellSell
pairstringTrading pair involved in the trade
pricenumberExecution price of the trade
sizenumberSize of the trade executed
notionalnumberNotional value of the trade
statusnumber
Status code of the trade execution
0Created
1Executed
2Cancelled
3Pending
baseCurrencystringBase currency of the trading pair
quoteCurrencystringQuote currency of the trading pair
timestampstringTimestamp of when the trade was executed
statusErrorstringError message if the trade failed

Example Response

{
  "data": {
    "tradeId": "trade-123",
    "side": "buy",
    "pair": "BTCUSDT",
    "price": 15000,
    "size": 0.5,
    "notional": 7500,
    "status": 1,
    "baseCurrency": "BTC",
    "quoteCurrency": "USDT",
    "timestamp": "2024-01-01T12:00:00Z",
    "statusError": ""
  }
}

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('AcceptRequestForQuote', "my-client-456", "rfq-789")
      .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

Event Log

No events yet. Connect and invoke a command to see events.