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

## Overview

<Warning>
  **Solana Swap Execution - Alpha Mode**

  This endpoint is currently in **alpha mode**. This means:

  * The feature is functional but may have limitations or unexpected behavior
  * Performance and reliability improvements are ongoing
  * We recommend testing thoroughly before production use
  * Please report any issues to the Mobula team for faster resolution
</Warning>

The Swap Instructions endpoint returns individual Solana instructions instead of a serialized transaction. This allows you to:

* Add your own instructions (e.g., Jito tips, custom fee transfers)
* Combine multiple swaps in a single transaction
* Have full control over transaction construction
* Avoid deserializing/re-serializing transactions which adds latency

**Note:** This endpoint is only available for **Solana chains**. Mobula's execution engine handles the instruction generation internally, supporting multiple DEXs and liquidity sources (Raydium, Orca, Pumpfun, etc.).

## Query Parameters

* **`chainId`** (required) — The blockchain identifier. Must be `solana` or `solana:solana`
* **`tokenIn`** (required) — Address of the token to swap from (use `So11111111111111111111111111111111111111111` for native SOL)
* **`tokenOut`** (required) — Address of the token to swap to (use `So11111111111111111111111111111111111111111` for native SOL)
* **`amount`** (required if `amountRaw` not provided) — Human-readable amount of tokenIn to swap (e.g., `"1.5"` for 1.5 tokens)
* **`amountRaw`** (required if `amount` not provided) — Raw amount as a string (e.g., `"1500000000"` for 1.5 SOL with 9 decimals)
* **`walletAddress`** (required) — Wallet address that will execute the swap
* **`slippage`** (optional) — Maximum acceptable slippage percentage (0-100). Default: `1`
* **`excludedProtocols`** (optional) — Comma-separated list of factory addresses to exclude from routing
* **`onlyProtocols`** (optional) — Comma-separated list of tradable pool types to restrict routing
* **`poolAddress`** (optional) — Specific pool address to use for the swap
* **`onlyVerifiedTokens`** (optional) — When set to `"true"`, rejects quotes where `tokenOut` is an unverified launchpad token (e.g., Pump.fun, Pumpswap, Raydium Launchlab). Default: `"false"`.
* **`prioritizationFeeLamports`** (optional) — Jupiter-compatible priority fee budget. Can be `auto`, a fixed lamport amount, or `{"priorityLevelWithMaxLamports":{"priorityLevel":"medium"|"high"|"veryHigh","maxLamports":1000000,"global":false}}`
* **`dynamicComputeUnitLimit`** (optional) — Solana only. Dynamically sizes the compute unit limit from the built swap instructions. Default: `true`.
* **`jitoTipLamports`** (optional) — Jito tip amount in lamports for block engine priority
* **`payerAddress`** (optional) — Separate Solana fee payer. When provided and different from `walletAddress`, both wallets must sign. The payer covers transaction fees, priority/Jito tips, and ATA rent for accounts Mobula creates.
* **`closeAuthority`** (optional) — Close authority for non-WSOL ATAs Mobula creates during the swap when `payerAddress` is used. Usually set this to the central payer wallet to reclaim rent later.
* **`swapRecipientAddress`** (optional) — Wallet that receives the exact final swap output after router fee/slippage checks. The swap still uses `walletAddress` as taker, then MobulaRouter transfers the final output. Cannot be combined with `destinationWallet`. Legacy alias: `finalRecipientWallet`.
* **`feePercentage`** (optional) — Fee percentage to charge on the swap (0.01 to 99). Fee is always taken from **native SOL** (deducted from the swap amount). At least one side of the swap must be native SOL. Must be used together with `feeWallet`.
* **`feeWallet`** (optional) — Wallet address to receive fees. Required when `feePercentage` is set.
* **`feePercentages`** / **`feeWallets`** (optional) — Plural form (CSV or array, parallel entries). Accepted everywhere; Solana uses the first entry. The singular pair above is deprecated but still works.

## Usage Examples

