> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ekiden.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Set leverage

> Set leverage for a symbol



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/position/set-leverage
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.ekiden.fi/
    description: Production
  - url: https://api.staging.ekiden.fi/
    description: Staging
  - url: https://api.dev.ekiden.fi/
    description: Development
  - url: http://localhost:4020/
    description: Local
security: []
paths:
  /api/v1/position/set-leverage:
    post:
      tags:
        - Position
      summary: Set leverage
      description: Set leverage for a symbol
      operationId: set_leverage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetLeverageRequest'
        required: true
      responses:
        '200':
          description: Leverage updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetLeverageResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    SetLeverageRequest:
      type: object
      description: Request to set leverage.
      required:
        - sub_account_address
        - symbol
        - leverage
      properties:
        leverage:
          type: string
        sub_account_address:
          type: string
        symbol:
          $ref: '#/components/schemas/Symbol'
    SetLeverageResponse:
      type: object
      description: Set leverage response.
      required:
        - success
        - time
      properties:
        success:
          type: boolean
        time:
          type: string
          format: date-time
          example: '1672531200000'
    Symbol:
      type: string
      example: BTCUSDC
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````