Skip to main content
GET
/
api
/
v1
/
accounts
/
cap
curl -X GET "https://api.roxom.com/api/v1/accounts/cap?symbol=OIL-BTC&capType=leverage" \
  -H "X-API-Key: your_api_key_here" \
  -H "X-API-Signature: your_rsa_signature_here"
{
  "data": {
    "value": "10.0000"
  },
  "error": false
}

Get Account Cap

Retrieve account cap values for a specific symbol. Account caps define the maximum limits for leverage, position value, or order value based on your account configuration.

Endpoint

GET /api/v1/accounts/cap

Parameters

X-API-Key
string
required
RSA public key identifier for authentication
X-API-Signature
string
required
Base64-encoded RSA signature of the request payload. Payload format: GET:/api/v1/accounts/cap?symbol={symbol}&capType={capType}
symbol
string
required
Trading symbol to get cap for (e.g., “OIL-BTC”, “GOLD-BTC”)
capType
string
required
Type of cap to retrieve:
  • leverage - Maximum leverage allowed
  • positionValue - Maximum position value allowed
  • orderValue - Maximum order value allowed

Example Request

curl -X GET "https://api.roxom.com/api/v1/accounts/cap?symbol=OIL-BTC&capType=leverage" \
  -H "X-API-Key: your_api_key_here" \
  -H "X-API-Signature: your_rsa_signature_here"

Response

{
  "data": {
    "value": "10.0000"
  },
  "error": false
}

Response Fields

data
object
Account cap data
error
boolean
Indicates if the request failed

Cap Types

capType=leverageReturns the maximum leverage you can use for the specified symbol. This value represents the highest leverage multiplier allowed for your account on this instrument.Example Value: "10.0000" (10x leverage)Use Case: Before setting leverage, check the maximum allowed leverage for your account to ensure your desired leverage is within limits.
capType=positionValueReturns the maximum total value of positions you can hold for the specified symbol. The value is in BTC.Example Value: "5.00000000" (5 BTC maximum position value)Use Case: Before opening or increasing a position, verify that the new position value won’t exceed your account’s position limit.
capType=orderValueReturns the maximum value of a single order you can place for the specified symbol. The value is in BTC.Example Value: "2.50000000" (2.5 BTC maximum order value)Use Case: Before placing a large order, check that the order value is within your account’s order limit to avoid rejection.

Use Cases

Pre-Trade Validation

async function validateOrder(symbol, orderSize, price, leverage) {
  // Get all relevant caps
  const leverageCap = await getAccountCap(symbol, 'leverage');
  const orderCap = await getAccountCap(symbol, 'orderValue');
  const positionCap = await getAccountCap(symbol, 'positionValue');
  
  // Calculate order value
  const orderValue = (orderSize * price) / leverage;
  
  // Validate leverage
  if (leverage > parseFloat(leverageCap.data.value)) {
    throw new Error(`Leverage ${leverage} exceeds maximum ${leverageCap.data.value}`);
  }
  
  // Validate order value
  if (orderValue > parseFloat(orderCap.data.value)) {
    throw new Error(`Order value ${orderValue} exceeds maximum ${orderCap.data.value}`);
  }
  
  return true;
}

Account Limits Dashboard

async function getAccountLimits(symbols) {
  const limits = {};
  
  for (const symbol of symbols) {
    limits[symbol] = {
      maxLeverage: await getAccountCap(symbol, 'leverage'),
      maxPositionValue: await getAccountCap(symbol, 'positionValue'),
      maxOrderValue: await getAccountCap(symbol, 'orderValue')
    };
  }
  
  return limits;
}

// Usage
const symbols = ['OIL-BTC', 'GOLD-BTC', 'US500-BTC'];
const accountLimits = await getAccountLimits(symbols);

console.log('Account Trading Limits:');
symbols.forEach(symbol => {
  console.log(`\n${symbol}:`);
  console.log(`  Max Leverage: ${accountLimits[symbol].maxLeverage.data.value}x`);
  console.log(`  Max Position: ${accountLimits[symbol].maxPositionValue.data.value} BTC`);
  console.log(`  Max Order: ${accountLimits[symbol].maxOrderValue.data.value} BTC`);
});

Notes

Symbol-Specific: Account caps are specific to each trading symbol. Different instruments may have different cap values based on their risk profiles and your account tier.
Account Tier: Cap values may vary based on your account verification level, trading volume, or account type. Higher-tier accounts typically have higher caps.
Related Endpoints:
  • Use Set Leverage to change your leverage (within the cap limits)
  • Use Get Leverage to check your current leverage setting
Dynamic Values: Account caps can change based on account status, verification level, or platform risk parameters. Always check caps before placing large orders or changing leverage settings.

Error Responses

400 Bad Request
Invalid parameters or missing required fields
{
  "data": {
    "code": 400,
    "message": "Invalid capType parameter"
  },
  "error": true
}
404 Not Found
Symbol not found or not available
{
  "data": {
    "code": 404,
    "message": "Instrument not found"
  },
  "error": true
}
401 Unauthorized
Authentication failed
{
  "data": {
    "code": 4001,
    "message": "Unauthorized"
  },
  "error": true
}