Skip to content
Alchemy Logo

userLeverageUpdates stream

This API is in private preview. Target September 2026; timing is subject to change.

Streams leverage, isolated-margin, and isolated-margin top-up updates for the requested addresses.

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

{
  "type": "userLeverageUpdates",
  "channel": "userLeverageUpdates",
  "seq": 1,
  "cursor": 1704067200000,
  "updates": [{
    "updateType": "updateLeverage",
    "time": 1704067200000,
    "user": "0x1111111111111111111111111111111111111111",
    "coin": "ETH",
    "isCross": true,
    "leverage": 10,
    "txIndex": 0
  }]
}

The stream also emits updateIsolatedMargin records with isBuy and ntli, and topUpIsolatedOnlyMargin records with targetLeverage.

These are normalized events derived from on-chain actions: asset IDs are resolved to market symbols and integer quantities are converted to decimal strings.

FieldTypeDescription
typestringEvent type.
channelstringRouting channel for the event.
seqintegerMonotonic sequence number for the stream.
cursorintegerResume cursor for the event position.
updatesarrayLeverage-setting update records.
updates[]objectLeverage, isolated-margin, or isolated-margin top-up record.
updates[].updateTypestringUpdate discriminator: updateLeverage, updateIsolatedMargin, or topUpIsolatedOnlyMargin.
updates[].timeintegerEvent time in milliseconds.
updates[].userstringAddress whose setting changed.
updates[].coinstringMarket identifier.
updates[].isCrossbooleanWhether a leverage update uses cross margin.
updates[].leverageintegerLeverage setting for a leverage update.
updates[].isBuybooleanIsolated-margin side for an updateIsolatedMargin update.
updates[].ntlistringIsolated-margin notional value for an updateIsolatedMargin update.
updates[].targetLeveragestringTarget leverage for a topUpIsolatedOnlyMargin update.
updates[].txIndexintegerIndex of the transaction within its block.

The stream batches updates for the subscribed addresses. The cursor identifies the event position for resumption.

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

To resume a stream, supply cursor in the subscription object. Store and return the cursor unmodified.

Was this page helpful?