Skip to main content
GET
/
v0
/
positions
/
pnl
Get PnL data for wallet positions
curl --request GET \
  --url https://markets.dial.to/api/v0/positions/pnl \
  --header 'x-dialect-api-key: <api-key>'
{
  "currency": "<unknown>",
  "total": 123,
  "realized": 123,
  "unrealized": 123,
  "realizedLifetime": 123,
  "totalLifetime": 123,
  "positions": [
    {
      "positionId": "<string>",
      "marketId": "<string>",
      "ownerAddress": "<string>",
      "total": 123,
      "realized": 123,
      "realizedLifetime": 123,
      "totalLifetime": 123,
      "unrealized": 123,
      "capital": {
        "invested": 123,
        "investedLifetime": 123,
        "netFlow": 123,
        "netFlowLifetime": 123
      }
    }
  ]
}

Authorizations

x-dialect-api-key
string
header
default:pk_demo
required

API key for the Markets API

Query Parameters

walletAddresses
string
default:6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176
required

Comma separated list of owner addresses. Currently only supports one address.

Example:

"6JpNV6DK88auwzKVizdeT4Bw3D44sam5GqjcPCJ7y176"

Response

200 - application/json

OK

currency
any
required

Currency of the PnL values

total
number
required

Total PnL for all positions within the current session, unrealized + realized PnL

realized
number
required

Realized PnL for all positions within the current session

unrealized
number
required

Unrealized PnL for all positions. If position is closed, this field will be empty.

realizedLifetime
number
required

Realized PnL for all positions across all sessions

totalLifetime
number
required

Total PnL for all positions across all sessions, unrealized + realized lifetime PnL

positions
object[]
required

List of positions that contribute to PnL calculations. Each position is a separate entry.