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

# Execute Swap

> Execute a swap transaction via router (Jupiter, 0x).

Example:
    connector: 'jupiter'
    network: 'solana-mainnet-beta'
    trading_pair: 'SOL-USDC'
    side: 'BUY'
    amount: 1
    slippage_pct: 1
    wallet_address: (optional, uses default if not provided)

Returns:
    Transaction hash and swap details



## OpenAPI

````yaml /api-reference/openapi.json post /gateway/swap/execute
openapi: 3.1.0
info:
  title: Hummingbot API
  description: API for managing Hummingbot trading instances
  version: 1.0.1
servers:
  - url: http://localhost:8000
    description: Local development server
security: []
paths:
  /gateway/swap/execute:
    post:
      tags:
        - Gateway Swaps
      summary: Execute Swap
      description: |-
        Execute a swap transaction via router (Jupiter, 0x).

        Example:
            connector: 'jupiter'
            network: 'solana-mainnet-beta'
            trading_pair: 'SOL-USDC'
            side: 'BUY'
            amount: 1
            slippage_pct: 1
            wallet_address: (optional, uses default if not provided)

        Returns:
            Transaction hash and swap details
      operationId: execute_swap_gateway_swap_execute_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwapExecuteRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapExecuteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBasic: []
components:
  schemas:
    SwapExecuteRequest:
      properties:
        connector:
          type: string
          title: Connector
          description: DEX router connector (e.g., 'jupiter', '0x')
        network:
          type: string
          title: Network
          description: Network ID in 'chain-network' format (e.g., 'solana-mainnet-beta')
        trading_pair:
          type: string
          title: Trading Pair
          description: Trading pair (e.g., 'SOL-USDC')
        side:
          type: string
          title: Side
          description: 'Trade side: ''BUY'' or ''SELL'''
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: Amount to swap
        slippage_pct:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Slippage Pct
          description: 'Maximum slippage percentage (default: 1.0)'
          default: 1
        wallet_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Wallet Address
          description: Wallet address (optional, uses default if not provided)
      type: object
      required:
        - connector
        - network
        - trading_pair
        - side
        - amount
      title: SwapExecuteRequest
      description: Request to execute a swap
    SwapExecuteResponse:
      properties:
        transaction_hash:
          type: string
          title: Transaction Hash
          description: Transaction hash
        trading_pair:
          type: string
          title: Trading Pair
          description: Trading pair
        side:
          type: string
          title: Side
          description: Trade side
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: Amount swapped
        status:
          type: string
          title: Status
          description: Transaction status
          default: submitted
      type: object
      required:
        - transaction_hash
        - trading_pair
        - side
        - amount
      title: SwapExecuteResponse
      description: Response after executing swap
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic

````