Use Query Pending Positions to retrieve your current positions taking into account your pending orders (ie. buying power) This will not result in continuous position updates (like querypos).

Query Pending Positions


Request

KeyValueRequiredRequired
typestringquerypendingposYes
securitystringThe specific asset or currency. If not supplied, the response will contain pending positions for all securitiesNo
useridstringQuery this specific userid's positions. Note: you must be either be user_type of Firm (F) or (S) global admin. O (Operators) can not see positions other than their own pending positions.No

Response

KeyTypeValue
typestringquerypendingpos
resultstring"OK" if successful. If not successful, this field will contain the "no position" or "no actual position"
curposstringThe current position for the associated security
securitystringThe associated security
useridstringThe associated userid
total_recnumberThe number of records contained with the data array
dataarrayThe array of securities and the associated position for each
data.managedposstringThis is the withheld balance, the amount withheld in open orders.
data.openposstringThis field can be ignored and will always be zero (0).
data.securitystringThe associated security
data.curposstringThe current position for the associated security (including the value in managedpos).
data.rec_nonumberThe record index
data.typestringposition
# Request
{
   "type":"querypendingpos"
}

# Response
{
  'data': [{'curpos': '2000002168.9072175',
           'managedpos': '49',
           'openpos': '0',
           'rec_no': 1,
           'security': 'BTC',
           'type': 'position'},
          {'curpos': '2000000000',
           'managedpos': '0',
           'openpos': '0',
           'rec_no': 2,
           'security': 'USDC',
           'type': 'position'},
          {'curpos': '1914573360.15',
           'managedpos': '2414512.8',
           'openpos': '0',
           'rec_no': 3,
           'security': 'USD',
           'type': 'position'},
          {'curpos': '4000002577.501926',
           'managedpos': '47.40852377',
           'openpos': '0',
           'rec_no': 4,
           'security': 'ETH',
           'type': 'position'},
          {'curpos': '2000001513.3332746',
           'managedpos': '49.55409953',
           'openpos': '0',
           'rec_no': 5,
           'security': 'LTC',
           'type': 'position'}],
 'result': 'OK',
 'total_rec': 5,
 'type': 'querypendingpos'
}

# No positions
{
 'result': 'no such position',
 'security': 'BTC',
 'total_rec': 0,
 'type': 'querypendingpos'
}