### Basic Swap Instructions

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/swap/quoting-instructions?chainId=solana&tokenIn=So11111111111111111111111111111111111111111&tokenOut=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1&walletAddress=YourWalletAddress&slippage=1"
```

### With Priority Fee

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/swap/quoting-instructions?chainId=solana&tokenIn=So11111111111111111111111111111111111111111&tokenOut=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1&walletAddress=YourWalletAddress&slippage=1&prioritizationFeeLamports=auto"
```

### With Jito Tip

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/swap/quoting-instructions?chainId=solana&tokenIn=So11111111111111111111111111111111111111111&tokenOut=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1&walletAddress=YourWalletAddress&slippage=1&jitoTipLamports=10000"
```

### With Integration Fee

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/swap/quoting-instructions?chainId=solana&tokenIn=So11111111111111111111111111111111111111111&tokenOut=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1&walletAddress=YourWalletAddress&slippage=1&feePercentage=1&feeWallet=FeeWalletAddressHere"
```

This example charges a 1% fee on the swap. The fee is deducted from native SOL and sent to your `feeWallet` via a `SystemProgram.transfer` instruction.

### With Central Fee Payer, Close Authority, and Recipient

```bash theme={null}
curl -X GET "https://api.mobula.io/api/2/swap/quoting-instructions?chainId=solana&tokenIn=So11111111111111111111111111111111111111111&tokenOut=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=1&walletAddress=UserWalletAddressHere&payerAddress=CentralFeePayerAddressHere&closeAuthority=CentralFeePayerAddressHere&swapRecipientAddress=RecipientWalletAddressHere"
```

`payerAddress` pays transaction fees and ATA rent. `closeAuthority` lets that payer close non-WSOL ATAs Mobula created during the swap if they are left open later. `swapRecipientAddress` receives the final output while `walletAddress` remains the swap taker and token-transfer authority.

## Response Format

```json theme={null}
{
  "data": {
    "amountOutTokens": "150.123456",
    "slippagePercentage": 1,
    "prioritizationFeeLamports": 9999,
    "computeUnitLimit": 388876,
    "prioritizationType": {
      "computeBudget": {
        "microLamports": 25715,
        "estimatedMicroLamports": 785154
      }
    },
    "tokenIn": {
      "address": "So11111111111111111111111111111111111111111",
      "name": "Wrapped SOL",
      "symbol": "SOL",
      "decimals": 9,
      "logo": "https://metadata.mobula.io/assets/logos/solana_solana_So11111111111111111111111111111111111111111.webp"
    },
    "tokenOut": {
      "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "name": "USD Coin",
      "symbol": "USDC",
      "decimals": 6,
      "logo": "https://metadata.mobula.io/assets/logos/solana_solana_EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.webp"
    },
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "solana": {
      "instructions": {
        "computeBudgetInstructions": [
          {
            "programId": "ComputeBudget111111111111111111111111111111",
            "accounts": [],
            "data": "AgAAABAnAAAAAAAA"
          }
        ],
        "setupInstructions": [
          {
            "programId": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
            "accounts": [
              {
                "pubkey": "YourWalletAddress",
                "isSigner": true,
                "isWritable": true
              }
            ],
            "data": "..."
          }
        ],
        "swapInstructions": [
          {
            "programId": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
            "accounts": [
              {
                "pubkey": "YourWalletAddress",
                "isSigner": true,
                "isWritable": true
              }
            ],
            "data": "..."
          }
        ],
        "cleanupInstructions": [
          {
            "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
            "accounts": [
              {
                "pubkey": "YourWalletAddress",
                "isSigner": false,
                "isWritable": true
              }
            ],
            "data": "..."
          }
        ],
        "addressLookupTableAddresses": [
          "GxS6FiQ3mNnAar9HGQ6mxP7t6FcwmHkU7peSeQDUHmpN"
        ]
      },
      "lastValidBlockHeight": 305123456,
      "recentBlockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N"
    }
  }
}
```

### Response Fields

#### Data Object

