Estimate position
Estimate the margin that would be required for maintaining the specified position. If the optional collateral available argument is supplied, the response also contains the estimate of the liquidation price.
Query Parameters
marketId string required
Market ID.
openVolume int64 required
Open volume. This field is an signed integer (negative for short position) passed as a string and needs to be scaled using the market's position decimal places.
collateralAvailable string
Optional argument specifying collateral available for the position, if provided then response will contain the liquidation price estimate.
Responses
- 200
- 500
- default
A successful response.
application/json
Schema
Example (from schema)
Schema
liquidation object
margin object
{
"liquidation": {
"bestCase": {
"includingBuyOrders": "string",
"includingSellOrders": "string",
"openVolumeOnly": "string"
},
"worstCase": {
"includingBuyOrders": "string",
"includingSellOrders": "string",
"openVolumeOnly": "string"
}
},
"margin": {
"bestCase": {
"asset": "string",
"collateralReleaseLevel": "string",
"initialMargin": "string",
"maintenanceMargin": "string",
"marketId": "string",
"partyId": "string",
"searchLevel": "string",
"timestamp": "string"
},
"worstCase": {
"asset": "string",
"collateralReleaseLevel": "string",
"initialMargin": "string",
"maintenanceMargin": "string",
"marketId": "string",
"partyId": "string",
"searchLevel": "string",
"timestamp": "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/estimate/position
Request
Request
curl / cURL
curl -L -X GET 'https://vega-mainnet-data.commodum.io/api/v2/estimate/position' \
-H 'Accept: application/json'
python / requests
curl -L -X GET 'https://vega-mainnet-data.commodum.io/api/v2/estimate/position' \
-H 'Accept: application/json'
go / native
curl -L -X GET 'https://vega-mainnet-data.commodum.io/api/v2/estimate/position' \
-H 'Accept: application/json'
nodejs / axios
curl -L -X GET 'https://vega-mainnet-data.commodum.io/api/v2/estimate/position' \
-H 'Accept: application/json'