> ## 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.

# Set LP Fee

> Set market cap based LP provider fee brackets on a pro pool. LP fees are distributed proportionally to liquidity providers. Only the pool creator can call this.

**Example** — 0.3% below $500k, 0.1% above:

| `market_cap_upper_bound` | `buy_fee_bps` | `sell_fee_bps` | Effective rate |
|---|---|---|---|
| `500000000000` | `30` | `30` | 0.3% below $500k |
| `9223372036854775807` | `10` | `10` | 0.1% above $500k |



## OpenAPI

````yaml /openapi.json post /tx/pro/set-lp-fee
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/set-lp-fee:
    post:
      tags:
        - Pro Pool API
      summary: Set LP Fee
      description: >-
        Set market cap based LP provider fee brackets on a pro pool. LP fees are
        distributed proportionally to liquidity providers. Only the pool creator
        can call this.


        **Example** — 0.3% below $500k, 0.1% above:


        | `market_cap_upper_bound` | `buy_fee_bps` | `sell_fee_bps` | Effective
        rate |

        |---|---|---|---|

        | `500000000000` | `30` | `30` | 0.3% below $500k |

        | `9223372036854775807` | `10` | `10` | 0.1% above $500k |
      operationId: create_pro_set_lp_fee_tx
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProSetLpFeeTxRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProSetLpFeeTxResponse'
components:
  schemas:
    ProSetLpFeeTxRequest:
      type: object
      required:
        - pool
        - payer
        - program_id
        - brackets
      properties:
        pool:
          type: string
          description: On-chain address of the pro pool state account.
        payer:
          type: string
          description: Public key of the pool creator wallet.
        program_id:
          type: string
          description: Program ID of the Heaven DEX program.
        brackets:
          type: array
          items:
            $ref: '#/components/schemas/FeeBracketInput'
          description: >-
            Fee brackets (max 4). Each defines buy/sell basis points below a
            market cap threshold.
        compute_unit_limit:
          type: integer
          format: int32
          minimum: 0
          nullable: true
          description: Maximum compute units for the transaction.
        compute_unit_price:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: Priority fee in micro-lamports per compute unit.
      description: Request to set LP provider trading fee brackets on a pro pool.
    ProSetLpFeeTxResponse:
      type: object
      required:
        - tx
      properties:
        tx:
          type: string
          description: >-
            Base64 encoded versioned transaction. Decode, sign with the creator
            wallet, and submit.
    FeeBracketInput:
      type: object
      description: >-
        A single fee bracket for market cap based fees. Fees apply when the pool
        market cap is below the upper bound. Brackets are evaluated from lowest
        to highest market_cap_upper_bound.
      required:
        - market_cap_upper_bound
        - buy_fee_bps
        - sell_fee_bps
      properties:
        market_cap_upper_bound:
          type: integer
          format: int64
          minimum: 0
          description: >-
            Upper bound of this bracket in USD (as integer). Use max int64
            (9223372036854775807) for the final bracket to cover all market caps
            above the previous bracket.
          example: 100000000000
        buy_fee_bps:
          type: integer
          format: int32
          minimum: 0
          description: >-
            Fee charged on buy transactions in basis points (1 bps = 0.01%). For
            example, 100 = 1%.
          example: 100
        sell_fee_bps:
          type: integer
          format: int32
          minimum: 0
          description: >-
            Fee charged on sell transactions in basis points (1 bps = 0.01%).
            For example, 100 = 1%.
          example: 100
      example:
        market_cap_upper_bound: 100000000000
        buy_fee_bps: 100
        sell_fee_bps: 100

````