Get Performance History
Retrieve comprehensive performance analytics including historical account value, PnL trends, and trading volume for a subaccount over a specified period. Optimized for charting and performance analysis.
Endpoint
POST https://papi.synthetix.io/v1/tradeRequest
Request Format
{
"params": {
"action": "getPerformanceHistory",
"period": "week"
},
"subAccountId": "1867542890123456789",
"nonce": 1735689600000,
"signature": {
"v": 28,
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | Yes | Container for action-specific parameters |
params.action | string | Yes | Must be "getPerformanceHistory" |
params.period | string | No | Time window for the performance history. One of day (default), week, month, threeMonth, ytd, allTime. |
If params.period is omitted, the service returns day performance history by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
nonce | uint64 | Yes | Unix milliseconds timestamp (must be monotonically increasing) |
signature | object | Yes | EIP-712 signature object |
expiresAfter | uint64 | No | Unix milliseconds expiration timestamp (5x rate limit on stale cancels) |
Response
Success Response
{
"status": "ok",
"response": {
"subAccountId": "123456789",
"period": "day",
"performanceHistory": {
"history": [
{
"sampledAt": 1736947200000,
"accountValue": "10000.50",
"pnl": "12.34"
},
{
"sampledAt": 1736950800000,
"accountValue": "10020.10",
"pnl": "15.67"
}
],
"volume": "250000.00"
}
},
"request_id": "abcd1234"
}Response Structure
Performance History Object
| Field | Type | Description |
|---|---|---|
history | array | Ordered list of performance points for the requested period |
history[] | object | Individual datapoint containing timestamp and performance values |
history[].sampledAt | number | Unix timestamp in milliseconds |
history[].accountValue | string | Account value at the timestamp |
history[].pnl | string | PnL at the timestamp |
volume | string | Total volume traded during the requested period |
The response also echoes the subAccountId and the period that was requested.
Error Response
{
"status": "error",
"error": {
"message": "Failed to retrieve performance history",
"code": "INTERNAL_ERROR"
},
"request_id": "5ccf215d37e3ae6d",
"timestamp": "2025-01-01T00:00:00Z"
}Code Examples
Get Performance History
{
"params": {
"action": "getPerformanceHistory",
"period": "month"
},
"subAccountId": "1867542890123456789",
"nonce": 1735689600000,
"signature": {
"v": 28,
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
}Performance Information
- Historical Analytics: Account value and PnL tracking for a selected timeframe (day, week, month, threeMonth, YTD, all-time)
- Volume Tracking: Trading activity metrics for performance analysis over the requested period
- Time Series Data: Ideal for charting and portfolio performance visualization
- Performance Focus: Dedicated to performance analytics, separate from account balances and margin data
- USDT Denomination: All monetary values are denominated in USDT for consistency
- Optimized for Analytics: Structured for performance dashboards and reporting tools
Use Cases
- Performance Dashboards: Build comprehensive performance tracking interfaces
- PnL Analysis: Track profit and loss trends over different time periods
- Trading Analytics: Analyze trading volume and activity patterns
- Portfolio Reporting: Generate performance reports for users
- Charting Applications: Power performance charts and visualizations
- Trend Analysis: Identify performance patterns and trading behavior
Validation Rules
noncemust be a timestamp in milliseconds and must be increasing- Must be signed by account owner or authorized delegate
- Subaccount ID must be valid and accessible
EIP-712 Domain Separator
All signature-based authentication uses the following domain separator:
{
"name": "Synthetix",
"version": "1",
"chainId": 1,
"verifyingContract": "0x0000000000000000000000000000000000000000"
}Signing
All trading methods are signed using EIP-712. Each successful trading request will contain:
- A piece of structured data that includes the sender address
- A signature of the hash of that structured data, signed by the sender
For detailed information on EIP-712 signing, see EIP-712 Signing.
Nonce Management
The nonce system prevents replay attacks and ensures order uniqueness:
- Use current timestamp in milliseconds as nonce
- Each nonce must be greater than the previous one
- Recommended: Use
Date.now()or equivalent - If nonce conflicts occur, increment by 1 and retry
Error Handling
Common error scenarios:
| Error | Description |
|---|---|
| Invalid signature | EIP-712 signature validation failed |
| Invalid market symbol | Market symbol not recognized |
| Nonce already used | Nonce must be greater than previous value |
| Rate limit exceeded | Too many requests in time window |
| Request expired | expiresAfter timestamp has passed |
| Error | Description |
|---|---|
| Invalid request format | Request payload could not be parsed |
| Internal error | Failed to retrieve performance data |
| Subaccount not found | Specified subaccount does not exist |
| Insufficient permissions | Account lacks access to this subaccount |
Related Endpoints
- Get Subaccount - Account information and balances
- Get Positions - Current position details
- Get Orders - Trading history
- Get Trades - Trade execution details
Data Format Notes
- Timestamps: Unix timestamp in milliseconds
- Time Series: Array of objects with
sampledAt,accountValue, andpnl, ordered chronologically - Numeric Precision: All numeric values returned as strings to preserve precision
- Volume (
volume): Represents total volume traded during the requested time period