Positions

positionsV2 InjectiveDerivativeExchangeRPC

get

Positions gets the positions for a trader. V2 removed some redundant fields and had performance improvements

Query parameters
subaccountIdstring · min: 66 · max: 66Optional

SubaccountId of the trader we want to get the positions from

Example: 0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000002Pattern: ^0x[0-9a-fA-F]{64}$
skipintegerOptional

Skip will skip the first n item from the result

Default: 0Example: 0
limitinteger · min: 1 · max: 100Optional

Limit is used to specify the maximum number of items to be returned

Default: 100Example: 100
startTimeinteger · int64Optional

The starting timestamp in UNIX milliseconds that the trades must be equal or older than

Example: 1645579770
endTimeinteger · int64Optional

The ending timestamp in UNIX milliseconds that the trades must be equal or younger than

Example: 1645579787
marketIdstring · min: 66 · max: 66Optional

MarketId of the position we want to fetch. Use this field for fetching from single market

Example: 0x3bdb3d8b5eb4d362371b72cf459216553d74abdb55eb0208091f7777dd85c8bbPattern: ^0x[0-9a-fA-F]{64}$
marketIdsstring[] · max: 100Optional

MarketIds of the markets we want to filter. Use this field for fetching from multiple markets

Example: ["0x4ca0f92fc28be0c9761326016b5a1a2177dd6375558365116b5bdda9abc229ce","0x1f73e21972972c69c03fb105a5864592ac2b47996ffea3c500d1ea2d20138717"]
directionstring · enumOptional

filter by direction of the position

Example: shortPossible values:
subaccountTotalPositionsbooleanOptional

set to True to return subaccount total positions

Default: falseExample: true
accountAddressstring · min: 42 · max: 42Optional

filter by account address

Example: inj1jrut76j8nueqatg8gsg6fv88j3823jwp5thf77Pattern: ^inj1[0-9a-zA-Z]{38}$
Responses
200
OK response.
application/json
get
GET /api/exchange/derivative/v2/positions HTTP/1.1
Host: inj-indexer.nownodes.io
Accept: */*
{
  "paging": {
    "countBySubaccount": 3144167030999342600,
    "from": 1916499695,
    "next": [
      "Ea rerum.",
      "Aut dolorem cum voluptas quae.",
      "Voluptas repellendus qui ipsam est."
    ],
    "to": 391437627,
    "total": 7364854934794692000
  },
  "positions": [
    {
      "denom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "direction": "long",
      "entryPrice": "15333333.333333333333333333",
      "liquidationPrice": "23420479",
      "margin": "77000000",
      "markPrice": "14000000",
      "marketId": "0x3bdb3d8b5eb4d362371b72cf459216553d74abdb55eb0208091f7777dd85c8bb",
      "quantity": "9",
      "subaccountId": "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000002",
      "ticker": "INJ/USDT-PERP",
      "updatedAt": 1544614248000
    },
    {
      "denom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "direction": "long",
      "entryPrice": "15333333.333333333333333333",
      "liquidationPrice": "23420479",
      "margin": "77000000",
      "markPrice": "14000000",
      "marketId": "0x3bdb3d8b5eb4d362371b72cf459216553d74abdb55eb0208091f7777dd85c8bb",
      "quantity": "9",
      "subaccountId": "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000002",
      "ticker": "INJ/USDT-PERP",
      "updatedAt": 1544614248000
    },
    {
      "denom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "direction": "long",
      "entryPrice": "15333333.333333333333333333",
      "liquidationPrice": "23420479",
      "margin": "77000000",
      "markPrice": "14000000",
      "marketId": "0x3bdb3d8b5eb4d362371b72cf459216553d74abdb55eb0208091f7777dd85c8bb",
      "quantity": "9",
      "subaccountId": "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000002",
      "ticker": "INJ/USDT-PERP",
      "updatedAt": 1544614248000
    },
    {
      "denom": "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "direction": "long",
      "entryPrice": "15333333.333333333333333333",
      "liquidationPrice": "23420479",
      "margin": "77000000",
      "markPrice": "14000000",
      "marketId": "0x3bdb3d8b5eb4d362371b72cf459216553d74abdb55eb0208091f7777dd85c8bb",
      "quantity": "9",
      "subaccountId": "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000002",
      "ticker": "INJ/USDT-PERP",
      "updatedAt": 1544614248000
    }
  ]
}