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

clearinghouseState

Full clearinghouse state (positions + margin summary) for one sub-account.

POST/infotype clearinghouseState

Load the Positions panel: every position plus the margin summary, for the perp or outcome sub-account.

Request body
typestringrequired
userstringrequired
accountTypestringnullableoptional

Optional account type: `perp` or `outcome`.

exchangeIdinteger · int32nullableoptional
Request example
curl -X POST https://rpc.txflow-testnet.xyz/info \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "accountType": "perp",
  "type": "clearinghouseState",
  "user": "0x0000000000000000000000000000000000000000"
}'
Try it
POST https://rpc.txflow-testnet.xyz/info
Response · UserStateResponse 200
codeinteger

`0` on success.

dataUserStateResponse
accountValuePlusWithdrawHoldstring

Total account equity plus pending withdrawals = accountValue + withdrawHold.

assetPositionsAssetPosition[]
crossMaintenanceMarginUsedstring
crossMarginRatiostring

Cross-margin ratio = (balance + crossUnRealPnl) / (crossMaintenanceMargin + crossLiqFee). OKX-style: higher is safer; liquidation triggers when the ratio drops to `<= 1.0`.

crossMarginSummaryMarginSummary
marginSummaryMarginSummary
timeinteger · int64
totalRawUsdPlusWithdrawHoldstring

Total raw USD balance plus pending withdrawals = totalRawUsd + withdrawHold.

vaultEquitystring
withdrawablestring
activeReverseJobsActiveReverseJob[]
successboolean

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

Response example
{
  "success": true,
  "code": 0,
  "data": {
    "accountValuePlusWithdrawHold": "",
    "activeReverseJobs": [
      {
        "asset": "4",
        "coin": "4",
        "filledCloseQty": "",
        "marginMode": "",
        "phase": "",
        "positionSzAtStart": ""
      }
    ],
    "assetPositions": [
      {
        "position": {
          "adlQuantile": 0,
          "asset": "4",
          "coin": "4",
          "cumFunding": {
            "allTime": "",
            "sinceChange": "",
            "sinceOpen": ""
          },
          "entryPx": "0",
          "leverage": {
            "rawUsd": "",
            "type": "",
            "value": 0
          },
          "liquidationPx": "0",
          "marginRatio": "",
          "marginUsed": "",
          "markPx": "0",
          "maxLeverage": 0,
          "positionValue": "",
          "returnOnEquity": "",
          "szi": "",
          "unrealizedPnl": "",
          "updateTime": 1700000000000
        },
        "tpsl": [
          {
            "createTime": 1700000000000,
            "quantity": "0",
            "slOid": "",
            "slOrderPrice": "0",
            "slOrderType": "",
            "slTriggerPrice": "0",
            "tpOid": "",
            "tpOrderPrice": "0",
            "tpOrderType": "",
            "tpTriggerPrice": "0"
          }
        ],
        "type": ""
      }
    ],
    "crossMaintenanceMarginUsed": "",
    "crossMarginRatio": "",
    "crossMarginSummary": {
      "accountValue": "",
      "totalMarginUsed": "",
      "totalNtlPos": "",
      "totalRawUsd": ""
    },
    "marginSummary": {
      "accountValue": "",
      "totalMarginUsed": "",
      "totalNtlPos": "",
      "totalRawUsd": ""
    },
    "time": 1700000000000,
    "totalRawUsdPlusWithdrawHold": "",
    "vaultEquity": "",
    "withdrawable": ""
  }
}

accountType selects the sub-account: perp or outcome. For Outcome, exchangeId optionally limits the result to one channel. For the token balances of the perp sub-account, use perpClearinghouseState; for Outcome positions alone, use outcomePositions.