userAccount query returns your account’s complete financial state for a given Market Deployer: cross equity, margin availability, collateral balances, and all open positions. Pass marketDeployerId: 0 for the account-wide view: account-level fields and all portfolio groups, with the per-Market Deployer section empty.
All numeric values are raw integer strings; convert them with exact decimal arithmetic, never floating point. Most fields on this page are amounts and use the settlement coin’s
szDecimals (raw / 10^szDecimals), where the settlement coin is the Market Deployer’s settleCoinId in configs. Only positions[].size uses the contract’s qtyScale, and only positions[].liqPx uses its priceScale.Request
string
required
type (required) — Must be "userAccount".string
required
accountId (required) — Your account ID, obtained from the registerAccount action.integer
required
marketDeployerId (required) — Market Deployer to query. Use 0 for the account-wide view: account-level fields and all portfolio group views are returned, and the per-Market Deployer section (margin fields, collateral, positions, fee fields) is empty.Response
string
Always
"userAccount".string
The account ID from the request.
integer
The Market Deployer ID from the request.
Margin Fields
string
Total cross margin equity: the sum of your cross collateral and unrealized PnL across all cross positions (raw integer string).
string
Margin currently reserved to cover the worst-case cost of your open orders (raw integer string).
string
Adverse price difference between your open order prices and the current mark price, representing potential additional margin consumption (raw integer string).
string
Free cross margin:
crossEquity - orderFrozen - orderLoss (raw integer string).string
Margin available to open new positions:
marginAvailable - totalPositionIM (raw integer string).string
Sum of initial margin allocated to all open cross positions (raw integer string).
string
Total maintenance margin across all cross positions. Liquidation is triggered when
crossEquity falls below this value (raw integer string).Collateral[]
List of collateral balances in the cross margin pool. Each entry contains
coinId (integer) and amount (raw integer string).Collateral[]
List of collateral balances allocated to isolated margin positions. Each entry contains
posKey (string, the position composite key of contractId and side), coinId (integer), positionId (string, the unique ID of the position this collateral belongs to, matching positions[].id), and amount (raw integer string).Position Fields
object[]
Open positions under this Market Deployer. Each element carries the fields below.
string
Unique position ID as an int64 decimal string. Assigned when the position is first opened; closing a position and reopening in the opposite direction creates a new position with a new ID. Use it to line positions up with the history queries.
integer
The contract this position belongs to. Cross-reference with
configs to get the contract name and scales.string
Position mode:
"OneWay" for one-way mode, "L" for hedge-mode long, or "S" for hedge-mode short.string
Absolute position quantity (raw integer string). Divide by
10^qtyScale from configs to get the display value.string
Cumulative opening value of the position, an amount in the settlement coin (raw integer string). Divide by
10^szDecimals of the settlement coin to get the display value.boolean
true if the position is long (net buyer); false if short (net seller).string
Current leverage applied to this position.
boolean
true if this position uses isolated margin; false if it draws from the cross margin pool.string
The cumulative funding index recorded when this position was last settled. Used to compute accrued-but-unpaid funding:
(currentFundingIndex - fundingIndex) × size.string
Mark-price unrealized profit or loss (raw integer string). Negative values represent a loss.
string
Net funding already settled on this position, cumulative and signed (raw integer string). Positive means net received, negative means net paid.
string
Maintenance margin allocated to this individual position (raw integer string).
string
Estimated liquidation price (raw integer string) — the mark price at which this position would be liquidated.
Margin share model the position belongs to:
"Unified" or "Portfolio".integer
Share group of the position on a Portfolio account. See
shareGroupState for group definitions.integer
Settlement coin of the position’s group on a Portfolio account.
A PORTFOLIO cross position computes
liqPx on its group’s combined basis; a PORTFOLIO isolated position always reports "0", because such positions are assessed as part of their group rather than individually.Account-Level Fields
These fields describe the whole account and do not depend on themarketDeployerId value you pass.
Account margin model:
"Unified" for standard cross margin, or "Portfolio" for portfolio margin with share groups.string
Account-level monotonic deposit nonce — the value the next deposit should carry. Use this to verify deposit sequencing and detect missing or replayed deposit events.
string
Height of the last committed block that this response reflects, as a decimal string. Two responses with the same
blockHeight have no new block between them. "0" when no block has been committed yet.integer
Denominator of the fee-rate fields on this response: the applied rate is the field value divided by
feePrecision, which is always 100000 (fee rates are scaled by 1e5). It applies to takerOverrideFee, makerOverrideFee, effectiveTakerFee and effectiveMakerFee.integer | null
Per-user taker fee-rate override under this Market Deployer, as originally configured, scaled by 1e5.
null means unset — the rate falls back to the Market Deployer or contract fee. 0 is an explicit 0%, and a negative value is a rebate.integer | null
Per-user maker fee-rate override under this Market Deployer, scaled by 1e5.
null means unset, with the same fallback and sign rules as takerOverrideFee.integer | null
The taker rate actually in force for this account under this Market Deployer, scaled by 1e5, after resolving the per-user override against the Market Deployer’s fee table.
null means neither layer is set — the rate then falls back to each contract’s defaultTakerFee in configs, which can differ per contract, so read it per contract. 0 is an effective 0%, and a negative value is a rebate.integer | null
The maker rate actually in force, scaled by 1e5, resolved the same way as
effectiveTakerFee.integer
Account-level market-order slippage cap, scaled by 1e4, used to price market orders as
mark price ± marketSlippageBps / 1e4. Always a positive value and never null. Set it with updateSlippageSetting.ChainBalance[]
Account-level chain balances, one entry per coin in ascending
coinId order: {coinId, amount, frozen}. An entry is omitted only when both amount and frozen are zero, so an entry with amount of "0" is still returned while frozen is non-zero.amount(string) — available balance (raw integer string).frozen(string) — balance frozen while a withdrawal is pending (raw integer string). A withdrawal moves funds fromamounttofrozenwhen it is requested, soamount + frozenequals the balance before the freeze.
frozen appears only here, not in crossCollaterals or portfolioGroups[].crossBalances. It is unrelated to the top-level orderFrozen, which is margin reserved by open orders.ContractSetting[]
Per-contract settings that have been set explicitly:
{contractId, marginMode, positionMode, leverage}.contractId(integer) — the contract.marginMode(string) —"C"(cross margin) or"I"(isolated margin).positionMode(string) —"OneWay"(one-way mode) or"Hedge"(hedge mode).leverage(string) — the leverage set for the contract."0"means not set; the contract’sdefaultLeveragefromconfigsapplies.
PortfolioGroup[]
Share group views for a PORTFOLIO account; an empty array for a UNIFIED account. Group definitions come from
shareGroupState. Each element contains:groupId,settleCoinId(integer) — the group and its settlement coin.groupCrossEquity,orderFrozen,orderLoss,marginAvailable,totalPositionIM,crossPositionMM(string) — the margin fields above, computed over the group’s pool.crossBalances(array) —{coinId, amount}per coin in the group’s cross pool.isoBalances(array) —{posKey, positionId, amount}per isolated position;positionId(string) is the unique position ID, or"0"when the position no longer exists.
Account structure fields
These fields describe the account’s place in the account hierarchy and do not depend onmarketDeployerId.
integer
Account kind:
0 user account, 1 sub-account, 2 role account, 3 system account.string
Parent account ID: the master account of a sub-account, the creator of a role account, or the owning role account of a system account.
"0" for a user account.integer
Fund-flow policy:
0 no special policy; 1 managed, meaning funds move in and out only through vault operations.integer
Subtype of a system account.
0 for any account that is not a system account.integer
Market Deployer ID the account is bound to (vault accounts and their sub-accounts).
0 when unbound.integer
Number of sub-accounts under this account.
string
Cumulative traded notional value, an amount (raw integer string). The trading-volume requirement for creating a sub-account is checked against this value.
