Documentation Index
Fetch the complete documentation index at: https://docs.paxos.com/llms.txt
Use this file to discover all available pages before exploring further.
The Execution Data channel provides real-time trade execution information for authorized Smart Order Routing customers. Subscribe to receive notifications as trades execute on the platform.
Subscribe to Execution Data
Request
{
"type": "subscribe",
"channels": [
{
"type": "execution_data",
"params": {
"market": "BTCUSD"
}
}
]
}
Response
{
"type": "subscribe",
"channels": [
{
"type": "execution_data",
"params": { "market": "BTCUSD" },
"success": true
}
]
}
The response echoes back the request parameters, allowing you to correlate responses when subscribing to multiple channels.
Error Response
{
"type": "subscribe",
"channels": [
{
"type": "execution_data",
"params": { "market": "BADBAD" },
"success": false,
"error": "UNKNOWN_CHANNEL_PARAMS_CONFIGURATION"
}
]
}
Each trade execution generates a message with the following format:
{
"channel": "execution_data",
"payload": {
"market": "BTCUSD",
"price": "50000.00",
"amount": "0.5",
"executed_at": "2024-01-15T10:30:00.123456789Z"
}
}
Message Fields
| Field | Type | Description |
|---|
market | string | The market pair (e.g., “BTCUSD”) |
price | string | Execution price as a decimal string |
amount | string | Executed amount as a decimal string |
executed_at | string | Timestamp in RFC3339Nano format |
Multiple Market Subscriptions
Subscribe to multiple markets simultaneously:
{
"type": "subscribe",
"channels": [
{
"type": "execution_data",
"params": {
"market": "BTCUSD"
}
},
{
"type": "execution_data",
"params": {
"market": "ETHUSD"
}
}
]
}
Processing Execution Data
Real-time Updates
- Messages are sent immediately when trades execute
- No messages during idle periods with no trading activity
- Executions may not be delivered in timestamp order. Clients should handle ordering based on the executed_at date information.
Example Implementation
class ExecutionMonitor {
constructor() {
this.executions = [];
this.volumeByMarket = new Map();
}
handleExecution(message) {
const execution = message.payload;
// Store execution
this.executions.push(execution);
// Update volume tracking
const currentVolume = this.volumeByMarket.get(execution.market) || 0;
const executionVolume = parseFloat(execution.price) * parseFloat(execution.amount);
this.volumeByMarket.set(execution.market, currentVolume + executionVolume);
// Process execution
this.processExecution(execution);
}
processExecution(execution) {
console.log(`Trade executed in ${execution.market}:`,
`${execution.amount} @ ${execution.price}`,
`at ${execution.executed_at}`);
// Your custom logic here
// - Update charts
// - Trigger alerts
// - Calculate metrics
}
getRecentExecutions(market, count = 10) {
return this.executions
.filter(e => e.market === market)
.slice(-count);
}
getTotalVolume(market) {
return this.volumeByMarket.get(market) || 0;
}
}
Unsubscribe
To stop receiving execution data:
{
"type": "unsubscribe",
"channels": [
{
"type": "execution_data",
"params": {
"market": "BTCUSD"
}
}
]
}
List Active Subscriptions
Get all active execution data subscriptions:
{
"type": "subscription_list"
}
Response
{
"type": "subscription_list",
"channels": [
{
"type": "execution_data",
"params": {
"market": "BTCUSD"
}
},
{
"type": "execution_data",
"params": {
"market": "ETHUSD"
}
}
]
}
Questions? Contact Support.