Get Margin Managers
Query margin managers to view leveraged trading positions. A margin manager wraps a balance manager and enables margin trading on a specific DeepBook pool. This endpoint returns margin managers with their associated loans and deposits.
Endpoints
There are two endpoints for querying margin managers:
By Owner
GET /deepbook-margin/margin-managers/{owner}
Returns margin managers owned by a specific address.
General Query
GET /deepbook-margin/margin-managers
Returns margin managers with optional filters.
Use Cases
- Portfolio View — Display all margin positions for a user's wallet
- Position Monitoring — Track active leveraged positions and their health
- Risk Dashboard — Show collateral, loans, and risk ratios across positions
- Trading Interface — List available margin managers for placing leveraged orders
Parameters
Path Parameters (By Owner endpoint)
| Parameter | Type | Required | Description |
|---|---|---|---|
owner | string | Yes | Owner wallet address |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | No | 0 | Page number for pagination (starts from 0) |
perPage | number | No | 10 | Items per page (max 50) |
balanceManagerId | string | No | — | Filter by balance manager ID |
deepbookPoolId | string | No | — | Filter by DeepBook pool ID |
api-key | string | Yes | — | Your Surflux API key for authentication |
Response
Returns a paginated response with margin manager objects.
Pagination Fields
| Field | Type | Description |
|---|---|---|
items | array | Array of margin manager objects |
isLastPage | boolean | Whether this is the last page |
currentPage | number | Current page number |
perPage | number | Items per page |
Margin Manager Fields
| Field | Type | Description |
|---|---|---|
margin_manager_id | string | Unique margin manager ID |
balance_manager_id | string | Associated balance manager ID |
owner | string | Owner wallet address |
deepbook_pool_id | string | DeepBook trading pool ID |
checkpoint | number | Checkpoint when last updated |
checkpoint_timestamp_ms | number | Timestamp in milliseconds |
onchain_timestamp | number | On-chain timestamp in milliseconds |
digest | string | Transaction digest |
created_at | string | ISO timestamp of creation |
active_loans | array | Array of active loan objects (optional) |
deposit | object | null | Deposit information (optional) |
Active Loan Fields
| Field | Type | Description |
|---|---|---|
margin_manager_id | string | Associated margin manager ID |
margin_pool_id | string | Margin pool borrowed from |
loan_amount | number | Original loan amount |
loan_shares | number | Loan shares (for interest calculation) |
remaining_amount | number | Current remaining debt amount |
remaining_shares | number | Current remaining debt shares |
risk_ratio | number | null | Current risk ratio |
checkpoint | number | Checkpoint of last update |
timestamp | string | ISO timestamp |
digest | string | Transaction digest |
Deposit Fields
| Field | Type | Description |
|---|---|---|
margin_manager_id | string | Associated margin manager ID |
base_asset_amount | number | Base asset collateral amount |
quote_asset_amount | number | Quote asset collateral amount |
last_base_pyth_price | number | Last Pyth oracle price for base |
last_base_pyth_decimals | number | Decimals for base Pyth price |
last_quote_pyth_price | number | Last Pyth oracle price for quote |
last_quote_pyth_decimals | number | Decimals for quote Pyth price |
checkpoint | number | Checkpoint of last update |
timestamp | string | ISO timestamp |
digest | string | Transaction digest |