Cross and Isolated Margin Need Different State Snapshots
By DX Research Group · · Execution mechanics
Collateral sharing changes the meaning of available capacity. A simplified two-position case defines account abstraction and margin-mode fields for agent decisions.
Margin mode determines which collateral pool supports a position. We would include mode, collateral identity and account abstraction in the state snapshot supplied to an agent. Hyperliquid documents cross collateral sharing and asset-constrained isolated margin. Its documentation also distinguishes cross sharing across DEXs according to account abstraction, so a universal account-wide pooling assumption is unsafe.
Available capital has a sharing scope
Illustrative simplified case: an account has $1,000 supporting two cross positions. A $200 adverse mark change on one position reduces shared equity to $800 before other costs. In a different fixture, the same $1,000 is allocated as $400 isolated collateral for position A, $300 for position B and $300 unallocated. A $200 adverse change on A leaves its isolated equity at $200, while B’s assigned collateral remains $300. These calculations describe allocation and marked equity, not liquidation thresholds.
Give the policy the relevant collateral pool
Bind each proposed increase to its actual collateral scope and the latest margin state. Keep configured leverage separate from current effective leverage. Record whether a venue permits margin removal for the instrument and mode. Test an agent that sees the same headline account value under cross and isolated allocations. Its available-size answer should depend on the correct supporting pool and venue state. A second test should alter account abstraction while preserving total funds, requiring refreshed scope interpretation before new exposure.
Inspect the allocation boundary
The simplified allocation example deliberately excludes maintenance tiers, funding, fees and liquidation execution. Those inputs belong in a separate venue-specific risk calculation. Its purpose is to expose the error of treating a headline balance as universally available supporting collateral. For real sizing, query the applicable account and instrument state rather than using the example’s fixed dollar allocations as a rule.
Our execution and reconciliation framework provides the broader mandate-to-outcome trace. The state and memory contract explains how the verified result should enter the next decision. These notes narrow those published methods to one execution boundary; the worked amounts above are illustrative and the test is a proposed local fixture. The source inspected for the venue-specific statements is the official Hyperliquid margining.
Keep the account address and the collateral pool identity visible in every derived capacity field. An apparently reasonable numerical answer against the wrong account remains unusable for authorizing the next venue-ready increase.