> ## 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 Creator Fee

> Set market cap based creator fee brackets on a pro pool. Only the pool creator can call this.

Brackets are evaluated from lowest to highest `market_cap_upper_bound`. Use `9223372036854775807` (max int64) for the final catch-all bracket.

**Example** — charge 2% below $100k, 1% up to $1M, 0.5% above:

| `market_cap_upper_bound` | `buy_fee_bps` | `sell_fee_bps` | Effective rate |
|---|---|---|---|
| `100000000000` | `200` | `200` | 2% below $100k |
| `1000000000000` | `100` | `100` | 1% up to $1M |
| `9223372036854775807` | `50` | `50` | 0.5% above $1M |



## OpenAPI

````yaml /openapi.json post /tx/pro/set-market-cap-creator-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-market-cap-creator-fee:
    post:
      tags:
        - Pro Pool API
      summary: Set Creator Fee
      description: >-
        Set market cap based creator fee brackets on a pro pool. Only the pool
        creator can call this.


        Brackets are evaluated from lowest to highest `market_cap_upper_bound`.
        Use `9223372036854775807` (max int64) for the final catch-all bracket.


        **Example** — charge 2% below $100k, 1% up to $1M, 0.5% above:


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

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

        | `100000000000` | `200` | `200` | 2% below $100k |

        | `1000000000000` | `100` | `100` | 1% up to $1M |

        | `9223372036854775807` | `50` | `50` | 0.5% above $1M |
      operationId: create_pro_set_market_cap_creator_fee_tx
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProSetMarketCapCreatorFeeTxRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProSetMarketCapCreatorFeeTxResponse'
components:
  schemas:
    ProSetMarketCapCreatorFeeTxRequest:
      type: object
      required:
        - pool
        - payer
        - program_id
        - brackets
      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.
        brackets:
          type: array
          items:
            $ref: '#/components/schemas/FeeBracketInput'
          description: >-
            Array of fee brackets (max 4). Each bracket defines buy/sell fees in
            basis points below a market cap threshold. Brackets should be
            ordered by ascending market_cap_upper_bound.
        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: >-
        Set market cap based creator trading fee brackets on a pro pool. Allows
        the creator to define different fee rates at different market cap
        levels. Only the pool creator can call this.
    ProSetMarketCapCreatorFeeTxResponse:
      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

````