curl --request GET \
--url https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions \
--header 'Authorization: Bearer <token>'import requests
url = "https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"version": "external-position-snapshot/v1",
"accountId": "<string>",
"snapshotSequence": 1,
"readModelDigest": "<string>",
"positions": [
{
"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,
"markPriceAtoms": "<string>",
"unrealizedPnlAtoms": "<string>",
"liquidationPriceAtoms": "<string>",
"marginHealthBps": "<string>",
"equityAtoms": "<string>",
"maintenanceRequirementAtoms": "<string>",
"marginStatus": "healthy",
"riskAsOfMarketDataSequence": 4503599627370495,
"liquidationTierConsistent": true
}
],
"resync": {
"stream": "account.positions",
"fromSequence": 123
},
"freshness": {
"status": "fresh",
"degradedState": "none",
"journalSequence": 1,
"asOfEpochMs": 1,
"projectorLagMs": 1,
"dbReplicaLagMs": 1,
"backfillStatus": "live"
}
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}Get account positions
Returns open positions enriched with live liquidation price, margin health, and mark-sequence provenance.
Method and path: GET /v1/accounts//positions
Authentication: DFNS trader bearer required.
Request schema: none.
Response schema: ExternalPositionSnapshotResponse.
Error envelope: ExternalRestError (external-rest-error/v1).
curl --request GET \
--url https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions \
--header 'Authorization: Bearer <token>'import requests
url = "https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.edel-api.xyz/v1/accounts/{accountId}/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"version": "external-position-snapshot/v1",
"accountId": "<string>",
"snapshotSequence": 1,
"readModelDigest": "<string>",
"positions": [
{
"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,
"markPriceAtoms": "<string>",
"unrealizedPnlAtoms": "<string>",
"liquidationPriceAtoms": "<string>",
"marginHealthBps": "<string>",
"equityAtoms": "<string>",
"maintenanceRequirementAtoms": "<string>",
"marginStatus": "healthy",
"riskAsOfMarketDataSequence": 4503599627370495,
"liquidationTierConsistent": true
}
],
"resync": {
"stream": "account.positions",
"fromSequence": 123
},
"freshness": {
"status": "fresh",
"degradedState": "none",
"journalSequence": 1,
"asOfEpochMs": 1,
"projectorLagMs": 1,
"dbReplicaLagMs": 1,
"backfillStatus": "live"
}
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
1Response
Success
"external-position-snapshot/v1"1x >= 0Covers the DURABLE episode rows ONLY. Live per-market risk is merged into positions from engine memory and is deliberately EXCLUDED, so the digest is stable across mark-price movement and does not change when marginStatus does. Do not verify it against positions; it will not match.
^sha256:[0-9a-f]{64}$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes