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

# Swap Instructions

> Get swap instructions for Solana that allow you to build custom transactions with your own instructions (e.g., Jito tips, fee transfers).



## OpenAPI

````yaml get /2/swap/quoting-instructions
openapi: 3.0.0
info:
  version: 1.0.0
  title: Mobula API
  description: >-
    Documentation of the Mobula API


    **Demo API**: The default server (demo-api.mobula.io) is a demo API with
    rate limits.

    For production use, please use api.mobula.io with an API key from
    https://admin.mobula.io
servers:
  - url: https://demo-api.mobula.io/api/
    description: Demo API (rate limited, for testing only)
  - url: https://api.mobula.io/api/
    description: Production API (requires API key)
security: []
tags:
  - name: V2 - Token
    description: Token details, price, security, ATH, and holder data
  - name: V2 - Market Data
    description: Market details, OHLCV history, and lighthouse metrics
  - name: V2 - Trades
    description: Token trades, enriched trades, and trade filters
  - name: V2 - Wallet
    description: Wallet positions, activity, trades, analysis, and labels
  - name: V2 - Assets
    description: Cross-chain asset details and price history
  - name: V2 - Swap
    description: Swap quoting and execution
  - name: V2 - Perps
    description: Perpetual futures quoting, execution, and positions
  - name: V2 - Bridge
    description: Cross-chain bridge quoting and intent status (Alpha Preview)
  - name: V2 - DeFi
    description: Bonding pools and pulse data
  - name: V2 - Search
    description: Universal fast search
  - name: V2 - Blockchains
    description: System metadata and chain listings
  - name: V1 - Market Data
    description: Market prices, history, sparklines, pairs, and multi-data
  - name: V1 - Wallet
    description: Wallet portfolio, transactions, history, and NFTs
  - name: V1 - Token
    description: First buyers
  - name: V1 - Trades
    description: Market trades by pair
  - name: V1 - Metadata
    description: Token metadata, categories, trendings, and news
  - name: V1 - Assets
    description: List all assets
  - name: V1 - Search
    description: Search for assets, tokens, and pairs
  - name: V1 - DeFi
    description: Bonding pool pulse data
  - name: V1 - Blockchains
    description: Blockchain listings, pairs, and stats
  - name: V1 - Webhooks
    description: Webhook management
  - name: V1 - Feed
    description: Custom feed creation
