derivative

Get Perpetual Positions

Fetches the current (or historical) perpetual positions for a specified address and sub-account.

💡 Compute Unit Value: 35 (Fixed)

get/defi/v1/derivative/getperpetualpositions

Request

  • Base URL
    https://svc.blockdaemon.com
  • URL
    https://svc.blockdaemon.com/defi/v1/derivative/getperpetualpositions
  • Auth
    API key in header X-API-Key

Query parameters

addressstring required

The dYdX wallet address of the user.

Example:0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402
derivativeId'1000'

The unique identifier for dYdX V4.

Example:1000
subAccountNumberstring required

The sub-account number for the user. This specifies which sub-account's orders should be retrieved.

Example:0

Response

Successful response

statusinteger
msgstring
dataobject

Example response

{
  "status": 200,
  "msg": "success",
  "data": {
    "positions": [
      {
        "market": "ETH-USD",
        "status": "OPEN",
        "side": "LONG",
        "size": "0.275",
        "maxSize": "0.275",
        "entryPrice": "2446.92727272727272727273",
        "exitPrice": null,
        "realizedPnl": "-0.30197",
        "unrealizedPnl": "24.92914112499999999999925",
        "createdAt": "2023-11-01T09:40:35.893Z",
        "createdAtHeight": "882343",
        "closedAt": null,
        "sumOpen": "0.275",
        "sumClose": "0",
        "netFunding": "-0.30197"
      },
      {
        "market": "ETH-USD",
        "status": "CLOSED",
        "side": "LONG",
        "size": "0",
        "maxSize": "0.01",
        "entryPrice": "1851.3",
        "exitPrice": "1849.8",
        "realizedPnl": "-0.015",
        "unrealizedPnl": "0",
        "createdAt": "2023-10-26T08:22:15.515Z",
        "createdAtHeight": "532122",
        "closedAt": "2023-10-26T08:22:23.632Z",
        "sumOpen": "0.01",
        "sumClose": "0.01",
        "netFunding": "0"
      },
      {
        "market": "ETH-USD",
        "status": "CLOSED",
        "side": "SHORT",
        "size": "0",
        "maxSize": "-0.005",
        "entryPrice": "1847.1",
        "exitPrice": "1851.2",
        "realizedPnl": "-0.0205",
        "unrealizedPnl": "0",
        "createdAt": "2023-10-26T07:52:16.125Z",
        "createdAtHeight": "531124",
        "closedAt": "2023-10-26T07:59:24.633Z",
        "sumOpen": "0.005",
        "sumClose": "0.005",
        "netFunding": "0"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.