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

# Jupiter Swap

Execute a token swap on Solana via Jupiter, the leading DEX aggregator. Automatically finds the best route across all Solana DEX pools for any SPL token pair. Ideal for: automated swaps, portfolio rebalancing, DCA strategies, and token distribution on Solana.

![Jupiter Swap logo](https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/solana/info/logo.png)
Catalog action Solana Onchain wallet swap

Execute a token swap on Solana via Jupiter, the leading DEX aggregator. Automatically finds the best route across all Solana DEX pools for any SPL token pair. Ideal for: automated swaps, portfolio rebalancing, DCA strategies, and token distribution on Solana.

**Review wallet and value movement**

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `jupiter-swap` |
| Category | Solana Onchain |
| Connector | `wallet` |
| Requires gas | No |
| Funds movement | `swap` |
| Tags | `blockchain`, `solana`, `swap`, `jupiter`, `dex`, `trade`, `write` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `inputMint` | `string` | Yes | Contract address of the token you want to sell \(e.g., the USDC or SOL mint address\). Find it on Solscan or Jupiter. |
| `outputMint` | `string` | Yes | Contract address of the token you want to buy \(e.g., the USDC or SOL mint address\). Find it on Solscan or Jupiter. |
| `amount` | `string` | No | Amount of the input token to swap, in human-readable format \(e.g., "1.5" for 1.5 USDC\). Supports full token precision. |
| `rawAmount` | `string` | No | Raw amount in smallest unit \(alternative to 'amount' for chaining from jupiter-quote\). If provided, 'amount' is ignored. |
| `slippageBps` | `number` | No | Maximum acceptable price difference in basis points. 50 = 0.5%, 100 = 1%. Default: 50 \(0.5%\). |
| `allowUnverifiedTokens` | `boolean` | No | Allow swapping tokens not on the Jupiter verified list. Only applies to automated workflows. Manual executions always allow all tokens. |
| `chainId` | `number` | Yes | Solana Mainnet |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | - |
| `signature` | `string` | Yes | Transaction signature \(base58 encoded\) |
| `transactionHash` | `string` | Yes | Transaction hash \(same as signature, for workflow engine compatibility\) |
| `inputMint` | `string` | Yes | Input token mint address |
| `outputMint` | `string` | Yes | Output token mint address |
| `inputAmount` | `string` | No | Input amount in smallest unit \(e.g. atomic units for SPL tokens\) |
| `outputAmount` | `string` | No | Amount received on-chain in smallest unit. In simulation, this is the quoted estimate. |
| `quotedOutputAmount` | `string` | No | Pre-execution quoted output amount in smallest unit |
| `formattedInputAmount` | `string` | No | Human-readable input amount \(e.g. '1.5'\) |
| `formattedOutputAmount` | `string` | No | Human-readable amount received on-chain. In simulation, this is the quoted estimate. |
| `inputSymbol` | `string` | No | Symbol of the input token \(e.g. 'SOL', 'USDC'\) |
| `outputSymbol` | `string` | No | Symbol of the output token \(e.g. 'USDC', 'BONK'\) |
| `priceImpactPct` | `string` | No | Price impact as a percentage string \(e.g. '0.01'\) |
| `slot` | `number` | No | Slot number where the transaction was confirmed |
| `chainId` | `number` | No | Chain ID where the transaction was executed |

## Examples

**Workflow node**

```json
{
  "type": "jupiter-swap",
  "payload": {
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "chainId": 7565164,
    "amount": "0.01"
  },
  "children": [],
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/jupiter-swap/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "chainId": 7565164,
    "amount": "0.01"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.