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

> Set slot-offset based creator fee brackets on a pro pool. Useful for **sniper resistance** — charge high fees in the first few seconds after launch that decay over time.

Each Solana slot is ~400ms. When active, slot fees **take precedence** over market cap based creator fees. Only the pool creator can call this.

**Example** — 50% for first ~2s, 10% for next ~4s, then normal fees:

| `slot_offset_upperbound` | `buy_fee_bps` | `sell_fee_bps` | Timing |
|---|---|---|---|
| `5` | `5000` | `5000` | First ~2 seconds (50%) |
| `15` | `1000` | `1000` | Next ~4 seconds (10%) |

Set `max_slot_offset: 15`, `max_fee_bps: 5000`, `enabled: true`.



## OpenAPI

````yaml /openapi.json post /tx/pro/set-slot-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-slot-creator-fee:
    post:
      tags:
        - Pro Pool API
      summary: Set Slot Fee
      description: >-
        Set slot-offset based creator fee brackets on a pro pool. Useful for
        **sniper resistance** — charge high fees in the first few seconds after
        launch that decay over time.


        Each Solana slot is ~400ms. When active, slot fees **take precedence**
        over market cap based creator fees. Only the pool creator can call this.


        **Example** — 50% for first ~2s, 10% for next ~4s, then normal fees:


        | `slot_offset_upperbound` | `buy_fee_bps` | `sell_fee_bps` | Timing |

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

        | `5` | `5000` | `5000` | First ~2 seconds (50%) |

        | `15` | `1000` | `1000` | Next ~4 seconds (10%) |


        Set `max_slot_offset: 15`, `max_fee_bps: 5000`, `enabled: true`.
      operationId: create_pro_set_slot_creator_fee_tx
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProSetSlotCreatorFeeTxRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProSetSlotCreatorFeeTxResponse'
components:
  schemas:
    ProSetSlotCreatorFeeTxRequest:
      type: object
      required:
        - pool
        - payer
        - program_id
        - brackets
        - max_slot_offset
        - max_fee_bps
        - 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.
        brackets:
          type: array
          items:
            $ref: '#/components/schemas/SlotFeeBracketInput'
          description: >-
            Array of slot fee brackets (max 42). Each bracket defines buy/sell
            fees at a specific slot offset range from pool creation.
        max_slot_offset:
          type: integer
          format: int32
          minimum: 0
          description: >-
            Maximum slot offset at which slot-based fees apply. After this many
            slots, the fees revert to normal.
        max_fee_bps:
          type: integer
          format: int32
          minimum: 0
          description: Maximum fee in basis points across all slot brackets.
        enabled:
          type: boolean
          description: Set to `true` to enable slot-based fees, `false` to disable them.
        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 slot-offset based creator fee brackets on a pro pool. Useful for
        implementing time-decaying fees (e.g. high fees right after launch for
        sniper resistance that decay over slots).
    ProSetSlotCreatorFeeTxResponse:
      type: object
      required:
        - tx
      properties:
        tx:
          type: string
          description: >-
            Base64 encoded versioned transaction. Decode, sign with the creator
            wallet, and submit.
    SlotFeeBracketInput:
      type: object
      description: >-
        A single fee bracket for slot-offset based fees. Higher fees at lower
        slot offsets can be used for sniper resistance. Slots are ~400ms on
        Solana, so 5 slots ≈ 2 seconds.
      required:
        - buy_fee_bps
        - sell_fee_bps
        - slot_offset_upperbound
      properties:
        buy_fee_bps:
          type: integer
          format: int32
          minimum: 0
          description: >-
            Fee charged on buy transactions in basis points for this slot offset
            range.
          example: 5000
        sell_fee_bps:
          type: integer
          format: int32
          minimum: 0
          description: >-
            Fee charged on sell transactions in basis points for this slot
            offset range.
          example: 5000
        slot_offset_upperbound:
          type: integer
          format: int32
          minimum: 0
          description: >-
            Upper bound of this bracket in slots since pool creation. Slots are
            ~400ms on Solana.
          example: 5
      example:
        buy_fee_bps: 5000
        sell_fee_bps: 5000
        slot_offset_upperbound: 5

````