Get Leverage
Returns the leverage selected for a subaccount: one entry per market where a leverage was set with Update Leverage. A market without an entry uses its maximum leverage.
Each entry carries the custom initial margin fraction in parts per million; the leverage is 1,000,000 / custom_imf_ppm.
Method Declaration
TypeScript
async getPerpetualMarketsLeverage(
address: string,
subaccountNumber: number,
): Promise<ClobModule.QueryLeverageResponse>Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner | path | Address | true | Address of the account that owns the subaccount |
number | path | u32 | true | Subaccount number |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | ClobPairLeverageInfo | clob_pair_leverage: selected leverage per clob pair |
400 | Bad Request | The request was malformed or invalid. |
{ "clob_pair_leverage": [{ "clob_pair_id": 3, "custom_imf_ppm": 500000 }] }Here clob pair 3 (XRP-USD) is set to 2×.
Examples: API