Observe positions
Subscribe to a stream of position updates. The first messages sent through the stream will contain information about current positions, followed by updates to those positions.
Query Parameters
partyId string
Restrict position updates to those related to the given parties.
marketId string
Restrict position updates to those related to the given markets.
Responses
- 200
- 500
- default
A successful response.(streaming responses)
application/json
Schema
Example (from schema)
Schema
error object
result object
{
"error": {
"code": 0,
"details": [
{
"@type": "string"
}
],
"message": "string"
},
"result": {
"snapshot": {
"lastPage": true,
"positions": [
{
"averageEntryPrice": "string",
"lossSocialisationAmount": "string",
"marketId": "string",
"openVolume": "string",
"partyId": "string",
"positionStatus": "POSITION_STATUS_UNSPECIFIED",
"realisedPnl": "string",
"unrealisedPnl": "string",
"updatedAt": "string"
}
]
},
"updates": {
"positions": [
{
"averageEntryPrice": "string",
"lossSocialisationAmount": "string",
"marketId": "string",
"openVolume": "string",
"partyId": "string",
"positionStatus": "POSITION_STATUS_UNSPECIFIED",
"realisedPnl": "string",
"unrealisedPnl": "string",
"updatedAt": "string"
}
]
}
}
}
An internal server error
application/json
Schema
Example (from schema)
Schema
code int32
details object[]
message string
{
"code": 0,
"details": [
{
"@type": "string"
}
],
"message": "string"
}
An unexpected error response.
application/json
Schema
Example (from schema)
Schema
code int32
details object[]
message string
{
"code": 0,
"details": [
{
"@type": "string"
}
],
"message": "string"
}
GET /api/v2/stream/positions
Request
Request
curl / cURL
curl -L -X GET 'https://api.n00.testnet.vega.rocks/api/v2/stream/positions' \
-H 'Accept: application/json'
python / requests
curl -L -X GET 'https://api.n00.testnet.vega.rocks/api/v2/stream/positions' \
-H 'Accept: application/json'
go / native
curl -L -X GET 'https://api.n00.testnet.vega.rocks/api/v2/stream/positions' \
-H 'Accept: application/json'
nodejs / axios
curl -L -X GET 'https://api.n00.testnet.vega.rocks/api/v2/stream/positions' \
-H 'Accept: application/json'