Skip to main content

updateLeverage

Update the leverage setting for a specific asset position. This action allows traders to adjust their risk exposure and switch between cross and isolated margin modes.

Sample Data#

{
"signature": {
"r": "0x10b0a002706afea1c9e337ac501fd52a96fb8ddad544b2b6a3a663e0c2e16e51",
"s": "0x5906914d9c472e585e13b52e9435fb1d9980022d625559b566a3541c0f92d5a2",
"v": 28
},
"action": {
"type": "updateLeverage",
"asset": 110000,
"isCross": false,
"leverage": 7
},
"nonce": 1768146912541
}

View this transaction on Hypurrscan →

Field Reference#

Action Fields#

FieldTypeDescription
typestringAlways "updateLeverage"
assetnumberAsset index to update leverage for
isCrossbooleantrue for cross margin, false for isolated margin
leveragenumberNew leverage value (e.g., 2 for 2x leverage)

Margin Modes#

Cross Margin (isCross: true)#

  • Shares margin across all positions
  • Unrealized PnL from other positions can prevent liquidation
  • More capital efficient but higher risk of cascade liquidations

Isolated Margin (isCross: false)#

  • Each position has dedicated margin
  • Losses are limited to the position's margin
  • Requires more capital but limits downside exposure

Use Cases#

Risk Management Monitoring#

Track leverage changes to understand trader risk appetite:

def process_updateLeverage_action(action):
asset = action.get('asset')
leverage = action.get('leverage')
margin_mode = 'cross' if action.get('isCross') else 'isolated'

print(f"Leverage update: asset {asset} -> {leverage}x ({margin_mode})")

Liquidation Risk Analysis#

Monitor leverage increases that may indicate higher liquidation risk.

Market Sentiment#

Aggregate leverage changes can indicate market sentiment:

  • Increasing leverage = More aggressive/bullish positioning
  • Decreasing leverage = More conservative/risk-off