HomeDocumentationAPI Reference
Log In
API Reference

Margin Watch

Channel Name Schema

margin.watch

Subscribe to state of margin and MtM of all users.

Channel Parameters

Notification Data

channelstringrequired
Subscribed channel name
dataarray of objectsrequired
data[].currencystringrequired
Currency of subaccount
data[].initial_marginstringrequired
Total initial margin requirement of all positions and collaterals.
data[].maintenance_marginstringrequired
Total maintenance margin requirement of all positions and collaterals.If this value falls below zero, the subaccount will be flagged for liquidation.
data[].margin_typestringrequired
Margin type of subaccount (PM (Portfolio Margin), PM2 (Portfolio Margin 2), or SM (Standard Margin))
enum PMSMPM2
data[].subaccount_idintegerrequired
Subaccount_id
data[].subaccount_valuestringrequired
Total mark-to-market value of all positions and collaterals
data[].valuation_timestampintegerrequired
Timestamp (in seconds since epoch) of when margin and MtM were computed.
data[].collateralsarray of objectsrequired
All collaterals that count towards margin of subaccount
data[].collaterals[].amountstringrequired
Asset amount of given collateral
data[].collaterals[].asset_namestringrequired
Asset name
data[].collaterals[].asset_typestringrequired
Type of asset collateral (currently always erc20)
enum erc20optionperp
data[].collaterals[].deltastringrequired
Delta of the collateral relative to delta_currency
data[].collaterals[].delta_currencystringrequired
Currency that this collateral's delta is correlated to
data[].collaterals[].initial_marginstringrequired
USD value of collateral that contributes to initial margin
data[].collaterals[].maintenance_marginstringrequired
USD value of collateral that contributes to maintenance margin
data[].collaterals[].mark_pricestringrequired
Current mark price of the asset
data[].collaterals[].mark_valuestringrequired
USD value of the collateral (amount * mark price)
data[].positionsarray of objectsrequired
All active positions of subaccount
data[].positions[].amountstringrequired
Position amount held by subaccount
data[].positions[].deltastringrequired
Asset delta (w.r.t. forward price for options, 1.0 for perps)
data[].positions[].gammastringrequired
Asset gamma (zero for non-options)
data[].positions[].index_pricestringrequired
Current index (oracle) price for position's currency
data[].positions[].initial_marginstringrequired
USD initial margin requirement for this position
data[].positions[].instrument_namestringrequired
Instrument name (same as the base Asset name)
data[].positions[].instrument_typestringrequired
erc20, option, or perp
enum erc20optionperp
data[].positions[].liquidation_pricestring or nullrequired
Index price at which position will be liquidated
data[].positions[].maintenance_marginstringrequired
USD maintenance margin requirement for this position
data[].positions[].mark_pricestringrequired
Current mark price for position's instrument
data[].positions[].mark_valuestringrequired
USD value of the position; this represents how much USD can be recieved by fully closing the position at the current oracle price
data[].positions[].thetastringrequired
Asset theta (zero for non-options)
data[].positions[].vegastringrequired
Asset vega (zero for non-options)

Example

Subscriptions are only available via websockets.

{request_example_javascript}
{request_example_python}

Notification messages on this channel will look like this:

{response_example_json}