userLeverageUpdates

Stream live leverage updates for specific users.

New endpoint - this endpoint is not a part of original Hyperliquid API and is added by us for builder convenience.

Subscribe

{
    "method": "subscribe",
    "subscription": {
        "type": "userLeverageUpdates",
        "addresses": ["0x742d35Cc6634C0532925a3b844Bc9e7595f7F2e2"]
    }
}

Unsubscribe

{
    "method": "unsubscribe",
    "subscription": {
        "type": "userLeverageUpdates",
        "addresses": ["0x742d35Cc6634C0532925a3b844Bc9e7595f7F2e2"]
    }
}

Update data format

Updates are batched per block, sorted by tx_index. This stream includes all three update types: leverage changes, isolated margin updates, and top-up isolated margin updates — combined and interleaved in block order for the subscribed addresses.

Reconnection Note: When reconnecting with a session, replay and live events may overlap. Deduplicate using (time, tx_index) - skip updates where this tuple is at or before your last processed update. See Session Management for details.

For isolated margin updates only (without leverage changes), see userIsolatedMarginUpdates.

Leverage update

Sent when a user changes their leverage setting (updateLeverage action).

Isolated margin update

Sent when a user adds or removes isolated margin on a position (updateIsolatedMargin action).

Top-up isolated margin update

Sent when a user adjusts their isolated margin to reach a target leverage (topUpIsolatedOnlyMargin action).

Field reference

Fields vary by update_type:

Field
Type
Present in
Description

update_type

string

all

"leverage", "isolated_margin", or "top_up_isolated_margin"

time

number

all

Block timestamp (milliseconds since epoch)

user

string

all

User address (lowercase)

coin

string

all

Coin/market name (e.g. "ETH", "BTC")

tx_index

number

all

Transaction index within the block

is_cross

bool

leverage

Whether cross margin mode

leverage

number

leverage

New leverage value

is_buy

bool

isolated_margin

Side of the margin change

ntli

string

isolated_margin

Amount of margin added or removed

target_leverage

string

top_up_isolated_margin

Target leverage as float string

Examples

Common errors

Last updated