paths:
  /2/swap/quoting-instructions:
    get:
      tags:
        - V2 - Swap
      summary: Get swap quote instructions with transaction details
      description: >-
        Get swap quote instructions for building transactions with custom logic.
        Returns routing information and detailed instructions.
      parameters:
        - schema:
            type: string
            description: >-
              Mobula chain id. EVM: `evm:<integer>` (e.g. `evm:1`, `evm:8453`,
              `evm:42161`). Solana: `solana:solana`. TON: `ton:mainnet` or
              `ton:testnet`.
          required: false
          description: >-
            Mobula chain id. EVM: `evm:<integer>` (e.g. `evm:1`, `evm:8453`,
            `evm:42161`). Solana: `solana:solana`. TON: `ton:mainnet` or
            `ton:testnet`.
          name: chainId
          in: query
        - schema:
            type: string
            minLength: 1
            description: >-
              Sell token address. Native sentinels — EVM:
              `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` (EIP-7528). Solana:
              `So11111111111111111111111111111111111111112` (wSOL). TON:
              `EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c`.
          required: true
          description: >-
            Sell token address. Native sentinels — EVM:
            `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` (EIP-7528). Solana:
            `So11111111111111111111111111111111111111112` (wSOL). TON:
            `EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c`.
          name: tokenIn
          in: query
        - schema:
            type: string
            minLength: 1
            description: Buy token address. Same sentinel rules as `tokenIn`.
          required: true
          description: Buy token address. Same sentinel rules as `tokenIn`.
          name: tokenOut
          in: query
        - schema:
            type: string
            description: >-
              Human-readable amount (e.g. `"1.5"` for 1.5 tokens). Converted
              server-side: raw = amount × 10^decimals. Mutually exclusive with
              `amountRaw`.
          required: false
          description: >-
            Human-readable amount (e.g. `"1.5"` for 1.5 tokens). Converted
            server-side: raw = amount × 10^decimals. Mutually exclusive with
            `amountRaw`.
          name: amount
          in: query
        - schema:
            type: string
            description: >-
              Raw amount as a digit-only string (e.g. `"1500000"` for 1.5 USDC
              at 6 decimals). Use this when you already have the bigint to avoid
              float precision loss. Mutually exclusive with `amount`.
          required: false
          description: >-
            Raw amount as a digit-only string (e.g. `"1500000"` for 1.5 USDC at
            6 decimals). Use this when you already have the bigint to avoid
            float precision loss. Mutually exclusive with `amount`.
          name: amountRaw
          in: query
        - schema:
            type: string
            description: >-
              Slippage tolerance in % (0-100, default 1). Quote rejects if
              expected output drops below this threshold.
          required: false
          description: >-
            Slippage tolerance in % (0-100, default 1). Quote rejects if
            expected output drops below this threshold.
          name: slippage
          in: query
        - schema:
            type: string
            minLength: 1
            description: >-
              User wallet address — recipient of `tokenOut`, signer for the
              broadcast tx, fee context.
          required: true
          description: >-
            User wallet address — recipient of `tokenOut`, signer for the
            broadcast tx, fee context.
          name: walletAddress
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: 'DEX-level deny list (CSV). Example: `pump-amm,raydium`.'
          required: false
          description: 'DEX-level deny list (CSV). Example: `pump-amm,raydium`.'
          name: excludedProtocols
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: 'DEX-level allow list (CSV). Example: `uniswap-v3,uniswap-v4`.'
          required: false
          description: 'DEX-level allow list (CSV). Example: `uniswap-v3,uniswap-v4`.'
          name: onlyProtocols
          in: query
        - schema:
            type: string
            description: >-
              Pin routing to a single pool (e.g. when you want a specific
              Uniswap V3 fee tier).
          required: false
          description: >-
            Pin routing to a single pool (e.g. when you want a specific Uniswap
            V3 fee tier).
          name: poolAddress
          in: query
        - schema:
            type: string
            description: >-
              Aggregator filter (CSV) — `jupiter`, `kyberswap`, `lifi`, `naos`.
              Omit to let the API pick.
          required: false
          description: >-
            Aggregator filter (CSV) — `jupiter`, `kyberswap`, `lifi`, `naos`.
            Omit to let the API pick.
          name: onlyRouters
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Jupiter-compatible priority fee budget. Use `auto`, a
              fixed lamport amount, or a JSON priority object with
              `priorityLevelWithMaxLamports`.
          required: false
          description: >-
            Solana only. Jupiter-compatible priority fee budget. Use `auto`, a
            fixed lamport amount, or a JSON priority object with
            `priorityLevelWithMaxLamports`.
          name: prioritizationFeeLamports
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Dynamically sizes the compute unit limit from the
              built swap instructions. Default `true`.
          required: false
          description: >-
            Solana only. Dynamically sizes the compute unit limit from the built
            swap instructions. Default `true`.
          name: dynamicComputeUnitLimit
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Jito tip in lamports — adds a transfer to one of the
              Jito tip accounts for fast landing.
          required: false
          description: >-
            Solana only. Jito tip in lamports — adds a transfer to one of the
            Jito tip accounts for fast landing.
          name: jitoTipLamports
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: >-
              Caller referral fee in % (0-99). Mobula skims a 20% platform cut
              off the top. Requires `feeWallet`.
          required: false
          description: >-
            Caller referral fee in % (0-99). Mobula skims a 20% platform cut off
            the top. Requires `feeWallet`.
          name: feePercentage
          in: query
        - schema:
            type: string
            description: >-
              Wallet that receives the caller referral fee. Required when
              `feePercentage > 0`.
          required: false
          description: >-
            Wallet that receives the caller referral fee. Required when
            `feePercentage > 0`.
          name: feeWallet
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: >-
              Minimum caller referral fee in native-token units. Currently
              honored on TON native-input swaps; requires `feeWallet`.
          required: false
          description: >-
            Minimum caller referral fee in native-token units. Currently honored
            on TON native-input swaps; requires `feeWallet`.
          name: minFeesNative
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Fee abstraction — wallet that signs/pays for the tx
              (separate from `walletAddress`).
          required: false
          description: >-
            Solana only. Fee abstraction — wallet that signs/pays for the tx
            (separate from `walletAddress`).
          name: payerAddress
          in: query
        - schema:
            type: string
            description: >-
              Solana only. `true` returns N candidate transactions over a
              durable nonce — race them across landers (Jito, Nozomi, 0slot).
              Only one commits.
          required: false
          description: >-
            Solana only. `true` returns N candidate transactions over a durable
            nonce — race them across landers (Jito, Nozomi, 0slot). Only one
            commits.
          name: multiLander
          in: query
        - schema:
            type: string
            description: >-
              Per-lander tip when `multiLander=true`. Defaults to each lander's
              minimum.
          required: false
          description: >-
            Per-lander tip when `multiLander=true`. Defaults to each lander's
            minimum.
          name: landerTipLamports
          in: query
      responses:
        '200':
          description: Swap quoting instructions response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      amountOutTokens:
                        type: string
                      slippagePercentage:
                        type: number
                      amountInUSD:
                        type: number
                      amountOutUSD:
                        type: number
                      marketImpactPercentage:
                        type: number
                      poolFeesPercentage:
                        type: number
                      tokenIn:
                        type: object
                        properties:
                          address:
                            type: string
                          name:
                            type: string
                          symbol:
                            type: string
                          decimals:
                            type: number
                          logo:
                            type: string
                            nullable: true
                        required:
                          - address
                          - decimals
                      tokenOut:
                        type: object
                        properties:
                          address:
                            type: string
                          name:
                            type: string
                          symbol:
                            type: string
                          decimals:
                            type: number
                          logo:
                            type: string
                            nullable: true
                        required:
                          - address
                          - decimals
                      requestId:
                        type: string
                      details:
                        type: object
                        properties:
                          route:
                            type: object
                            properties:
                              hops:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    poolAddress:
                                      type: string
                                    tokenIn:
                                      type: object
                                      properties:
                                        address:
                                          type: string
                                        name:
                                          type: string
                                        symbol:
                                          type: string
                                        decimals:
                                          type: number
                                        logo:
                                          type: string
                                          nullable: true
                                      required:
                                        - address
                                        - decimals
                                    tokenOut:
                                      type: object
                                      properties:
                                        address:
                                          type: string
                                        name:
                                          type: string
                                        symbol:
                                          type: string
                                        decimals:
                                          type: number
                                        logo:
                                          type: string
                                          nullable: true
                                      required:
                                        - address
                                        - decimals
                                    amountInTokens:
                                      type: string
                                    amountOutTokens:
                                      type: string
                                    exchange:
                                      type: string
                                    poolType:
                                      type: string
                                    feePercentage:
                                      type: number
                                    feeBps:
                                      type: number
                                  required:
                                    - poolAddress
                                    - tokenIn
                                    - tokenOut
                                    - amountInTokens
                                    - amountOutTokens
                              totalFeePercentage:
                                type: number
                              aggregator:
                                type: string
                            required:
                              - hops
                          aggregator:
                            type: string
                          raw:
                            type: object
                            additionalProperties:
                              nullable: true
                      solana:
                        type: object
                        properties:
                          instructions:
                            type: object
                            properties:
                              computeBudgetInstructions:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    programId:
                                      type: string
                                    accounts:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          pubkey:
                                            type: string
                                          isSigner:
                                            type: boolean
                                          isWritable:
                                            type: boolean
                                        required:
                                          - pubkey
                                          - isSigner
                                          - isWritable
                                    data:
                                      type: string
                                  required:
                                    - programId
                                    - accounts
                                    - data
                              setupInstructions:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    programId:
                                      type: string
                                    accounts:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          pubkey:
                                            type: string
                                          isSigner:
                                            type: boolean
                                          isWritable:
                                            type: boolean
                                        required:
                                          - pubkey
                                          - isSigner
                                          - isWritable
                                    data:
                                      type: string
                                  required:
                                    - programId
                                    - accounts
                                    - data
                              swapInstructions:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    programId:
                                      type: string
                                    accounts:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          pubkey:
                                            type: string
                                          isSigner:
                                            type: boolean
                                          isWritable:
                                            type: boolean
                                        required:
                                          - pubkey
                                          - isSigner
                                          - isWritable
                                    data:
                                      type: string
                                  required:
                                    - programId
                                    - accounts
                                    - data
                              cleanupInstructions:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    programId:
                                      type: string
                                    accounts:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          pubkey:
                                            type: string
                                          isSigner:
                                            type: boolean
                                          isWritable:
                                            type: boolean
                                        required:
                                          - pubkey
                                          - isSigner
                                          - isWritable
                                    data:
                                      type: string
                                  required:
                                    - programId
                                    - accounts
                                    - data
                              addressLookupTableAddresses:
                                type: array
                                items:
                                  type: string
                            required:
                              - swapInstructions
                          lastValidBlockHeight:
                            type: number
                          recentBlockhash:
                            type: string
                        required:
                          - instructions
                          - lastValidBlockHeight
                          - recentBlockhash
                      fee:
                        type: object
                        properties:
                          amount:
                            type: string
                          percentage:
                            type: number
                          wallet:
                            type: string
                          deductedFrom:
                            type: string
                            enum:
                              - input
                              - output
                        required:
                          - amount
                          - percentage
                          - wallet
                          - deductedFrom
                    required:
                      - requestId
                      - solana
                  error:
                    type: string
                required:
                  - data

````