Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

getMaxPositions

Returns the maximum buy and sell sizes available at the requested price.

The query supports both perpetual and Outcome instruments. For Outcome, pass the market's instrument_id from outcomeMeta as the string-valued asset. buyPrice / sellPrice are required according to the side being estimated.

POST/infotype getMaxPositions

Compute the max buy / sell size at a price the user typed into the order ticket.

Request body
assetstringrequired

Instrument external id (numeric string) — the `index` value from the `perpMeta` response.

orderTypestringrequired

Order type: `LIMIT` or `MARKET`.

typestringrequired
userstringrequired
buyPricestringnullableoptional
reduceOnlybooleannullableoptional
sellPricestringnullableoptional
Request example
curl -X POST https://rpc.txflow-testnet.xyz/info \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "asset": "4",
  "buyPrice": "0",
  "orderType": "limit",
  "reduceOnly": false,
  "sellPrice": "0",
  "type": "getMaxPositions",
  "user": "0x0000000000000000000000000000000000000000"
}'
Try it
POST https://rpc.txflow-testnet.xyz/info
Response · MaxPositionsResponse 200
codeinteger

`0` on success.

dataMaxPositionsResponse

Maximum tradable-quantity response. Reports the maximum long/short size the user can open at the given price.

availableToTradestring

User available balance.

buyPricestring

Buy price used in the calculation.

longMaxPositionCalculation

Long-side calculation.

longCloseQuantitystring

Long side closable quantity (`long_position_quantity` minus the already-placed close-long orders).

longPositionQuantitystring

Current long position quantity.

marginModestring

Margin mode: `cross` or `isolated`.

positionModestring

Position mode: `oneWay` or `hedge`.

sellPricestring

Sell price used in the calculation.

shortMaxPositionCalculation

Short-side calculation.

shortCloseQuantitystring

Short side closable quantity (`short_position_quantity` minus the already-placed close-short orders).

shortPositionQuantitystring

Current short position quantity.

symbolstring

Trading-pair symbol.

userstring

User address.

successboolean

`false` on error, with `code` set and the text in `message` instead of `data`.

Response example
{
  "success": true,
  "code": 0,
  "data": {
    "availableToTrade": "",
    "buyPrice": "0",
    "long": {
      "leverage": 0,
      "maxQuantity": "0",
      "requiredFee": "",
      "requiredMargin": "",
      "totalCost": ""
    },
    "longCloseQuantity": "0",
    "longPositionQuantity": "0",
    "marginMode": "",
    "positionMode": "",
    "sellPrice": "0",
    "short": {
      "leverage": 0,
      "maxQuantity": "0",
      "requiredFee": "",
      "requiredMargin": "",
      "totalCost": ""
    },
    "shortCloseQuantity": "0",
    "shortPositionQuantity": "0",
    "symbol": "",
    "user": "0x0000000000000000000000000000000000000000"
  }
}