Trading

Set leverage for a specific trading pair on a perpetual connector.

Args: account_name: Name of the account connector_name: Name of the perpetual connector request: Leverage request with trading pair and leverage value accounts_service: Injected accounts service

Returns: Dictionary with success status and message

Raises: HTTPException: 400 for invalid parameters or non-perpetual connector, 404 for account/connector not found, 500 for execution errors

post/trading/{account_name}/{connector_name}/leverage

Request

  • Base URL
    http://localhost:8000
  • URL
    http://localhost:8000/trading/{account_name}/{connector_name}/leverage
  • Auth
    HTTP basic

Path parameters

account_namestring required
connector_namestring required

Request body

trading_pairstring required

Trading pair (e.g., BTC-USDT)

leverageinteger required

Leverage value (typically 1-125)

Response

Successful Response

unknown required

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • breaking

      the response's body type changed from object to no type for status