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

preCheckIsolatedMarginAdjust

Returns one isolated position with the most margin that can be added or removed, and, when ntli is set, a preview of the position after that adjustment. Use it to fill an Adjust Margin dialog before signing updateIsolatedMargin. Nothing is written.

POST/infotype preCheckIsolatedMarginAdjust

Fill the Adjust Margin dialog: max add / remove and the new liquidation price before updateIsolatedMargin.

Request body
assetstringrequired

Perp instrument id (`index` from `perpMeta`).

sidestringrequired

Side of the isolated position.

"long""short"
typestringrequired

Must be `preCheckIsolatedMarginAdjust`.

"preCheckIsolatedMarginAdjust"
userstring · addressrequired

Position owner.

ntlistringoptional

Amount to preview, in decimal USDC: positive adds margin, negative removes it. Omit to read the limits only.

Request example
curl -X POST https://rpc.txflow-testnet.xyz/info \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "type": "preCheckIsolatedMarginAdjust",
  "user": "0x06361e568c6375a376e4244b1435b4dd8ea1e247",
  "asset": "30",
  "side": "long",
  "ntli": "1"
}'
Try it
POST https://rpc.txflow-testnet.xyz/info
Response 200
codeinteger

`0` on success.

dataobject
positionobject
successboolean

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

Response example
{
  "success": true,
  "code": 0,
  "data": {
    "position": {
      "coin": "HBAR-USDC",
      "side": "Long",
      "szi": "65800",
      "entryPrice": "0.08000",
      "markPrice": "0.08465",
      "margin": "126.76",
      "leverage": 50,
      "effectiveLeverage": "12.87",
      "unrealizedPnl": "306.00",
      "liquidationPrice": "0.07891",
      "maxIncrease": "1135.01",
      "maxDecrease": "21.48",
      "preview": {
        "adjustAmount": "1.00",
        "newMargin": "127.76",
        "newLiquidationPrice": "0.07889",
        "newEffectiveLeverage": "12.84"
      }
    }
  }
}

ntli here is a decimal USDC string: "1" previews adding 1 USDC and "-1" previews removing 1 USDC. updateIsolatedMargin takes the same amount as a 6-decimal integer ("1000000").

Without ntli, the response has no preview. A typical dialog calls once without ntli to show maxIncrease / maxDecrease, then again as the user types an amount.

Next steps

Apply the change with updateIsolatedMargin, then read the position from clearinghouseState.