* **`amountOutTokens`** (string, optional) — Estimated output amount in tokens
* **`slippagePercentage`** (number, optional) — Slippage percentage
* **`prioritizationFeeLamports`** (number) — Maximum priority fee if the transaction consumes its full compute limit. Calculated as `ceil(computeUnitLimit * prioritizationType.computeBudget.microLamports / 1,000,000)`.
* **`computeUnitLimit`** (number) — Value encoded by the returned `SetComputeUnitLimit` instruction.
* **`prioritizationType.computeBudget.microLamports`** (number) — Applied compute unit price encoded by the returned `SetComputeUnitPrice` instruction, in micro-lamports per CU.
* **`prioritizationType.computeBudget.estimatedMicroLamports`** (number) — Uncapped compute unit price estimate. This can be higher than `microLamports` when a `maxLamports` budget caps the applied fee; otherwise both values can be equal.
* **`tokenIn`** (object, optional) — Input token metadata
  * **`address`** (string) — Token contract address
  * **`name`** (string, optional) — Token name
  * **`symbol`** (string, optional) — Token symbol
  * **`decimals`** (number) — Token decimals
  * **`logo`** (string | null, optional) — Token logo URL
* **`tokenOut`** (object, optional) — Output token metadata
* **`requestId`** (string) — Unique identifier for tracking this request
* **`solana`** (object) — Solana instructions container
  * **`instructions`** (object) — All instructions needed for the swap
    * **`computeBudgetInstructions`** (array, optional) — Instructions to set compute budget
    * **`setupInstructions`** (array, optional) — Setup instructions (e.g., create token accounts)
    * **`swapInstructions`** (array) — The swap instructions (can be multiple for multi-hop routes)
    * **`cleanupInstructions`** (array, optional) — Cleanup instructions (e.g., close token accounts)
    * **`addressLookupTableAddresses`** (array, optional) — ALT addresses for versioned transactions
  * **`lastValidBlockHeight`** (number) — The last block height at which the blockhash is valid
  * **`recentBlockhash`** (string) — Recent blockhash to use when building the transaction

#### Instruction Format

Each instruction contains:

* **`programId`** (string) — The program that will process this instruction
* **`accounts`** (array) — Account keys involved in the instruction
  * **`pubkey`** (string) — Account public key
  * **`isSigner`** (boolean) — Whether the account must sign
  * **`isWritable`** (boolean) — Whether the account is writable
* **`data`** (string) — Instruction data as base64 encoded string

## Building a Transaction

After receiving instructions, you need to build and sign the transaction yourself:

