Manager Updates
Stream real-time margin manager lifecycle events across all DeepBook Margin pools. This stream delivers manager creation events, collateral deposits, withdrawals, and liquidations as they occur on-chain.
Event Types
This stream emits multiple event types:
| Type | Description |
|---|---|
deepbook_margin_manager_updates_manager_created | New margin manager created |
deepbook_margin_manager_updates_deposit | Collateral deposited |
deepbook_margin_manager_updates_withdraw | Collateral withdrawn |
deepbook_margin_manager_updates_liquidation | Position liquidated |
Endpoint
GET /deepbook-margin/manager-updates
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api-key | string | Yes | Your Surflux API key (query parameter) |
last-id | string | No | Resume from events after this ID |
Last-ID Options
| Value | Description |
|---|---|
<event-id> | Resume from events after this specific ID |
0 | Consume from the beginning (server retention limits apply) |
$ | Consume only real-time events (skip historical) |
Event Structures
Manager Created
Emitted when a new margin manager is created.
{
"type": "deepbook_margin_manager_updates_manager_created",
"timestamp_ms": 1758629823918,
"checkpoint_id": 193054501,
"tx_hash": "FgUfRsYpC6ynW3pRvtgCLaa4WniBZYdsSLP94jrZ3pj7",
"data": {
"margin_manager_id": "0xabc123def456789abc123def456789abc123def456789abc123def456789abc1",
"balance_manager_id": "0x939adae6836dd87de7b7a2a48a5bd703dc1add7eb304d0c580217e000ccd2b10",
"deepbook_pool_id": "0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407",
"owner": "0xb117b12facd947cabb3d17d68a67b3d8d6865280edb0644cb4d25a9d86646966",
"timestamp": 1758629823805
}
}
Manager Created Fields
| Field | Type | Description |
|---|---|---|
margin_manager_id | string | New margin manager ID |
balance_manager_id | string | Associated balance manager |
deepbook_pool_id | string | DeepBook trading pool |
owner | string | Owner wallet address |
timestamp | number | On-chain timestamp in milliseconds |
Deposit Collateral
Emitted when collateral is deposited into a margin manager.
{
"type": "deepbook_margin_manager_updates_deposit",
"timestamp_ms": 1758629923918,
"checkpoint_id": 193054601,
"tx_hash": "GhVgStZqD7zoX4qSwuhDMbb5XoCjCaBttMQ95ksA4Sk8",
"data": {
"margin_manager_id": "0xabc123def456789abc123def456789abc123def456789abc123def456789abc1",
"base_asset_amount": 500000000000,
"quote_asset_amount": 0,
"timestamp": 1758629923805
}
}
Deposit Fields
| Field | Type | Description |
|---|---|---|
margin_manager_id | string | Margin manager receiving deposit |
base_asset_amount | number | Base asset deposited (in smallest units) |
quote_asset_amount | number | Quote asset deposited (in smallest units) |
timestamp | number | On-chain timestamp in milliseconds |
Withdraw Collateral
Emitted when collateral is withdrawn from a margin manager.
{
"type": "deepbook_margin_manager_updates_withdraw",
"timestamp_ms": 1758630023918,
"checkpoint_id": 193054701,
"tx_hash": "HiWgTuArE8apY5rTxviEOcc6YpDkDbCuuNR06ltB5Tl9",
"data": {
"margin_manager_id": "0xabc123def456789abc123def456789abc123def456789abc123def456789abc1",
"base_asset_amount": 100000000000,
"quote_asset_amount": 0,
"timestamp": 1758630023805
}
}
Withdraw Fields
| Field | Type | Description |
|---|---|---|
margin_manager_id | string | Margin manager withdrawn from |
base_asset_amount | number | Base asset withdrawn (in smallest units) |
quote_asset_amount | number | Quote asset withdrawn (in smallest units) |
timestamp | number | On-chain timestamp in milliseconds |
Liquidation
Emitted when a margin manager position is liquidated.
{
"type": "deepbook_margin_manager_updates_liquidation",
"timestamp_ms": 1758630123918,
"checkpoint_id": 193054801,
"tx_hash": "IjXhUvBsF9bqZ6sTywiEPdd7ZqEkEcDvvOS17muC6Um0",
"data": {
"margin_manager_id": "0xabc123def456789abc123def456789abc123def456789abc123def456789abc1",
"margin_pool_id": "0x4405b50d791fd3346754e8171aaab6bc2ed26c2c46efdd033c14b30ae507ac33",
"liquidation_amount": 200000000000,
"pool_reward": 5000000000,
"pool_default": 0,
"risk_ratio": 1120000,
"remaining_base_asset": 500000000000,
"remaining_quote_asset": 100000000,
"timestamp": 1758630123805
}
}
Liquidation Fields
| Field | Type | Description |
|---|---|---|
margin_manager_id | string | Liquidated margin manager |
margin_pool_id | string | Margin pool the debt was in |
liquidation_amount | number | Amount of debt liquidated |
pool_reward | number | Reward retained by the pool |
pool_default | number | Bad debt absorbed by pool (if any) |
risk_ratio | number | Risk ratio at liquidation (× 1,000,000) |
remaining_base_asset | number | Remaining base collateral |
remaining_quote_asset | number | Remaining quote collateral |
timestamp | number | On-chain timestamp in milliseconds |