Skip to content

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/info

Request

Request Format

{
  "params": {
    "action": "getLastTrades",
    "symbol": "BTC-USDT",
    "limit": 100
  }
}

Request Parameters

ParameterTypeRequiredDescription
params.actionstringYesMust be "getLastTrades"
params.symbolstringYesTrading pair symbol (e.g., "BTC-USDT"). Normalized to uppercase; maximum 20 characters.
params.limitintegerNoMaximum number of trades to return (default: 50, min: 1, max: 100)

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
      }
    ]
  },
  "request_id": "5ccf215d37e3ae6d"
}

Trade Object (Public)

FieldTypeDescription
tradeIdstringUnique identifier for the trade
symbolstringMarket symbol (e.g., "BTC-USDT")
sidestringOrder side: "buy" or "sell"
pricestringExecution price as string
quantitystringExecuted quantity as string
timestampintegerExecution time in milliseconds since epoch
isMakerbooleanWhether this was a maker order (added liquidity)

Error Response

{
  "status": "error",
  "error": {
    "message": "Invalid symbol",
    "code": "VALIDATION_ERROR"
  },
  "request_id": "5ccf215d37e3ae6d"
}

Examples

Get Recent Trades with Default Limit

{
  "params": {
    "action": "getLastTrades",
    "symbol": "BTC-USDT"
  }
}

Filter by Symbol

{
  "params": {
    "action": "getLastTrades",
    "symbol": "ETH-USDT",
    "limit": 100
  }
}

Maximum Results

{
  "params": {
    "action": "getLastTrades",
    "symbol": "BTC-USDT",
    "limit": 100
  }
}

Response Fields

Response Structure

FieldTypeDescription
tradesarrayArray of public trade objects

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 Required: A valid market symbol must be provided
  • Limit Usage: Default limit is 50 trades, minimum 1, maximum 100 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

FeaturegetLastTrades (Public)getTrades (Private)
AuthenticationNot requiredRequired (EIP-712 signature)
Data ScopeAll usersSpecific subaccount only
Sensitive DataExcludedIncluded (fees, PnL, order IDs)
Symbol ParameterRequiredOptional
PaginationLimit onlyLimit + offset
Time FilteringNot supportedStart/end time supported
Rate LimitsMore permissiveStandard authenticated limits
Maximum Limit100 trades1000 trades

Error Handling

Common Errors

ErrorDescriptionSolution
symbol is requiredSymbol parameter is missing or emptyProvide a valid market symbol
invalid symbolMarket symbol format is not recognizedUse uppercase format, e.g. "BTC-USDT"
symbol exceeds maximum length of 20 charactersSymbol exceeds 20-character limitShorten or correct the symbol value
Limit cannot exceed 100Limit exceeds maximumUse limit ≤ 100
Limit must be at least 1Limit is less than 1Use limit ≥ 1
Market not foundSpecified symbol doesn't existVerify symbol format and availability
500 Internal Server ErrorTrade history contains an unrecognized direction value (e.g. "unknown", "", or any unexpected string)Indicates corrupted trade direction data on the backend that requires operator investigation. Previously these cases were silently defaulted to side: "buy" in the response.

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