```javascript theme={null}
import {
  Connection,
  TransactionMessage,
  VersionedTransaction,
  PublicKey,
  TransactionInstruction,
  AddressLookupTableAccount,
} from '@solana/web3.js';

const { solana, requestId } = response.data;

// Save requestId for support
console.log('Request ID:', requestId);

// Helper to convert instruction format
function toTransactionInstruction(ix) {
  return new TransactionInstruction({
    programId: new PublicKey(ix.programId),
    keys: ix.accounts.map(acc => ({
      pubkey: new PublicKey(acc.pubkey),
      isSigner: acc.isSigner,
      isWritable: acc.isWritable,
    })),
    data: Buffer.from(ix.data, 'base64'),
  });
}

// Build all instructions
const instructions = [];

// 1. Add compute budget instructions (if any)
if (solana.instructions.computeBudgetInstructions) {
  for (const ix of solana.instructions.computeBudgetInstructions) {
    instructions.push(toTransactionInstruction(ix));
  }
}

// 2. Add setup instructions (if any)
if (solana.instructions.setupInstructions) {
  for (const ix of solana.instructions.setupInstructions) {
    instructions.push(toTransactionInstruction(ix));
  }
}

// 3. Add YOUR custom instructions here (e.g., Jito tip, fee transfer)
// Example: Add a Jito tip
const JITO_TIP_ACCOUNTS = [
  '96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5',
  'HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe',
  // ... more tip accounts
];
const tipAccount = JITO_TIP_ACCOUNTS[Math.floor(Math.random() * JITO_TIP_ACCOUNTS.length)];
const tipInstruction = SystemProgram.transfer({
  fromPubkey: wallet.publicKey,
  toPubkey: new PublicKey(tipAccount),
  lamports: 10000, // 0.00001 SOL
});
instructions.push(tipInstruction);

// 4. Add the swap instructions (can be multiple for multi-hop routes)
if (solana.instructions.swapInstructions) {
  for (const ix of solana.instructions.swapInstructions) {
    instructions.push(toTransactionInstruction(ix));
  }
}

// 5. Add cleanup instructions (if any)
if (solana.instructions.cleanupInstructions) {
  for (const ix of solana.instructions.cleanupInstructions) {
    instructions.push(toTransactionInstruction(ix));
  }
}

// Fetch Address Lookup Tables (if any)
const addressLookupTables = [];
if (solana.instructions.addressLookupTableAddresses?.length > 0) {
  const connection = new Connection('YOUR_RPC_URL');
  for (const address of solana.instructions.addressLookupTableAddresses) {
    const result = await connection.getAddressLookupTable(new PublicKey(address));
    if (result.value) {
      addressLookupTables.push(result.value);
    }
  }
}

// Build the versioned transaction
const messageV0 = new TransactionMessage({
  payerKey: wallet.publicKey,
  recentBlockhash: solana.recentBlockhash,
  instructions,
}).compileToV0Message(addressLookupTables);

const transaction = new VersionedTransaction(messageV0);

// Sign the transaction
transaction.sign([wallet]);

// Send the transaction
const signature = await connection.sendTransaction(transaction);

// Confirm with lastValidBlockHeight
await connection.confirmTransaction({
  signature,
  blockhash: solana.recentBlockhash,
  lastValidBlockHeight: solana.lastValidBlockHeight,
});

console.log('Transaction confirmed:', signature);
```

## Important Notes

* **Solana Only**: This endpoint only works with Solana chains
* **Mobula Execution Engine**: Instructions are generated by Mobula's internal execution engine, which routes through multiple DEXs (Raydium, Orca, Pumpfun, etc.) for optimal pricing
* **Blockhash Expiry**: The `recentBlockhash` and `lastValidBlockHeight` have a limited validity window (\~150 blocks / \~1 minute). Build and send your transaction quickly.
* **Priority Fee Reporting**: Read `prioritizationFeeLamports`, `computeUnitLimit`, and `prioritizationType` directly from `data`. They describe the compute-budget instructions returned by Mobula, so no additional RPC request is required.
* **ALT Required**: For complex swaps, Address Lookup Tables are required. Always fetch and include them if `addressLookupTableAddresses` is provided.
* **Request ID**: Keep the `requestId` for troubleshooting with Mobula support

## Comparison with /swap/quoting

| Feature             | /swap/quoting          | /swap/quoting-instructions      |
| ------------------- | ---------------------- | ------------------------------- |
| Returns             | Serialized transaction | Individual instructions         |
| Custom instructions | Need to deserialize    | Direct insertion                |
| Latency             | Lower (ready to sign)  | Slightly higher (need to build) |
| Flexibility         | Limited                | Full control                    |
| Chain support       | Solana + EVM           | Solana only                     |
| Use case            | Simple swaps           | Advanced integrations           |


