Get Margin Groups

Returns your MarginX margin groups with valuations, outstanding debt, borrowing capacity, LTV and MMR.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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 typeCan callScope
Main User Level API key (also the Main Portfolio key)YesMargin groups belonging to the main user.
Sub-user Level API keyNoNot supported by this endpoint.
Dedicated Sub Portfolio Level API keyNoNot supported by this endpoint.
Exchange-native API keyNoUse an LTP Open API key, not an exchange's own key.

Query parameters

All query parameters are optional.

NameTypeDefaultDescription
pageinteger1One-based page number. Zero, negative or empty values use 1.
pageSizeinteger20Number of groups per page, maximum 1000. Zero, negative or empty values use 20.
quoteCurrencystringUSDValuation currency: USD, BTC or USDT. Input is case-insensitive; response values are uppercase. An empty value is invalid; omit the parameter to use USD.
sortBystringtotalValueSort field: totalValue, totalDebt, maxAvailableBorrow, ltv, mmr or name. An empty value uses totalValue.
sortDirectionstringDESCSort 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 page or pageSize return 1002. A valid integer pageSize greater than 1000 returns 100400.
  • A page beyond the last page returns list: [] and retains the matching totalSize.
  • 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.

FieldTypeDescription
codeintegerApplication result code. 200 means success.
messagestringResult message; success on a successful request.
data.pageintegerPage number used for this query.
data.pageSizeintegerPage size used for this query.
data.totalSizeintegerTotal number of matching groups, not the number of rows on this page.
data.listarray of objectsGroups on the requested page. No matching groups or a page beyond the end returns an empty array.

Group fields: data.list[]

FieldTypeDescription
idstringMargin group ID. This is not a DMA account ID or a RapidX Portfolio ID.
namestringMargin group name.
quoteCurrencystringCurrency used to value this group: USD, BTC or USDT.
totalValuestringTotal asset valuation of this group, in quoteCurrency.
totalDebtstringCombined outstanding principal and interest valuation, in quoteCurrency.
maxAvailableBorrowstringAvailable borrowing capacity expressed as a valuation in quoteCurrency, not the quantity of a particular borrowable currency.
ltvstring or nullGroup loan-to-value ratio (LTV). null when unavailable.
mmrstring or nullGroup 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.

CodeWhen it occursWhat to do
1002page 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.
100400pageSize is greater than 1000, or quoteCurrency, sortBy or sortDirection is invalid.Use the supported values above.
2003The calling API key level is not allowed to access this endpoint.Use a Main User Level LTP API key.
2004The key lacks the required permission.Use a key with READ permission.
100429The API key exceeds the rate limit.Reduce the request rate and retry after the rate-limit window.
Query Params
integer
Defaults to 1

One-based page number; non-positive or empty values use 1. Invalid integer format or range returns 1002.

integer
≤ 1000
Defaults to 20

Records per page; non-positive or empty values use 20. More than 1000 returns 100400.

string
enum
Defaults to USD

Valuation currency. Input is case-insensitive. Empty is invalid; omit to use USD.

Allowed:
string
enum
Defaults to totalValue

Sort field. Empty uses totalValue. Names are sorted case-sensitively.

Allowed:
string
enum
Defaults to DESC

Sort direction. Input is case-insensitive. Empty uses DESC.

Allowed:
Headers
string
required

Current Unix timestamp in whole seconds. Use the same value when computing the signature.

string
required

HMAC-SHA256 hex signature. See Authentication for the signing algorithm.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json