Returns your MarginX margin groups with valuations, outstanding debt, borrowing capacity, LTV and MMR.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Returns a paginated list of your MarginX margin groups, including each group's asset valuation, outstanding debt, available borrowing capacity, LTV and MMR.
Rate limit: 10 requests per minute per API key.
API key access
Requires a signed LTP Open API request with READ permission. See Authentication for signing instructions.
| API key type | Can call | Scope |
|---|---|---|
| Main User Level API key (also the Main Portfolio key) | Yes | Margin groups belonging to the main user. |
| Sub-user Level API key | No | Not supported by this endpoint. |
| Dedicated Sub Portfolio Level API key | No | Not supported by this endpoint. |
| Exchange-native API key | No | Use an LTP Open API key, not an exchange's own key. |
Query parameters
All query parameters are optional.
| Name | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | One-based page number. Zero, negative or empty values use 1. |
pageSize | integer | 20 | Number of groups per page, maximum 1000. Zero, negative or empty values use 20. |
quoteCurrency | string | USD | Valuation currency: USD, BTC or USDT. Input is case-insensitive; response values are uppercase. An empty value is invalid; omit the parameter to use USD. |
sortBy | string | totalValue | Sort field: totalValue, totalDebt, maxAvailableBorrow, ltv, mmr or name. An empty value uses totalValue. |
sortDirection | string | DESC | Sort direction: ASC or DESC. Input is case-insensitive. An empty value uses DESC. |
Pagination and sorting
- Non-integer or out-of-range integer values for
pageorpageSizereturn1002. A valid integerpageSizegreater than1000returns100400. - A page beyond the last page returns
list: []and retains the matchingtotalSize. - Groups are sorted before pagination. Equal sort values use group ID as the secondary sort key, in the same direction. Name sorting is case-sensitive.
- Unsupported valuation currencies, sort fields or sort directions return
100400; they are not silently replaced with defaults.
Response fields
data contains the pagination fields and group list. Monetary values and ratios are decimal strings; group IDs are strings.
| Field | Type | Description |
|---|---|---|
code | integer | Application result code. 200 means success. |
message | string | Result message; success on a successful request. |
data.page | integer | Page number used for this query. |
data.pageSize | integer | Page size used for this query. |
data.totalSize | integer | Total number of matching groups, not the number of rows on this page. |
data.list | array of objects | Groups on the requested page. No matching groups or a page beyond the end returns an empty array. |
Group fields: data.list[]
data.list[]| Field | Type | Description |
|---|---|---|
id | string | Margin group ID. This is not a DMA account ID or a RapidX Portfolio ID. |
name | string | Margin group name. |
quoteCurrency | string | Currency used to value this group: USD, BTC or USDT. |
totalValue | string | Total asset valuation of this group, in quoteCurrency. |
totalDebt | string | Combined outstanding principal and interest valuation, in quoteCurrency. |
maxAvailableBorrow | string | Available borrowing capacity expressed as a valuation in quoteCurrency, not the quantity of a particular borrowable currency. |
ltv | string or null | Group loan-to-value ratio (LTV). null when unavailable. |
mmr | string or null | Group maintenance margin ratio (MMR). null when unavailable. |
quoteCurrency changes the units of totalValue, totalDebt and maxAvailableBorrow; it does not change the group's underlying asset or debt quantities.
Error codes
Business and parameter errors can return HTTP 200 with a non-success JSON code. Always inspect code. See Error Codes for shared authentication, permission and service errors.
| Code | When it occurs | What to do |
|---|---|---|
1002 | page or pageSize cannot be converted to an integer, including an integer outside the supported integer range. | Send integer pagination values. The message identifies the affected field and conversion error. |
100400 | pageSize is greater than 1000, or quoteCurrency, sortBy or sortDirection is invalid. | Use the supported values above. |
2003 | The calling API key level is not allowed to access this endpoint. | Use a Main User Level LTP API key. |
2004 | The key lacks the required permission. | Use a key with READ permission. |
100429 | The API key exceeds the rate limit. | Reduce the request rate and retry after the rate-limit window. |
