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

# Add fees to a Solana transaction

> Adds priority fees and compute unit limits to a Solana transaction for optimization.



## OpenAPI

````yaml post /sdk/{environmentId}/solana/optimizeTransaction
openapi: 3.0.1
info:
  title: Dashboard API
  description: Dashboard API documentation
  version: 1.0.0
servers:
  - url: https://app.dynamicauth.com/api/v0
  - url: https://app.dynamic.xyz/api/v0
  - url: http://localhost:3333/api/v0
security: []
tags:
  - name: Analytics
  - name: SDK
  - name: Organizations
  - name: Projects
  - name: Environments
  - name: Users
  - name: Invites
  - name: Tokens
  - name: Origins
  - name: Allowlists
  - name: Wallets
  - name: Members
  - name: Sessions
  - name: Settings
  - name: Gates
  - name: Chains
  - name: Exports
  - name: Events
  - name: Webhooks
  - name: Custom Fields
  - name: OrganizationMfaSettings
  - name: CustomHostnames
  - name: TestAccount
  - name: NameServices
  - name: GlobalWallets
  - name: GlobalWalletConnections
  - name: UserApiTokens
  - name: Waas
  - name: WalletConnect
paths:
  /sdk/{environmentId}/solana/optimizeTransaction:
    post:
      tags:
        - SDK
      summary: Add fees to a Solana transaction
      operationId: optimizeTransaction
      parameters:
        - name: environmentId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SolanaTransactionOptimizationRequest'
      responses:
        '200':
          description: Successfully optimized transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SolanaTransactionOptimizationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    SolanaTransactionOptimizationRequest:
      type: object
      required:
        - transaction
        - address
      properties:
        transaction:
          type: string
        address:
          $ref: '#/components/schemas/SolanaPublicKey'
    SolanaTransactionOptimizationResponse:
      type: object
      required:
        - transaction
      properties:
        transaction:
          type: string
    SolanaPublicKey:
      type: string
      pattern: ^[1-9A-HJ-NP-Za-km-z]{43,44}$
      description: >-
        Valid Solana wallet address, must be a 44-character string using base58
        characters
      example: vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg
    BadRequest:
      type: object
      properties:
        error:
          type: string
    Unauthorized:
      type: object
      properties:
        error:
          type: string
          example: No jwt provided!
    Forbidden:
      type: object
      properties:
        error:
          type: string
          example: Access Forbidden
    InternalServerError:
      type: object
      properties:
        error:
          type: string
          example: Internal Server Error
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BadRequest'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Forbidden'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InternalServerError'

````