Error
A valid request URL is required to generate request examples{
"version": "external-position-history/v1",
"accountId": "<string>",
"episodes": [
{
"positionId": "<string>",
"accountId": "<string>",
"marketId": "<string>",
"side": "long",
"status": "open",
"openedAtEpochMs": 1,
"closedAtEpochMs": 1,
"maxQuantityAtoms": "<string>",
"maxQuantity": "<string>",
"currentQuantityAtoms": "<string>",
"currentQuantity": "<string>",
"avgEntryPriceAtoms": "<string>",
"avgEntryPrice": "<string>",
"avgExitPriceAtoms": "<string>",
"avgExitPrice": "<string>",
"realizedPnlAtoms": "<string>",
"realizedPnl": "<string>",
"feesPaidAtoms": "<string>",
"feesPaid": "<string>",
"fundingPaidAtoms": "<string>",
"fundingPaid": "<string>",
"closeReason": "user_close",
"lastSequence": 1
}
],
"nextCursor": "<string>",
"freshness": {
"status": "fresh",
"degradedState": "none",
"journalSequence": 1,
"asOfEpochMs": 1,
"projectorLagMs": 1,
"dbReplicaLagMs": 1,
"backfillStatus": "live"
},
"marketId": "<string>",
"status": "open"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}Accounts
Get account position history
Returns paginated position episodes for an account from the lagging projection. The cursor is a base64url JSON object containing openedAtEpochMs and positionId.
Method and path: GET /v1/accounts//positions/history
Authentication: DFNS trader bearer required.
Request schema: none.
Response schema: ExternalPositionHistoryResponse.
Error envelope: ExternalRestError (external-rest-error/v1).
GET
/
v1
/
accounts
/
{accountId}
/
positions
/
history
Error
A valid request URL is required to generate request examples{
"version": "external-position-history/v1",
"accountId": "<string>",
"episodes": [
{
"positionId": "<string>",
"accountId": "<string>",
"marketId": "<string>",
"side": "long",
"status": "open",
"openedAtEpochMs": 1,
"closedAtEpochMs": 1,
"maxQuantityAtoms": "<string>",
"maxQuantity": "<string>",
"currentQuantityAtoms": "<string>",
"currentQuantity": "<string>",
"avgEntryPriceAtoms": "<string>",
"avgEntryPrice": "<string>",
"avgExitPriceAtoms": "<string>",
"avgExitPrice": "<string>",
"realizedPnlAtoms": "<string>",
"realizedPnl": "<string>",
"feesPaidAtoms": "<string>",
"feesPaid": "<string>",
"fundingPaidAtoms": "<string>",
"fundingPaid": "<string>",
"closeReason": "user_close",
"lastSequence": 1
}
],
"nextCursor": "<string>",
"freshness": {
"status": "fresh",
"degradedState": "none",
"journalSequence": 1,
"asOfEpochMs": 1,
"projectorLagMs": 1,
"dbReplicaLagMs": 1,
"backfillStatus": "live"
},
"marketId": "<string>",
"status": "open"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Minimum string length:
1Query Parameters
Optional market filter.
Minimum string length:
1Optional episode status filter.
Available options:
open, closed, liquidated Page size, from 1 to 100. Defaults to 50.
Required range:
x <= 100Base64url JSON cursor with openedAtEpochMs and positionId.
Minimum string length:
1Response
Success
Allowed value:
"external-position-history/v1"Minimum string length:
1Show child attributes
Show child attributes
Minimum string length:
1Show child attributes
Show child attributes
Minimum string length:
1Available options:
open, closed, liquidated