## 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 - Usage
    description: Per-key API and WebSocket usage history
  - name: V2 - Blockchains
    description: System metadata and chain listings
  - name: V2 - Prediction Markets
    description: >-
      Polymarket markets/events, wallet positions, and the full execution stack
      (auth, order build/submit/cancel, approvals, pUSD wrap/unwrap, deploy,
      deposit/withdraw, redeem). Alpha — see /api/2/pm/*.
  - 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, 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 identifiers — EVM:
              `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` (EIP-7528). Solana
              native SOL: `So11111111111111111111111111111111111111111`. Use
              wrapped SOL / WSOL mint
              `So11111111111111111111111111111111111111112` only when swapping
              WSOL token-account balance. TON:
              `EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c`.
          required: true
          description: >-
            Sell token address. Native identifiers — EVM:
            `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` (EIP-7528). Solana
            native SOL: `So11111111111111111111111111111111111111111`. Use
            wrapped SOL / WSOL mint
            `So11111111111111111111111111111111111111112` only when swapping
            WSOL token-account balance. TON:
            `EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c`.
          name: tokenIn
          in: query
        - schema:
            type: string
            minLength: 1
            description: Buy token address. Same native identifier rules as `tokenIn`.
          required: true
          description: Buy token address. Same native identifier 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:
            anyOf:
              - type: string
              - type: number
            description: >-
              USD value of `tokenIn` to spend. Resolved server-side from the
              live weighted token price. Mutually exclusive with `amount` and
              `amountRaw`.
          required: false
          description: >-
            USD value of `tokenIn` to spend. Resolved server-side from the live
            weighted token price. Mutually exclusive with `amount` and
            `amountRaw`.
          name: amountUSD
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: >-
              `auto` (default) lets the router choose adaptive slippage. A
              number is a fixed slippage tolerance in % (0-100).
          required: false
          description: >-
            `auto` (default) lets the router choose adaptive slippage. A number
            is a fixed slippage tolerance in % (0-100).
          name: slippage
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: >-
              Optional market impact guard in %. If the computed
              marketImpactPercentage is greater than this value, the quote is
              rejected with HTTP 400.
          required: false
          description: >-
            Optional market impact guard in %. If the computed
            marketImpactPercentage is greater than this value, the quote is
            rejected with HTTP 400.
          name: maxMarketImpactPercentage
          in: query
        - schema:
            type: string
            minLength: 1
            description: >-
              Taker wallet — supplies `tokenIn`, signs the broadcast tx, pays
              gas, and receives `tokenOut` unless `recipientAddress` is set. Fee
              context.
          required: true
          description: >-
            Taker wallet — supplies `tokenIn`, signs the broadcast tx, pays gas,
            and receives `tokenOut` unless `recipientAddress` is set. Fee
            context.
          name: walletAddress
          in: query
        - schema:
            type: string
            description: >-
              EVM only. Address that receives `tokenOut`. Defaults to
              `walletAddress`. Lets the taker (who supplies `tokenIn`, signs,
              and pays gas) differ from the output recipientAddress — e.g. relay
              flows where funds land at a relayer and the swapped output is
              delivered to the end user.
          required: false
          description: >-
            EVM only. Address that receives `tokenOut`. Defaults to
            `walletAddress`. Lets the taker (who supplies `tokenIn`, signs, and
            pays gas) differ from the output recipientAddress — e.g. relay flows
            where funds land at a relayer and the swapped output is delivered to
            the end user.
          name: recipientAddress
          in: query
        - schema:
            type: string
            description: >-
              EVM only. When `true`, MobulaRouter v2.19.0+ sells the taker’s
              entire ERC20 `tokenIn` balance at execution time;
              `amountRaw`/`amount` is used only to select the route and
              calculate the minimum output. Requires a Mobula route and is
              refused on aggregator routes.
          required: false
          description: >-
            EVM only. When `true`, MobulaRouter v2.19.0+ sells the taker’s
            entire ERC20 `tokenIn` balance at execution time;
            `amountRaw`/`amount` is used only to select the route and calculate
            the minimum output. Requires a Mobula route and is refused on
            aggregator routes.
          name: sellEntireBalance
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Optional wallet that receives `tokenOut`. Defaults to
              `walletAddress`. Native SOL output is not supported yet with a
              separate destination wallet.
          required: false
          description: >-
            Solana only. Optional wallet that receives `tokenOut`. Defaults to
            `walletAddress`. Native SOL output is not supported yet with a
            separate destination wallet.
          name: destinationWallet
          in: query
        - schema:
            type: string
            description: >-
              Deprecated Solana alias for `swapRecipientAddress`; kept for
              backward compatibility.
          required: false
          description: >-
            Deprecated Solana alias for `swapRecipientAddress`; kept for
            backward compatibility.
          name: finalRecipientWallet
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Optional wallet that receives the exact final output
              after the Mobula on-chain router executes the swap and
              fee/slippage checks. For SPL outputs, Mobula creates the recipient
              ATA idempotently and closes router-created temporary output
              accounts when empty. Cannot be combined with `destinationWallet`.
          required: false
          description: >-
            Solana only. Optional wallet that receives the exact final output
            after the Mobula on-chain router executes the swap and fee/slippage
            checks. For SPL outputs, Mobula creates the recipient ATA
            idempotently and closes router-created temporary output accounts
            when empty. Cannot be combined with `destinationWallet`.
          name: swapRecipientAddress
          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:
            nullable: true
            description: >-
              Solana only. Jupiter-compatible priority fee budget. Use `auto`, a
              fixed lamport amount, or `{ "priorityLevelWithMaxLamports": {
              "priorityLevel": "medium" | "high" | "veryHigh", "maxLamports":
              1000000, "global": false } }`.
          required: false
          description: >-
            Solana only. Jupiter-compatible priority fee budget. Use `auto`, a
            fixed lamport amount, or `{ "priorityLevelWithMaxLamports": {
            "priorityLevel": "medium" | "high" | "veryHigh", "maxLamports":
            1000000, "global": false } }`.
          name: prioritizationFeeLamports
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Dynamically sizes the compute unit limit from the
              assembled swap instructions. Default: `true`.
          required: false
          description: >-
            Solana only. Dynamically sizes the compute unit limit from the
            assembled 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: >-
              DEPRECATED — use `feePercentages`/`feeWallets`. Caller referral
              fee in % (0-99). Mobula skims a 20% platform cut off the top.
              Requires `feeWallet`.
          required: false
          description: >-
            DEPRECATED — use `feePercentages`/`feeWallets`. 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: >-
              DEPRECATED — use `feePercentages`/`feeWallets`. Wallet that
              receives the caller referral fee. Required when `feePercentage >
              0`.
          required: false
          description: >-
            DEPRECATED — use `feePercentages`/`feeWallets`. Wallet that receives
            the caller referral fee. Required when `feePercentage > 0`.
          name: feeWallet
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
            description: >-
              Caller referral fees in % (CSV or array, max 4), parallel to
              `feeWallets` — entry i is paid to wallet i. Wins over the singular
              pair. Mobula skims a 20% platform cut off each entry.
          required: false
          description: >-
            Caller referral fees in % (CSV or array, max 4), parallel to
            `feeWallets` — entry i is paid to wallet i. Wins over the singular
            pair. Mobula skims a 20% platform cut off each entry.
          name: feePercentages
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              Wallets receiving the caller referral fees (CSV or array),
              parallel to `feePercentages`.
          required: false
          description: >-
            Wallets receiving the caller referral fees (CSV or array), parallel
            to `feePercentages`.
          name: feeWallets
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: >-
              Minimum caller referral fee in native-token units (TON, or SOL on
              Solana). Floors the referral fee; honored when the fee asset is
              the native token. Currently honored on TON native-input swaps;
              requires `feeWallet`.
          required: false
          description: >-
            Minimum caller referral fee in native-token units (TON, or SOL on
            Solana). Floors the referral fee; honored when the fee asset is the
            native token. Currently honored on TON native-input swaps; requires
            `feeWallet`.
          name: minFeesNative
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Mint of a token in which to charge a flat MINIMUM fee
              (paired with `minFeesTokenRaw`). Charged via a separate transfer
              to `feeWallet`, independent of the swap route. Requires
              `feeWallet`.
          required: false
          description: >-
            Solana only. Mint of a token in which to charge a flat MINIMUM fee
            (paired with `minFeesTokenRaw`). Charged via a separate transfer to
            `feeWallet`, independent of the swap route. Requires `feeWallet`.
          name: feeToken
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: >-
              Solana only. Raw amount (smallest unit) of `feeToken` to charge as
              a flat minimum fee. The swap reverts if the user lacks balance.
          required: false
          description: >-
            Solana only. Raw amount (smallest unit) of `feeToken` to charge as a
            flat minimum fee. The swap reverts if the user lacks balance.
          name: minFeesTokenRaw
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Fee abstraction — separate fee payer from
              `walletAddress`. When different, both wallets sign; `payerAddress`
              pays transaction fees, priority/Jito tips, and ATA rent for
              accounts Mobula creates.
          required: false
          description: >-
            Solana only. Fee abstraction — separate fee payer from
            `walletAddress`. When different, both wallets sign; `payerAddress`
            pays transaction fees, priority/Jito tips, and ATA rent for accounts
            Mobula creates.
          name: payerAddress
          in: query
        - schema:
            type: string
            description: >-
              Solana only. Optional close authority for non-WSOL ATAs Mobula
              creates during the swap when `payerAddress` is used. If omitted,
              `walletAddress` remains the close authority. Ignored when no
              separate `payerAddress` is provided.
          required: false
          description: >-
            Solana only. Optional close authority for non-WSOL ATAs Mobula
            creates during the swap when `payerAddress` is used. If omitted,
            `walletAddress` remains the close authority. Ignored when no
            separate `payerAddress` is provided.
          name: closeAuthority
          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
        - schema:
            type: string
            description: When `true`, reject quotes involving unverified launchpad tokens.
          required: false
          description: When `true`, reject quotes involving unverified launchpad tokens.
          name: onlyVerifiedTokens
          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:
                                    index:
                                      type: number
                                    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
                                    amountInRaw:
                                      type: string
                                    amountOutRaw:
                                      type: string
                                    poolAmountOutRaw:
                                      type: string
                                    theoreticalAmountOutRaw:
                                      type: string
                                    theoreticalAmountOutTokens:
                                      type: string
                                    amountOutBeforeTokenFeesRaw:
                                      type: string
                                    amountOutBeforeTokenFeesTokens:
                                      type: string
                                    exchange:
                                      type: string
                                    poolType:
                                      type: string
                                    feePercentage:
                                      type: number
                                    feeBps:
                                      type: number
                                    feeSource:
                                      type: string
                                    marketImpactPercentage:
                                      type: number
                                    priceImpactPercentage:
                                      type: number
                                    liquidityUSD:
                                      type: number
                                    volume24hUSD:
                                      type: number
                                    price:
                                      type: number
                                    reserve0Raw:
                                      type: string
                                    reserve1Raw:
                                      type: string
                                    ranking:
                                      type: object
                                      properties:
                                        marketImpactPercentage:
                                          type: number
                                        feePercentage:
                                          type: number
                                        feeBps:
                                          type: number
                                        liquidityUSD:
                                          type: number
                                        volume24hUSD:
                                          type: number
                                        amountInRaw:
                                          type: string
                                        amountOutRaw:
                                          type: string
                                        theoreticalAmountOutRaw:
                                          type: string
                                  required:
                                    - poolAddress
                                    - tokenIn
                                    - tokenOut
                                    - amountInTokens
                                    - amountOutTokens
                              totalFeePercentage:
                                type: number
                              totalFeeBps:
                                type: number
                              hopCount:
                                type: number
                              marketImpactPercentage:
                                type: number
                              aggregator:
                                type: string
                              ranking:
                                type: object
                                properties:
                                  marketImpactPercentage:
                                    type: number
                                  totalFeePercentage:
                                    type: number
                                  totalFeeBps:
                                    type: number
                                  hopCount:
                                    type: number
                                  amountInRaw:
                                    type: string
                                  amountOutRaw:
                                    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
                              addressLookupTables:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    address:
                                      type: string
                                    addresses:
                                      type: array
                                      items:
                                        type: string
                                  required:
                                    - address
                                    - addresses
                            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

````