Skip to content

Positions

Retrieves position data for a specific portfolio.

Request URL

https://ddp.definitive.fi/v1/positions

Query Parameters

ParameterTypeRequiredDefaultDescription
showDustbooleanNofalseIf true, includes all assets with < $1 USD worth of value and assets that cannot be priced
limitnumberNo100Maximum number of positions to return. Must be between 1 and 100
offsetnumberNo0Number of positions to skip for pagination. Must be >= 0

Response

{
  "positions": [
    {
      "asset": {
        "name": "Ethereum",
        "address": "0x1234567890abcdef1234567890abcdef12345678",
        "ticker": "ETH",
        "chain": {
          "name": "Ethereum",
          "id": "1",
          "namespace": "evm",
        },
      },
      "balance": 1.5,
      "notional": 2678.5,
      "portfolioId": "12345678-1234-1234-1234-123412341234",
      "vaultId": "12345678-1234-1234-1234-123412341234",
    },
    {
      "asset": {
        "name": "Bitcoin",
        "address": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
        "ticker": "BTC",
        "chain": {
          "name": "Bitcoin",
          "id": "2",
          "namespace": "utxo",
        },
      },
      "balance": 0.25,
      "notional": 14000.0,
      "portfolioId": "12345678-1234-1234-1234-123412341234",
      "vaultId": "87654321-4321-4321-4321-432143214321",
    }
  ],
  "totalCount": 45,
  "limit": 20,
  "offset": 0
}

Example

// Get first page of positions (default 20 items)
const firstPage = await AuthHelpers.signAndSend({
  path: "/v1/positions",
  method: "GET",
  queryParams: { showDust: false },
  apiKey: process.env.API_KEY,
  apiSecret: process.env.API_SECRET,
});
 
// Get second page of positions with custom limit
const secondPage = await AuthHelpers.signAndSend({
  path: "/v1/positions",
  method: "GET",
  queryParams: {
    showDust: true,
    limit: 50,
    offset: 20,
  },
  apiKey: process.env.API_KEY,
  apiSecret: process.env.API_SECRET,
});