Docs

updateIsolatedMargin - Adjust Isolated Margin

Add or remove margin from an isolated position on Hyperliquid. Fine-tune position risk without closing trades.

Add or remove margin from an isolated position. This allows fine-tuning position risk without changing the position size or closing the trade.

Sample Data

JSON
{
  "signature": {
    "r": "0xd14b53f9f6b7cb39e5289f62c453f22d21d46def6f7acbc267cb33f1d2d2668f",
    "s": "0x393d89fcd7835fad35ff2b06e29b6c56bd8034efc5bd9b38848c8ac7dd32fbc3",
    "v": 28
  },
  "action": {
    "type": "updateIsolatedMargin",
    "asset": 0,
    "isBuy": true,
    "ntli": -1000000
  },
  "nonce": 1768146925098
}

View this transaction on Hypurrscan

Field Reference

Action Fields

FieldTypeDescription
typestringAlways "updateIsolatedMargin"
assetnumberAsset index (e.g., 0 = BTC)
isBuybooleanPosition side: true for long, false for short
ntlinumberMargin adjustment in raw units (negative = remove, positive = add)

Understanding ntli

The ntli field represents the margin change in raw integer units:

  • Positive values: Add margin to the position (reduce liquidation risk)
  • Negative values: Remove margin from the position (increase liquidation risk)

The value -1000000 in the sample represents removing 1 USD of margin (assuming 6 decimal places for USDC).

Use Cases

Position Risk Monitoring

Track margin adjustments to understand how traders manage position risk:

Python
def process_updateIsolatedMargin_action(action):
    asset = action.get('asset')
    side = 'LONG' if action.get('isBuy') else 'SHORT'
    margin_change = action.get('ntli') / 1_000_000  # Convert to USD

    direction = 'added' if margin_change > 0 else 'removed'
    print(f"Margin {direction}: {abs(margin_change)} USD on {side} {asset}")

Liquidation Prevention Analysis

Monitor margin additions that may indicate positions approaching liquidation.

Capital Efficiency Tracking

Track margin removals to understand how traders optimize capital usage.