Get Last Trades
Retrieve the most recent trade execution history (fills) from Synthetix's orderbook across all users. Each trade represents a filled order or partial fill that has been executed. This endpoint provides public market data without requiring authentication.
Endpoint
POST https://papi.synthetix.io/v1/infoRequest
Request Format
{
"params": {
"action": "getLastTrades",
"symbol": "BTC-USDT",
"limit": 100
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params.action | string | Yes | Must be "getLastTrades" |
params.symbol | string | No | Filter trades by market symbol (e.g., "BTC-USDT") |
params.limit | integer | No | Maximum number of trades to return (default: 100, max: 500) |
No Authentication Required
This is a public endpoint that does not require authentication.
Response
Success Response
{
"status": "ok",
"response": {
"trades": [
{
"tradeId": "123456789",
"symbol": "BTC-USDT",
"side": "buy",
"price": "50000.50",
"quantity": "0.1",
"timestamp": 1704067200500,
"isMaker": false
},
{
"tradeId": "123456788",
"symbol": "BTC-USDT",
"side": "sell",
"price": "50000.25",
"quantity": "0.05",
"timestamp": 1704067199800,
"isMaker": true
}
],
"total": 2
},
"request_id": "5ccf215d37e3ae6d"
}Trade Object (Public)
| Field | Type | Description |
|---|---|---|
tradeId | string | Unique identifier for the trade |
symbol | string | Market symbol (e.g., "BTC-USDT") |
side | string | Order side: "buy" or "sell" |
price | string | Execution price as string |
quantity | string | Executed quantity as string |
timestamp | integer | Execution time in milliseconds since epoch |
isMaker | boolean | Whether this was a maker order (added liquidity) |
Error Response
{
"status": "error",
"error": {
"message": "Invalid symbol",
"code": "VALIDATION_ERROR"
},
"request_id": "5ccf215d37e3ae6d",
"timestamp": "2025-01-01T00:00:00Z"
}Examples
Get Recent Trades (All Markets)
{
"params": {
"action": "getLastTrades",
"limit": 50
}
}Filter by Symbol
{
"params": {
"action": "getLastTrades",
"symbol": "ETH-USDT",
"limit": 100
}
}Maximum Results
{
"params": {
"action": "getLastTrades",
"symbol": "BTC-USDT",
"limit": 500
}
}Response Fields
Response Structure
| Field | Type | Description |
|---|---|---|
trades | array | Array of public trade objects |
total | integer | Number of trades returned |
Sorting
Trades are returned in descending order by timestamp (newest first).
Implementation Notes
- Public Data: This endpoint provides public market data suitable for price discovery, trading interfaces, market data feeds, and public trade history displays
- Symbol Filtering: Filter by symbol to reduce response size and bandwidth
- Limit Usage: Default limit is 100 trades, maximum 500 trades per request
- Caching: Trade data is immutable once created, suitable for short-term caching
- Real-time Updates: Use Trade Updates WebSocket subscription for live data with sub-50ms latency. Use REST for initial load, WebSocket for ongoing updates
Use Cases
Market Analysis
- Recent price discovery and trade flow analysis
- Volume and liquidity assessment
- Market depth analysis when combined with orderbook data
Trading Interfaces
- Displaying recent market activity
- Trade history components
- Price movement indicators
Data Feeds
- Building market data aggregators
- Feeding external analytics systems
- Creating public market displays
Differences from getTrades
| Feature | getLastTrades (Public) | getTrades (Private) |
|---|---|---|
| Authentication | Not required | Required (EIP-712 signature) |
| Data Scope | All users | Specific subaccount only |
| Sensitive Data | Excluded | Included (fees, PnL, order IDs) |
| Pagination | Limit only | Limit + offset |
| Time Filtering | Not supported | Start/end time supported |
| Rate Limits | More permissive | Standard authenticated limits |
| Maximum Limit | 500 trades | 1000 trades |
Error Handling
Common Errors
| Error | Description | Solution |
|---|---|---|
Invalid symbol | Market symbol not recognized | Check available markets via getMarkets |
Invalid limit | Limit exceeds maximum | Use limit ≤ 500 |
Market not found | Specified symbol doesn't exist | Verify symbol format and availability |
Rate Limiting
:::info Rate Limits The Synthetix API enforces rate limits to ensure fair usage and system stability:
- Order Placement: 100 orders per second per subaccount
- WebSocket Connections: 100 connections per IP address
- WebSocket Subscriptions: 1000 subscriptions per IP address
See Rate Limits for detailed information and best practices. :::
- Public endpoints typically have higher rate limits
- Each request counts as 1 against rate limits
- No authentication overhead improves response times
- See Rate Limits for details
Next Steps
- Get Markets - Available trading markets
- Get Market Prices - Current market prices
- Get Trades - Your account's trade history
- Trade Updates - Real-time trade stream
- WebSocket Info - Real-time public market data