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

# Toggle Swap

> Enable or disable swapping on a pro pool. Only the pool creator can call this.

When swapping is disabled, all buy and sell transactions will fail. Useful for pausing trading during migrations or emergencies.



## OpenAPI

````yaml /openapi.json post /tx/pro/toggle-swap
openapi: 3.1.0
info:
  title: heaven-tx-api
  description: ''
  license:
    name: ''
  version: 0.1.14
servers:
  - url: https://tx.api.heaven.xyz
security: []
tags:
  - name: heaven-api
    description: Heaven API
paths:
  /tx/pro/toggle-swap:
    post:
      tags:
        - Pro Pool API
      summary: Toggle Swap
      description: >-
        Enable or disable swapping on a pro pool. Only the pool creator can call
        this.


        When swapping is disabled, all buy and sell transactions will fail.
        Useful for pausing trading during migrations or emergencies.
      operationId: create_pro_toggle_swap_tx
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProToggleSwapTxRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProToggleSwapTxResponse'
components:
  schemas:
    ProToggleSwapTxRequest:
      type: object
      required:
        - pool
        - payer
        - program_id
        - enabled
      properties:
        pool:
          type: string
          description: >-
            On-chain address of the pro pool state account. Returned in the
            response when creating a pool.
        payer:
          type: string
          description: Public key of the wallet that will sign and pay for the transaction.
        program_id:
          type: string
          description: >-
            Program ID of the Heaven DEX program. Use
            `HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o` for mainnet.
        enabled:
          type: boolean
          description: Set to `true` to enable the feature, `false` to disable it.
        compute_unit_limit:
          type: integer
          format: int32
          minimum: 0
          nullable: true
          description: >-
            Maximum compute units for the transaction. Higher values allow more
            complex operations but cost more. Defaults to a sensible value if
            omitted.
        compute_unit_price:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: >-
            Priority fee in micro-lamports per compute unit. Higher values
            increase transaction priority. Defaults to a sensible value if
            omitted.
      description: >-
        Request to toggle swapping on a pro pool. Only the pool creator can call
        this.
    ProToggleSwapTxResponse:
      type: object
      required:
        - tx
      properties:
        tx:
          type: string
          description: >-
            Base64 encoded versioned transaction. Decode, sign with the creator
            wallet, and submit to the Solana network.

````