Positions

Subscribe positions

Subscribe to receive positions as they update. Returns Position.

Subscribe positions request example

{
  "positionSubscriptions":[ {
      "clientReferenceId":"Pos987",
      "customerId":"user1",
      "customerOrg":"CSDK1",
      "fromValueDate":"05/04/2020",
      "toValueDate":"7/17/2030",
      "pnlCurrency":"USD",
      "positionLevel":"ORG",
      "inclCustomerPositions":"true"
    }
  ]
}

Request body

Attribute Description
clientReferenceIdstring: (required) Your ID for the position subscription.
customerIdstring: (required) User ID subscribing to positions.
customerOrgstring: (required) Organization ID subscribing to positions.
fromValueDatestring: (required) The start date (inclusive) of the position date range in the format MM/dd/yyyy.
toValueDatestring: (required) The end date (inclusive) of the position date range in the format MM/dd/yyyy.
pnlCurrencystring: (required) The P&L reporting currency.
positionLevelstring: (required) Positions calculated by the entity that took the position: ORG=Your organization. USER=Your users. CPTYORG=Your counterparty organizations.
inclCustomerPositionsboolean: (required) true=Include customer positions in returned positions. false=Return only positions take by your organization.

Subscribe positions response example

{ "positionSubscriptionResponses":[ {
    "request":{
      "clientReferenceId":"html",
      "customerId":"user1",
      "customerOrg":"CSDK1",
      "fromValueDate":"05/04/2020",
      "toValueDate":"7/17/2030",
      "pnlCurrency":"USD",
      "positionLevel":"ORG",
      "inclCustomerPositions":"true"
      },
      "positionRequestId":"1079782850",
      "status":"success"
    }
  ]
}

Response body

Attribute Description
clientReferenceIdstring: Your ID for the position subscription.
customerIdstring: User ID subscribing to positions.
customerOrgstring: Organization ID subscribing to positions.
fromValueDatestring: The start date (inclusive) of the position date range in the format MM/dd/yyyy.
toValueDatestring: The end date (inclusive) of the position date range in the format MM/dd/yyyy.
pnlCurrencystring: The P&L reporting currency.
positionLevelstring: Positions calculated by the entity that took the position: ORG=Your organization. USER=Your users. CPTYORG=Your counterparty organizations.
inclCustomerPositionsboolean: true=Include customer positions in returned positions. false=Return only positions take by your organization.
positionRequestIdstring: The Integral API ID for your position subscription request.
statusstring: The status of your request.

Position example

{ "position":{
    "side":"Short",
    "symbol":"USD/CHF",
    "level":"ORG",
    "levelValue":"CSDK1",
    "netOpenBase":15000000.00,
    "netOpenterm":12906962.70,
    "rate":0.8604642,
    "realizedPnL":0.00,
    "unrealizedPnL":(1,716,667.89),
    "pnlCurrency":"USD",
    "requestId":"1079782850"
  }
}

Returns

Attribute Description
sidestring: Long or short.
symbolstring: Base and term currency separated by a slash "/" (for example EUR/USD).
valuedatestring: The value date of the trades that make up the position.
levelstring: The level of the position calculation:
  • USER: For an individual user.
  • ORG: For an organization.
levelValuestring: The ID of either the user or organization based on the value of level.
netOpenBasedouble: Net open amount in base currency.
netOpentermdouble: Net open amount in term currency.
ratedouble: The weighted average buy or sell rate of the current position.
realizedPnLdouble: The profit or loss in the base currency determined by taking all trades(or portions thereof) that are closed and computing the profit for each pair of opposing buy/sell trades.
unrealizedPnLdouble: The profit or loss in the base currency determined by taking the position's currency pair rate against the current market rate at the position amount. Essentially, the unrealized P/L is the profit or loss if the position was closed at the current close rate.
pnlCurrencystring: The P&L reporting currency.
childrenlist: List of child positions.

Unsubscribe positions

Unsubscribe from position updates.

Unsubscribe positions request example

{ "positionUnsubscriptions":
  [ { "positionRequestId":"1242460608"
    }
  ]
}

Request body

Attribute Description
positionRequestIdstring: (required) The positionRequestId from the positionSubscriptionResponses message.

Unsubscribe positions response example

{ "positionUnsubscriptionResponses":
  [ { "request":
      { "positionRequestId": "1242460608"
      },
      "status":"success"
     }
  ]
}

Response body

Attribute Description
positionRequestIdstring: (required) The positionRequestId from your unsubscribe response.
statusstring: The status of your request.