# Jupiter Swap decoder (Carbon 2.0)

> Decode Jupiter Swap instructions, accounts and events in Rust with carbon-jupiter-swap-decoder 2.0.0. Program ID JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4.

`carbon-jupiter-swap-decoder` decodes the instructions, accounts and events of the Jupiter Swap program (`JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4`): 17 instructions, 1 account type, 6 events. It is generated with Codama from the program's IDL; see [decoders](https://carbon.sevenlabs.org/concepts/decoders.md) for how decoders plug into a pipeline.

|                  |                                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------------------------------------- |
| Crate            | [`carbon-jupiter-swap-decoder`](https://crates.io/crates/carbon-jupiter-swap-decoder/2.0.0) 2.0.0                 |
| Install          | `cargo add carbon-jupiter-swap-decoder@2.0.0`                                                                     |
| Program ID       | `JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4` (`carbon_jupiter_swap_decoder::PROGRAM_ID`)                         |
| Category         | [Aggregators & routing](https://carbon.sevenlabs.org/decoders/aggregators.md)                                     |
| Decoder          | `carbon_jupiter_swap_decoder::JupiterSwapDecoder`                                                                 |
| Instruction enum | `instructions::JupiterSwapInstruction`                                                                            |
| Account enum     | `accounts::JupiterSwapAccount`                                                                                    |
| Event enum       | `instructions::CpiEvent`                                                                                          |
| Features         | `serde`, `postgres`, `graphql` (none enabled by default)                                                          |
| API docs         | [docs.rs/carbon-jupiter-swap-decoder/2.0.0](https://docs.rs/carbon-jupiter-swap-decoder/2.0.0)                    |
| Source           | [decoders/jupiter-swap-decoder](https://github.com/sevenlabs-hq/carbon/tree/v2.0.0/decoders/jupiter-swap-decoder) |

Other aggregator and routing decoders: [DFlow Aggregator v4](https://carbon.sevenlabs.org/decoders/dflow-aggregator-v4.md), [OKX DEX](https://carbon.sevenlabs.org/decoders/okx-dex.md), [OnChain Labs DEX v2](https://carbon.sevenlabs.org/decoders/onchain-labs-dex-v2.md). To decode several in one pipeline, see [aggregator and routing decoders](https://carbon.sevenlabs.org/decoders/aggregators.md).

The `serde` feature derives `Serialize`/`Deserialize` on every type, `postgres` adds tables and processors for [Postgres](https://carbon.sevenlabs.org/guides/postgres.md), and `graphql` adds a schema for the [GraphQL server](https://carbon.sevenlabs.org/guides/graphql.md).

## Usage

This program crawls recent Jupiter Swap transactions from the public RPC and prints every decoded `Route` instruction. Add the dependencies:

```sh
cargo add carbon-core@2.0.0 carbon-jupiter-swap-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_jupiter_swap_decoder::{
        instructions::JupiterSwapInstruction, JupiterSwapDecoder, PROGRAM_ID,
    },
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Fetches the program's recent transactions over JSON-RPC, newest first.
    let datasource = RpcTransactionCrawler::new(
        "https://api.mainnet-beta.solana.com".to_string(),
        PROGRAM_ID,
        ConnectionConfig::default(),
        Filters::new(None, None, None),
        None,
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .instruction(JupiterSwapDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, JupiterSwapInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, JupiterSwapInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let JupiterSwapInstruction::Route { data, accounts, .. } = input.decoded_instruction {
            println!("route {signature}: {data:?} token_program={}", accounts.token_program);
        }
        Ok(())
    }
}
```

```sh
RUST_LOG=info cargo run
```

Each `Route` instruction prints one line with the transaction signature and the decoded `Route` data. The public endpoint rate-limits requests, so the first lines can take a while; use your own RPC URL for anything beyond a test. See [stream with RPC](https://carbon.sevenlabs.org/guides/stream-with-rpc.md) for the crawler options.

Events published with Anchor's `emit_cpi!` arrive as the `CpiEvent` instruction. Match them with `JupiterSwapInstruction::CpiEvent { data: CpiEvent::FeeEvent(event), .. }` (import `instructions::CpiEvent`); see [Events](#events). If `CpiEvent` never arrives, the program logs its events with `emit!` instead: decode them with [`decode_log_events`](https://carbon.sevenlabs.org/concepts/instructions.md#log-events).

### Decode accounts

The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with `programSubscribe` on the public WebSocket endpoint and prints every decoded `TokenLedger` account as it changes. Add the datasource and the Solana RPC types it takes:

```sh
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_jupiter_swap_decoder::{accounts::JupiterSwapAccount, JupiterSwapDecoder, PROGRAM_ID},
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Streams every change to an account owned by the program (programSubscribe).
    let config = RpcProgramAccountsConfig {
        account_config: RpcAccountInfoConfig {
            encoding: Some(UiAccountEncoding::Base64),
            ..Default::default()
        },
        ..Default::default()
    };
    let datasource = RpcProgramSubscribe::new(
        "wss://api.mainnet-beta.solana.com".to_string(),
        Filters::new(PROGRAM_ID, Some(config)),
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .account(JupiterSwapDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, JupiterSwapAccount>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, JupiterSwapAccount>,
    ) -> CarbonResult<()> {
        let JupiterSwapAccount::TokenLedger(token_ledger) = &input.decoded_account.data;
        println!("token_ledger {}: {token_ledger:?}", input.metadata.pubkey);
        Ok(())
    }
}
```

```sh
RUST_LOG=info cargo run
```

Each update to a `TokenLedger` account prints its address and decoded fields; the program runs until you stop it. Cargo resolves `solana-client` to 4.2.2, the exact version the datasource pins, so both use the same `RpcProgramAccountsConfig` type. To load every existing account once instead of streaming changes, see [load account state](https://carbon.sevenlabs.org/guides/load-account-state.md).

## Instructions

Variants of `JupiterSwapInstruction`. Each is `JupiterSwapInstruction::<Variant> { program_id, data, accounts }`, where `data` and `accounts` are the types listed under the variant, exported from `carbon_jupiter_swap_decoder::instructions`. Discriminators are the leading bytes of the instruction data, in hex.

**How an instruction decodes.** The decoder returns a variant only when all of these hold; otherwise the instruction is skipped and no processor is called:

1. The instruction's program ID is `JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4`.
2. The data starts with the variant's discriminator, and the rest deserializes into its data type.
3. The instruction has at least as many accounts as the variant requires (the "Required accounts" count under each variant).

**Accounts.** They are matched by position, in the order listed. An account marked _optional_ is `None` only when the instruction ends before it; Anchor programs pass the program ID as a placeholder for an omitted optional account, so check for `Some(PROGRAM_ID)` too. Accounts after the listed ones are in `accounts.remaining` as `AccountMeta`s. The decoder doesn't record whether an account signed or was writable: read that from `input.raw_instruction.accounts[i].is_signer` and `.is_writable`, which follow the same order. It doesn't check signer, writable, owner or PDA constraints either; the program enforced those when the transaction executed, so a decoded instruction from a successful transaction already satisfied them.

### `Claim`

Discriminator `3ec6d6c1d59f6cd2` · data `Claim` · accounts `ClaimInstructionAccounts`.

| Field | Type |
| ----- | ---- |
| `id`  | `u8` |

Required accounts: 3; extras go to `remaining`.

Fields of `ClaimInstructionAccounts`, in account order:

| #  | Field               | Type               |
| -- | ------------------- | ------------------ |
| 0  | `wallet`            | `Pubkey`           |
| 1  | `program_authority` | `Pubkey`           |
| 2  | `system_program`    | `Pubkey`           |
| 3… | `remaining`         | `Vec<AccountMeta>` |

### `ClaimToken`

Discriminator `74ce1bbfa6130049` · data `ClaimToken` · accounts `ClaimTokenInstructionAccounts`.

| Field | Type |
| ----- | ---- |
| `id`  | `u8` |

Required accounts: 9; extras go to `remaining`.

Fields of `ClaimTokenInstructionAccounts`, in account order:

| #  | Field                       | Type               |
| -- | --------------------------- | ------------------ |
| 0  | `payer`                     | `Pubkey`           |
| 1  | `wallet`                    | `Pubkey`           |
| 2  | `program_authority`         | `Pubkey`           |
| 3  | `program_token_account`     | `Pubkey`           |
| 4  | `destination_token_account` | `Pubkey`           |
| 5  | `mint`                      | `Pubkey`           |
| 6  | `token_program`             | `Pubkey`           |
| 7  | `associated_token_program`  | `Pubkey`           |
| 8  | `system_program`            | `Pubkey`           |
| 9… | `remaining`                 | `Vec<AccountMeta>` |

### `CloseToken`

Discriminator `1a4aec976840b7f9` · data `CloseToken` · accounts `CloseTokenInstructionAccounts`.

| Field      | Type   |
| ---------- | ------ |
| `id`       | `u8`   |
| `burn_all` | `bool` |

Required accounts: 6; extras go to `remaining`.

Fields of `CloseTokenInstructionAccounts`, in account order:

| #  | Field                   | Type               |
| -- | ----------------------- | ------------------ |
| 0  | `operator`              | `Pubkey`           |
| 1  | `wallet`                | `Pubkey`           |
| 2  | `program_authority`     | `Pubkey`           |
| 3  | `program_token_account` | `Pubkey`           |
| 4  | `mint`                  | `Pubkey`           |
| 5  | `token_program`         | `Pubkey`           |
| 6… | `remaining`             | `Vec<AccountMeta>` |

### `CloseWsolTokenAccount`

Discriminator `cb816785c57d6b56` · data `CloseWsolTokenAccount` · accounts `CloseWsolTokenAccountInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `CloseWsolTokenAccountInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `token_account`  | `Pubkey`           |
| 1  | `user`           | `Pubkey`           |
| 2  | `token_program`  | `Pubkey`           |
| 3  | `system_program` | `Pubkey`           |
| 4… | `remaining`      | `Vec<AccountMeta>` |

### `CreateTokenAccount`

Discriminator `93f17b64f484ae76` · data `CreateTokenAccount` · accounts `CreateTokenAccountInstructionAccounts`.

| Field  | Type |
| ------ | ---- |
| `bump` | `u8` |

Required accounts: 5; extras go to `remaining`.

Fields of `CreateTokenAccountInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `token_account`  | `Pubkey`           |
| 1  | `user`           | `Pubkey`           |
| 2  | `mint`           | `Pubkey`           |
| 3  | `token_program`  | `Pubkey`           |
| 4  | `system_program` | `Pubkey`           |
| 5… | `remaining`      | `Vec<AccountMeta>` |

### `CreateTokenLedger`

Discriminator `e8f2c5fdf08f8134` · data `CreateTokenLedger` · accounts `CreateTokenLedgerInstructionAccounts`.

No data fields.

Required accounts: 3; extras go to `remaining`.

Fields of `CreateTokenLedgerInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `token_ledger`   | `Pubkey`           |
| 1  | `payer`          | `Pubkey`           |
| 2  | `system_program` | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `ExactOutRoute`

Discriminator `d033ef977b2bed5c` · data `ExactOutRoute` · accounts `ExactOutRouteInstructionAccounts`.

| Field              | Type                                   |
| ------------------ | -------------------------------------- |
| `route_plan`       | [`Vec<RoutePlanStep>`](#routeplanstep) |
| `out_amount`       | `u64`                                  |
| `quoted_in_amount` | `u64`                                  |
| `slippage_bps`     | `u16`                                  |
| `platform_fee_bps` | `u8`                                   |

Required accounts: 11; extras go to `remaining`.

Fields of `ExactOutRouteInstructionAccounts`, in account order:

| #   | Field                            | Type               |
| --- | -------------------------------- | ------------------ |
| 0   | `token_program`                  | `Pubkey`           |
| 1   | `user_transfer_authority`        | `Pubkey`           |
| 2   | `user_source_token_account`      | `Pubkey`           |
| 3   | `user_destination_token_account` | `Pubkey`           |
| 4   | `destination_token_account`      | `Option<Pubkey>`   |
| 5   | `source_mint`                    | `Pubkey`           |
| 6   | `destination_mint`               | `Pubkey`           |
| 7   | `platform_fee_account`           | `Option<Pubkey>`   |
| 8   | `token2022_program`              | `Option<Pubkey>`   |
| 9   | `event_authority`                | `Pubkey`           |
| 10  | `program`                        | `Pubkey`           |
| 11… | `remaining`                      | `Vec<AccountMeta>` |

### `ExactOutRouteV2`

Discriminator `9d8ab85215f4f324` · data `ExactOutRouteV2` · accounts `ExactOutRouteV2InstructionAccounts`.

| Field                   | Type                                       |
| ----------------------- | ------------------------------------------ |
| `out_amount`            | `u64`                                      |
| `quoted_in_amount`      | `u64`                                      |
| `slippage_bps`          | `u16`                                      |
| `platform_fee_bps`      | `u16`                                      |
| `positive_slippage_bps` | `u16`                                      |
| `route_plan`            | [`Vec<RoutePlanStepV2>`](#routeplanstepv2) |

Required accounts: 10; extras go to `remaining`.

Fields of `ExactOutRouteV2InstructionAccounts`, in account order:

| #   | Field                            | Type               |
| --- | -------------------------------- | ------------------ |
| 0   | `user_transfer_authority`        | `Pubkey`           |
| 1   | `user_source_token_account`      | `Pubkey`           |
| 2   | `user_destination_token_account` | `Pubkey`           |
| 3   | `source_mint`                    | `Pubkey`           |
| 4   | `destination_mint`               | `Pubkey`           |
| 5   | `source_token_program`           | `Pubkey`           |
| 6   | `destination_token_program`      | `Pubkey`           |
| 7   | `destination_token_account`      | `Option<Pubkey>`   |
| 8   | `event_authority`                | `Pubkey`           |
| 9   | `program`                        | `Pubkey`           |
| 10… | `remaining`                      | `Vec<AccountMeta>` |

### `Route`

Discriminator `e517cb977ae3ad2a` · data `Route` · accounts `RouteInstructionAccounts`.

| Field               | Type                                   |
| ------------------- | -------------------------------------- |
| `route_plan`        | [`Vec<RoutePlanStep>`](#routeplanstep) |
| `in_amount`         | `u64`                                  |
| `quoted_out_amount` | `u64`                                  |
| `slippage_bps`      | `u16`                                  |
| `platform_fee_bps`  | `u8`                                   |

Required accounts: 9; extras go to `remaining`.

Fields of `RouteInstructionAccounts`, in account order:

| #  | Field                            | Type               |
| -- | -------------------------------- | ------------------ |
| 0  | `token_program`                  | `Pubkey`           |
| 1  | `user_transfer_authority`        | `Pubkey`           |
| 2  | `user_source_token_account`      | `Pubkey`           |
| 3  | `user_destination_token_account` | `Pubkey`           |
| 4  | `destination_token_account`      | `Option<Pubkey>`   |
| 5  | `destination_mint`               | `Pubkey`           |
| 6  | `platform_fee_account`           | `Option<Pubkey>`   |
| 7  | `event_authority`                | `Pubkey`           |
| 8  | `program`                        | `Pubkey`           |
| 9… | `remaining`                      | `Vec<AccountMeta>` |

### `RouteV2`

Discriminator `bb64facc31c4af14` · data `RouteV2` · accounts `RouteV2InstructionAccounts`.

| Field                   | Type                                       |
| ----------------------- | ------------------------------------------ |
| `in_amount`             | `u64`                                      |
| `quoted_out_amount`     | `u64`                                      |
| `slippage_bps`          | `u16`                                      |
| `platform_fee_bps`      | `u16`                                      |
| `positive_slippage_bps` | `u16`                                      |
| `route_plan`            | [`Vec<RoutePlanStepV2>`](#routeplanstepv2) |

Required accounts: 10; extras go to `remaining`.

Fields of `RouteV2InstructionAccounts`, in account order:

| #   | Field                            | Type               |
| --- | -------------------------------- | ------------------ |
| 0   | `user_transfer_authority`        | `Pubkey`           |
| 1   | `user_source_token_account`      | `Pubkey`           |
| 2   | `user_destination_token_account` | `Pubkey`           |
| 3   | `source_mint`                    | `Pubkey`           |
| 4   | `destination_mint`               | `Pubkey`           |
| 5   | `source_token_program`           | `Pubkey`           |
| 6   | `destination_token_program`      | `Pubkey`           |
| 7   | `destination_token_account`      | `Option<Pubkey>`   |
| 8   | `event_authority`                | `Pubkey`           |
| 9   | `program`                        | `Pubkey`           |
| 10… | `remaining`                      | `Vec<AccountMeta>` |

### `RouteWithTokenLedger`

Discriminator `96564774a75d0e68` · data `RouteWithTokenLedger` · accounts `RouteWithTokenLedgerInstructionAccounts`.

| Field               | Type                                   |
| ------------------- | -------------------------------------- |
| `route_plan`        | [`Vec<RoutePlanStep>`](#routeplanstep) |
| `quoted_out_amount` | `u64`                                  |
| `slippage_bps`      | `u16`                                  |
| `platform_fee_bps`  | `u8`                                   |

Required accounts: 10; extras go to `remaining`.

Fields of `RouteWithTokenLedgerInstructionAccounts`, in account order:

| #   | Field                            | Type               |
| --- | -------------------------------- | ------------------ |
| 0   | `token_program`                  | `Pubkey`           |
| 1   | `user_transfer_authority`        | `Pubkey`           |
| 2   | `user_source_token_account`      | `Pubkey`           |
| 3   | `user_destination_token_account` | `Pubkey`           |
| 4   | `destination_token_account`      | `Option<Pubkey>`   |
| 5   | `destination_mint`               | `Pubkey`           |
| 6   | `platform_fee_account`           | `Option<Pubkey>`   |
| 7   | `token_ledger`                   | `Pubkey`           |
| 8   | `event_authority`                | `Pubkey`           |
| 9   | `program`                        | `Pubkey`           |
| 10… | `remaining`                      | `Vec<AccountMeta>` |

### `SetTokenLedger`

Discriminator `e455b9704e4f4d02` · data `SetTokenLedger` · accounts `SetTokenLedgerInstructionAccounts`.

No data fields.

Required accounts: 2; extras go to `remaining`.

Fields of `SetTokenLedgerInstructionAccounts`, in account order:

| #  | Field           | Type               |
| -- | --------------- | ------------------ |
| 0  | `token_ledger`  | `Pubkey`           |
| 1  | `token_account` | `Pubkey`           |
| 2… | `remaining`     | `Vec<AccountMeta>` |

### `SharedAccountsExactOutRoute`

Discriminator `b0d169a89a7d453e` · data `SharedAccountsExactOutRoute` · accounts `SharedAccountsExactOutRouteInstructionAccounts`.

| Field              | Type                                   |
| ------------------ | -------------------------------------- |
| `id`               | `u8`                                   |
| `route_plan`       | [`Vec<RoutePlanStep>`](#routeplanstep) |
| `out_amount`       | `u64`                                  |
| `quoted_in_amount` | `u64`                                  |
| `slippage_bps`     | `u16`                                  |
| `platform_fee_bps` | `u8`                                   |

Required accounts: 13; extras go to `remaining`.

Fields of `SharedAccountsExactOutRouteInstructionAccounts`, in account order:

| #   | Field                               | Type               |
| --- | ----------------------------------- | ------------------ |
| 0   | `token_program`                     | `Pubkey`           |
| 1   | `program_authority`                 | `Pubkey`           |
| 2   | `user_transfer_authority`           | `Pubkey`           |
| 3   | `source_token_account`              | `Pubkey`           |
| 4   | `program_source_token_account`      | `Pubkey`           |
| 5   | `program_destination_token_account` | `Pubkey`           |
| 6   | `destination_token_account`         | `Pubkey`           |
| 7   | `source_mint`                       | `Pubkey`           |
| 8   | `destination_mint`                  | `Pubkey`           |
| 9   | `platform_fee_account`              | `Option<Pubkey>`   |
| 10  | `token2022_program`                 | `Option<Pubkey>`   |
| 11  | `event_authority`                   | `Pubkey`           |
| 12  | `program`                           | `Pubkey`           |
| 13… | `remaining`                         | `Vec<AccountMeta>` |

### `SharedAccountsExactOutRouteV2`

Discriminator `3560e5cad8bbfa18` · data `SharedAccountsExactOutRouteV2` · accounts `SharedAccountsExactOutRouteV2InstructionAccounts`.

| Field                   | Type                                       |
| ----------------------- | ------------------------------------------ |
| `id`                    | `u8`                                       |
| `out_amount`            | `u64`                                      |
| `quoted_in_amount`      | `u64`                                      |
| `slippage_bps`          | `u16`                                      |
| `platform_fee_bps`      | `u16`                                      |
| `positive_slippage_bps` | `u16`                                      |
| `route_plan`            | [`Vec<RoutePlanStepV2>`](#routeplanstepv2) |

Required accounts: 12; extras go to `remaining`.

Fields of `SharedAccountsExactOutRouteV2InstructionAccounts`, in account order:

| #   | Field                               | Type               |
| --- | ----------------------------------- | ------------------ |
| 0   | `program_authority`                 | `Pubkey`           |
| 1   | `user_transfer_authority`           | `Pubkey`           |
| 2   | `source_token_account`              | `Pubkey`           |
| 3   | `program_source_token_account`      | `Pubkey`           |
| 4   | `program_destination_token_account` | `Pubkey`           |
| 5   | `destination_token_account`         | `Pubkey`           |
| 6   | `source_mint`                       | `Pubkey`           |
| 7   | `destination_mint`                  | `Pubkey`           |
| 8   | `source_token_program`              | `Pubkey`           |
| 9   | `destination_token_program`         | `Pubkey`           |
| 10  | `event_authority`                   | `Pubkey`           |
| 11  | `program`                           | `Pubkey`           |
| 12… | `remaining`                         | `Vec<AccountMeta>` |

### `SharedAccountsRoute`

Discriminator `c1209b3341d69c81` · data `SharedAccountsRoute` · accounts `SharedAccountsRouteInstructionAccounts`.

| Field               | Type                                   |
| ------------------- | -------------------------------------- |
| `id`                | `u8`                                   |
| `route_plan`        | [`Vec<RoutePlanStep>`](#routeplanstep) |
| `in_amount`         | `u64`                                  |
| `quoted_out_amount` | `u64`                                  |
| `slippage_bps`      | `u16`                                  |
| `platform_fee_bps`  | `u8`                                   |

Required accounts: 13; extras go to `remaining`.

Fields of `SharedAccountsRouteInstructionAccounts`, in account order:

| #   | Field                               | Type               |
| --- | ----------------------------------- | ------------------ |
| 0   | `token_program`                     | `Pubkey`           |
| 1   | `program_authority`                 | `Pubkey`           |
| 2   | `user_transfer_authority`           | `Pubkey`           |
| 3   | `source_token_account`              | `Pubkey`           |
| 4   | `program_source_token_account`      | `Pubkey`           |
| 5   | `program_destination_token_account` | `Pubkey`           |
| 6   | `destination_token_account`         | `Pubkey`           |
| 7   | `source_mint`                       | `Pubkey`           |
| 8   | `destination_mint`                  | `Pubkey`           |
| 9   | `platform_fee_account`              | `Option<Pubkey>`   |
| 10  | `token2022_program`                 | `Option<Pubkey>`   |
| 11  | `event_authority`                   | `Pubkey`           |
| 12  | `program`                           | `Pubkey`           |
| 13… | `remaining`                         | `Vec<AccountMeta>` |

### `SharedAccountsRouteV2`

Discriminator `d19853937cfed8e9` · data `SharedAccountsRouteV2` · accounts `SharedAccountsRouteV2InstructionAccounts`.

| Field                   | Type                                       |
| ----------------------- | ------------------------------------------ |
| `id`                    | `u8`                                       |
| `in_amount`             | `u64`                                      |
| `quoted_out_amount`     | `u64`                                      |
| `slippage_bps`          | `u16`                                      |
| `platform_fee_bps`      | `u16`                                      |
| `positive_slippage_bps` | `u16`                                      |
| `route_plan`            | [`Vec<RoutePlanStepV2>`](#routeplanstepv2) |

Required accounts: 12; extras go to `remaining`.

Fields of `SharedAccountsRouteV2InstructionAccounts`, in account order:

| #   | Field                               | Type               |
| --- | ----------------------------------- | ------------------ |
| 0   | `program_authority`                 | `Pubkey`           |
| 1   | `user_transfer_authority`           | `Pubkey`           |
| 2   | `source_token_account`              | `Pubkey`           |
| 3   | `program_source_token_account`      | `Pubkey`           |
| 4   | `program_destination_token_account` | `Pubkey`           |
| 5   | `destination_token_account`         | `Pubkey`           |
| 6   | `source_mint`                       | `Pubkey`           |
| 7   | `destination_mint`                  | `Pubkey`           |
| 8   | `source_token_program`              | `Pubkey`           |
| 9   | `destination_token_program`         | `Pubkey`           |
| 10  | `event_authority`                   | `Pubkey`           |
| 11  | `program`                           | `Pubkey`           |
| 12… | `remaining`                         | `Vec<AccountMeta>` |

### `SharedAccountsRouteWithTokenLedger`

Discriminator `e6798f50779f6aaa` · data `SharedAccountsRouteWithTokenLedger` · accounts `SharedAccountsRouteWithTokenLedgerInstructionAccounts`.

| Field               | Type                                   |
| ------------------- | -------------------------------------- |
| `id`                | `u8`                                   |
| `route_plan`        | [`Vec<RoutePlanStep>`](#routeplanstep) |
| `quoted_out_amount` | `u64`                                  |
| `slippage_bps`      | `u16`                                  |
| `platform_fee_bps`  | `u8`                                   |

Required accounts: 14; extras go to `remaining`.

Fields of `SharedAccountsRouteWithTokenLedgerInstructionAccounts`, in account order:

| #   | Field                               | Type               |
| --- | ----------------------------------- | ------------------ |
| 0   | `token_program`                     | `Pubkey`           |
| 1   | `program_authority`                 | `Pubkey`           |
| 2   | `user_transfer_authority`           | `Pubkey`           |
| 3   | `source_token_account`              | `Pubkey`           |
| 4   | `program_source_token_account`      | `Pubkey`           |
| 5   | `program_destination_token_account` | `Pubkey`           |
| 6   | `destination_token_account`         | `Pubkey`           |
| 7   | `source_mint`                       | `Pubkey`           |
| 8   | `destination_mint`                  | `Pubkey`           |
| 9   | `platform_fee_account`              | `Option<Pubkey>`   |
| 10  | `token2022_program`                 | `Option<Pubkey>`   |
| 11  | `token_ledger`                      | `Pubkey`           |
| 12  | `event_authority`                   | `Pubkey`           |
| 13  | `program`                           | `Pubkey`           |
| 14… | `remaining`                         | `Vec<AccountMeta>` |

### `CpiEvent`

Anchor self-CPI that carries one of the program's [events](#events). `data` is the `CpiEvent` enum.

Discriminator `e445a52e51cb9a1d` · data `CpiEvent` · accounts `CpiEventInstructionAccounts`.

Required accounts: 2; extras go to `remaining`.

Fields of `CpiEventInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `program`         | `Pubkey`           |
| 1  | `event_authority` | `Pubkey`           |
| 2… | `remaining`       | `Vec<AccountMeta>` |

## Accounts

Variants of `JupiterSwapAccount`. Each wraps a boxed struct from `carbon_jupiter_swap_decoder::accounts::<module>`. `decode_account` only considers accounts owned by `PROGRAM_ID` and returns the first variant that matches.

### `TokenLedger`

Discriminator `9cf709bc366c554d` · `accounts::token_ledger::TokenLedger`.

| Field           | Type     |
| --------------- | -------- |
| `token_account` | `Pubkey` |
| `amount`        | `u64`    |

## Events

Variants of `instructions::CpiEvent`, decoded from the `CpiEvent` instruction. Each wraps a struct from `carbon_jupiter_swap_decoder::events::<module>`. The discriminator is the 8-byte event discriminator that follows the `e445a52e51cb9a1d` CPI-event tag.

### `FeeEvent`

Discriminator `494f4e7fb8d50ddc` · `events::fee_event::FeeEventEvent`.

| Field     | Type     |
| --------- | -------- |
| `account` | `Pubkey` |
| `mint`    | `Pubkey` |
| `amount`  | `u64`    |

### `SwapEvent`

Discriminator `40c6cde8260871e2` · `events::swap_event::SwapEventEvent`.

| Field           | Type     |
| --------------- | -------- |
| `amm`           | `Pubkey` |
| `input_mint`    | `Pubkey` |
| `input_amount`  | `u64`    |
| `output_mint`   | `Pubkey` |
| `output_amount` | `u64`    |

### `SwapsEvent`

Discriminator `982f4eebc0606e6a` · `events::swaps_event::SwapsEventEvent`.

| Field         | Type                               |
| ------------- | ---------------------------------- |
| `swap_events` | [`Vec<SwapEventV2>`](#swapeventv2) |

### `CandidateSwapResults`

Discriminator `2d09f41ee534a87b` · `events::candidate_swap_results::CandidateSwapResultsEvent`.

| Field     | Type                                               |
| --------- | -------------------------------------------------- |
| `results` | [`Vec<CandidateSwapResult>`](#candidateswapresult) |

### `CandidateSwapQuoteError`

Discriminator `f886253791b1724f` · `events::candidate_swap_quote_error::CandidateSwapQuoteErrorEvent`.

| Field             | Type  |
| ----------------- | ----- |
| `candidate_index` | `u64` |
| `in_amount`       | `u64` |
| `error_code`      | `u64` |

### `BestSwapOutAmountViolation`

Discriminator `7c42c433daad2e5d` · `events::best_swap_out_amount_violation::BestSwapOutAmountViolationEvent`.

| Field                 | Type  |
| --------------------- | ----- |
| `expected_out_amount` | `u64` |
| `out_amount`          | `u64` |

## Types

Types used by the instructions, accounts and events above, exported from `carbon_jupiter_swap_decoder::types`.

### `AccountsType`

Enum `types::AccountsType`.

| Variant                     |
| --------------------------- |
| `TransferHookA`             |
| `TransferHookB`             |
| `TransferHookReward`        |
| `TransferHookInput`         |
| `TransferHookIntermediate`  |
| `TransferHookOutput`        |
| `SupplementalTickArrays`    |
| `SupplementalTickArraysOne` |
| `SupplementalTickArraysTwo` |

### `BestSwapOutAmountViolation`

Struct `types::BestSwapOutAmountViolation`. Same fields as the [`BestSwapOutAmountViolation`](#bestswapoutamountviolation) event.

### `CandidateSwap`

Enum `types::CandidateSwap`.

| Variant       | Fields                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------------------ |
| `HumidiFi`    | `swap_id`: `u64`, `is_base_to_quote`: `bool`                                                           |
| `TesseraV`    | `side`: [`Side`](#side)                                                                                |
| `HumidiFiV2`  | `swap_id`: `u64`, `is_base_to_quote`: `bool`                                                           |
| `RaydiumV2`   |                                                                                                        |
| `RaydiumClmm` |                                                                                                        |
| `Whirlpool`   | `a_to_b`: `bool`                                                                                       |
| `ZeroFi`      |                                                                                                        |
| `BisonFiV2`   | `a_to_b`: `bool`                                                                                       |
| `GoonFiV2`    | `is_bid`: `bool`                                                                                       |
| `GoonFiV3`    | `is_bid`: `bool`                                                                                       |
| `WhirlpoolV2` | `a_to_b`: `bool`, `remaining_accounts_info`: [`Option<RemainingAccountsInfo>`](#remainingaccountsinfo) |

### `CandidateSwapQuoteError`

Struct `types::CandidateSwapQuoteError`. Same fields as the [`CandidateSwapQuoteError`](#candidateswapquoteerror) event.

### `CandidateSwapResult`

Enum `types::CandidateSwapResult`.

| Variant        | Fields |
| -------------- | ------ |
| `OutAmount`    | `u64`  |
| `ProgramError` | `u64`  |

### `CandidateSwapResults`

Struct `types::CandidateSwapResults`. Same fields as the [`CandidateSwapResults`](#candidateswapresults) event.

### `CandidateSwapWithBps`

Struct `types::CandidateSwapWithBps`.

| Field            | Type                              |
| ---------------- | --------------------------------- |
| `candidate_swap` | [`CandidateSwap`](#candidateswap) |
| `bps`            | `u32`                             |

### `DefiTunaAccountsType`

Enum `types::DefiTunaAccountsType`.

| Variant                     |
| --------------------------- |
| `TransferHookA`             |
| `TransferHookB`             |
| `TransferHookInput`         |
| `TransferHookIntermediate`  |
| `TransferHookOutput`        |
| `SupplementalTickArrays`    |
| `SupplementalTickArraysOne` |
| `SupplementalTickArraysTwo` |

### `FeeEvent`

Struct `types::FeeEvent`. Same fields as the [`FeeEvent`](#feeevent) event.

### `HyloSwapType`

Enum `types::HyloSwapType`.

| Variant                 |
| ----------------------- |
| `MintStable`            |
| `RedeemStable`          |
| `MintLever`             |
| `RedeemLever`           |
| `SwapStableToLever`     |
| `SwapLeverToStable`     |
| `StabilityPoolDeposit`  |
| `StabilityPoolWithdraw` |

### `RemainingAccountsInfo`

Struct `types::RemainingAccountsInfo`.

| Field    | Type                                                     |
| -------- | -------------------------------------------------------- |
| `slices` | [`Vec<RemainingAccountsSlice>`](#remainingaccountsslice) |

### `RemainingAccountsSlice`

Struct `types::RemainingAccountsSlice`.

| Field           | Type |
| --------------- | ---- |
| `accounts_type` | `u8` |
| `length`        | `u8` |

### `RoutePlanStep`

Struct `types::RoutePlanStep`.

| Field          | Type            |
| -------------- | --------------- |
| `swap`         | [`Swap`](#swap) |
| `percent`      | `u8`            |
| `input_index`  | `u8`            |
| `output_index` | `u8`            |

### `RoutePlanStepV2`

Struct `types::RoutePlanStepV2`.

| Field          | Type            |
| -------------- | --------------- |
| `swap`         | [`Swap`](#swap) |
| `bps`          | `u16`           |
| `input_index`  | `u8`            |
| `output_index` | `u8`            |

### `Side`

Enum `types::Side`.

| Variant |
| ------- |
| `Bid`   |
| `Ask`   |

### `Swap`

Enum `types::Swap`.

| Variant                                               | Fields                                                                                                                               |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `Saber`                                               |                                                                                                                                      |
| `SaberAddDecimalsDeposit`                             |                                                                                                                                      |
| `SaberAddDecimalsWithdraw`                            |                                                                                                                                      |
| `TokenSwap`                                           |                                                                                                                                      |
| `Sencha`                                              |                                                                                                                                      |
| `Step`                                                |                                                                                                                                      |
| `Cropper`                                             |                                                                                                                                      |
| `Raydium`                                             |                                                                                                                                      |
| `Crema`                                               | `a_to_b`: `bool`                                                                                                                     |
| `Lifinity`                                            |                                                                                                                                      |
| `Mercurial`                                           |                                                                                                                                      |
| `Cykura`                                              |                                                                                                                                      |
| `Serum`                                               | `side`: [`Side`](#side)                                                                                                              |
| `MarinadeDeposit`                                     |                                                                                                                                      |
| `MarinadeUnstake`                                     |                                                                                                                                      |
| `Aldrin`                                              | `side`: [`Side`](#side)                                                                                                              |
| `AldrinV2`                                            | `side`: [`Side`](#side)                                                                                                              |
| `Whirlpool`                                           | `a_to_b`: `bool`                                                                                                                     |
| `Invariant`                                           | `x_to_y`: `bool`                                                                                                                     |
| `Meteora`                                             |                                                                                                                                      |
| `GooseFX`                                             |                                                                                                                                      |
| `DeltaFi`                                             | `stable`: `bool`                                                                                                                     |
| `Balansol`                                            |                                                                                                                                      |
| `MarcoPolo`                                           | `x_to_y`: `bool`                                                                                                                     |
| `Dradex`                                              | `side`: [`Side`](#side)                                                                                                              |
| `LifinityV2`                                          |                                                                                                                                      |
| `RaydiumClmm`                                         |                                                                                                                                      |
| `Openbook`                                            | `side`: [`Side`](#side)                                                                                                              |
| `Phoenix`                                             | `side`: [`Side`](#side)                                                                                                              |
| `Symmetry`                                            | `from_token_id`: `u64`, `to_token_id`: `u64`                                                                                         |
| `TokenSwapV2`                                         |                                                                                                                                      |
| `HeliumTreasuryManagementRedeemV0`                    |                                                                                                                                      |
| `StakeDexStakeWrappedSol`                             |                                                                                                                                      |
| `StakeDexSwapViaStake`                                | `bridge_stake_seed`: `u32`                                                                                                           |
| `GooseFXV2`                                           |                                                                                                                                      |
| `Perps`                                               |                                                                                                                                      |
| `PerpsAddLiquidity`                                   |                                                                                                                                      |
| `PerpsRemoveLiquidity`                                |                                                                                                                                      |
| `MeteoraDlmm`                                         |                                                                                                                                      |
| `OpenBookV2`                                          | `side`: [`Side`](#side)                                                                                                              |
| `RaydiumClmmV2`                                       |                                                                                                                                      |
| `StakeDexPrefundWithdrawStakeAndDepositStake`         | `bridge_stake_seed`: `u32`                                                                                                           |
| `Clone`                                               | `pool_index`: `u8`, `quantity_is_input`: `bool`, `quantity_is_collateral`: `bool`                                                    |
| `SanctumS`                                            | `src_lst_value_calc_accs`: `u8`, `dst_lst_value_calc_accs`: `u8`, `src_lst_index`: `u32`, `dst_lst_index`: `u32`                     |
| `SanctumSAddLiquidity`                                | `lst_value_calc_accs`: `u8`, `lst_index`: `u32`                                                                                      |
| `SanctumSRemoveLiquidity`                             | `lst_value_calc_accs`: `u8`, `lst_index`: `u32`                                                                                      |
| `RaydiumCP`                                           |                                                                                                                                      |
| `WhirlpoolSwapV2`                                     | `a_to_b`: `bool`, `remaining_accounts_info`: [`Option<RemainingAccountsInfo>`](#remainingaccountsinfo)                               |
| `OneIntro`                                            |                                                                                                                                      |
| `PumpWrappedBuy`                                      |                                                                                                                                      |
| `PumpWrappedSell`                                     |                                                                                                                                      |
| `PerpsV2`                                             |                                                                                                                                      |
| `PerpsV2AddLiquidity`                                 |                                                                                                                                      |
| `PerpsV2RemoveLiquidity`                              |                                                                                                                                      |
| `MoonshotWrappedBuy`                                  |                                                                                                                                      |
| `MoonshotWrappedSell`                                 |                                                                                                                                      |
| `StabbleStableSwap`                                   |                                                                                                                                      |
| `StabbleWeightedSwap`                                 |                                                                                                                                      |
| `Obric`                                               | `x_to_y`: `bool`                                                                                                                     |
| `FoxBuyFromEstimatedCost`                             |                                                                                                                                      |
| `FoxClaimPartial`                                     | `is_y`: `bool`                                                                                                                       |
| `SolFi`                                               | `is_quote_to_base`: `bool`                                                                                                           |
| `SolayerDelegateNoInit`                               |                                                                                                                                      |
| `SolayerUndelegateNoInit`                             |                                                                                                                                      |
| `TokenMill`                                           | `side`: [`Side`](#side)                                                                                                              |
| `DaosFunBuy`                                          |                                                                                                                                      |
| `DaosFunSell`                                         |                                                                                                                                      |
| `ZeroFi`                                              |                                                                                                                                      |
| `StakeDexWithdrawWrappedSol`                          |                                                                                                                                      |
| `VirtualsBuy`                                         |                                                                                                                                      |
| `VirtualsSell`                                        |                                                                                                                                      |
| `Perena`                                              | `in_index`: `u8`, `out_index`: `u8`                                                                                                  |
| `PumpSwapBuy`                                         |                                                                                                                                      |
| `PumpSwapSell`                                        |                                                                                                                                      |
| `Gamma`                                               |                                                                                                                                      |
| `MeteoraDlmmSwapV2`                                   | `remaining_accounts_info`: [`RemainingAccountsInfo`](#remainingaccountsinfo)                                                         |
| `Woofi`                                               |                                                                                                                                      |
| `MeteoraDammV2`                                       |                                                                                                                                      |
| `MeteoraDynamicBondingCurveSwap`                      |                                                                                                                                      |
| `StabbleStableSwapV2`                                 |                                                                                                                                      |
| `StabbleWeightedSwapV2`                               |                                                                                                                                      |
| `RaydiumLaunchlabBuy`                                 | `share_fee_rate`: `u64`                                                                                                              |
| `RaydiumLaunchlabSell`                                | `share_fee_rate`: `u64`                                                                                                              |
| `BoopdotfunWrappedBuy`                                |                                                                                                                                      |
| `BoopdotfunWrappedSell`                               |                                                                                                                                      |
| `Plasma`                                              | `side`: [`Side`](#side)                                                                                                              |
| `GoonFi`                                              | `is_bid`: `bool`, `blacklist_bump`: `u8`                                                                                             |
| `HumidiFi`                                            | `swap_id`: `u64`, `is_base_to_quote`: `bool`                                                                                         |
| `MeteoraDynamicBondingCurveSwapWithRemainingAccounts` |                                                                                                                                      |
| `TesseraV`                                            | `side`: [`Side`](#side)                                                                                                              |
| `PumpWrappedBuyV2`                                    |                                                                                                                                      |
| `PumpWrappedSellV2`                                   |                                                                                                                                      |
| `PumpSwapBuyV2`                                       |                                                                                                                                      |
| `PumpSwapSellV2`                                      |                                                                                                                                      |
| `Heaven`                                              | `a_to_b`: `bool`                                                                                                                     |
| `SolFiV2`                                             | `is_quote_to_base`: `bool`                                                                                                           |
| `Aquifer`                                             |                                                                                                                                      |
| `PumpWrappedBuyV3`                                    |                                                                                                                                      |
| `PumpWrappedSellV3`                                   |                                                                                                                                      |
| `PumpSwapBuyV3`                                       |                                                                                                                                      |
| `PumpSwapSellV3`                                      |                                                                                                                                      |
| `JupiterLendDeposit`                                  |                                                                                                                                      |
| `JupiterLendRedeem`                                   |                                                                                                                                      |
| `DefiTuna`                                            | `a_to_b`: `bool`, `remaining_accounts_info`: [`Option<RemainingAccountsInfo>`](#remainingaccountsinfo)                               |
| `AlphaQ`                                              | `a_to_b`: `bool`                                                                                                                     |
| `RaydiumV2`                                           |                                                                                                                                      |
| `SarosDlmm`                                           | `swap_for_y`: `bool`                                                                                                                 |
| `Futarchy`                                            | `side`: [`Side`](#side)                                                                                                              |
| `MeteoraDammV2WithRemainingAccounts`                  |                                                                                                                                      |
| `Obsidian`                                            |                                                                                                                                      |
| `WhaleStreet`                                         | `side`: [`Side`](#side)                                                                                                              |
| `DynamicV1`                                           | `candidate_swaps`: [`Vec<CandidateSwap>`](#candidateswap), `best_position`: `Option<u8>`                                             |
| `PumpWrappedBuyV4`                                    |                                                                                                                                      |
| `PumpWrappedSellV4`                                   |                                                                                                                                      |
| `CarrotIssue`                                         |                                                                                                                                      |
| `CarrotRedeem`                                        |                                                                                                                                      |
| `Manifest`                                            | `side`: [`Side`](#side)                                                                                                              |
| `BisonFi`                                             | `a_to_b`: `bool`                                                                                                                     |
| `HumidiFiV2`                                          | `swap_id`: `u64`, `is_base_to_quote`: `bool`                                                                                         |
| `PerenaStar`                                          | `is_mint`: `bool`                                                                                                                    |
| `JupiterRfqV2`                                        | `side`: [`Side`](#side), `fill_data`: `Vec<u8>`                                                                                      |
| `GoonFiV2`                                            | `is_bid`: `bool`                                                                                                                     |
| `Scorch`                                              | `swap_id`: `u128`                                                                                                                    |
| `VaultLiquidUnstake`                                  | `lst_amounts`: `[u64; 5]`, `seed`: `u64`                                                                                             |
| `XOrca`                                               |                                                                                                                                      |
| `Quantum`                                             | `side`: [`Side`](#side)                                                                                                              |
| `WhaleStreetV2`                                       | `side`: [`Side`](#side), `auth_amount_in`: `u64`, `auth`: `u64`                                                                      |
| `Riptide`                                             | `amount_is_token_a`: `bool`                                                                                                          |
| `RunnerRodeo`                                         |                                                                                                                                      |
| `TaurusFi`                                            | `is_base_in`: `bool`                                                                                                                 |
| `Omnipair`                                            |                                                                                                                                      |
| `MSwap`                                               |                                                                                                                                      |
| `Hylo`                                                | `swap_type`: [`HyloSwapType`](#hyloswaptype)                                                                                         |
| `VoltrDeposit`                                        |                                                                                                                                      |
| `VoltrWithdraw`                                       |                                                                                                                                      |
| `SanctumSV2`                                          | `src_lst_value_calc_accs`: `u8`, `dst_lst_value_calc_accs`: `u8`, `src_lst_index`: `u32`, `dst_lst_index`: `u32`                     |
| `LemmingsFi`                                          | `is_base_in`: `bool`                                                                                                                 |
| `ScaleVmmBuy`                                         |                                                                                                                                      |
| `ScaleVmmSell`                                        |                                                                                                                                      |
| `ScaleAmmBuy`                                         |                                                                                                                                      |
| `ScaleAmmSell`                                        |                                                                                                                                      |
| `BisonFiV2`                                           | `a_to_b`: `bool`                                                                                                                     |
| `Trends`                                              |                                                                                                                                      |
| `HumaDeposit`                                         |                                                                                                                                      |
| `HumaInstantWithdraw`                                 |                                                                                                                                      |
| `Kipseli`                                             | `is_base_to_quote`: `bool`                                                                                                           |
| `DynamicV2`                                           | `candidate_swaps`: [`Vec<CandidateSwapWithBps>`](#candidateswapwithbps), `max_split_quote_calls`: `u8`, `max_split_candidates`: `u8` |
| `PumpSwapBuyV3WithCashbackClaim`                      |                                                                                                                                      |
| `PumpSwapSellV3WithCashbackClaim`                     |                                                                                                                                      |
| `PumpWrappedBuyV4WithCashbackClaim`                   |                                                                                                                                      |
| `PumpWrappedSellV4WithCashbackClaim`                  |                                                                                                                                      |
| `GoonFiV3`                                            | `is_bid`: `bool`                                                                                                                     |

### `SwapEvent`

Struct `types::SwapEvent`. Same fields as the [`SwapEvent`](#swapevent) event.

### `SwapEventV2`

Struct `types::SwapEventV2`.

| Field           | Type     |
| --------------- | -------- |
| `input_mint`    | `Pubkey` |
| `input_amount`  | `u64`    |
| `output_mint`   | `Pubkey` |
| `output_amount` | `u64`    |

### `SwapsEvent`

Struct `types::SwapsEvent`. Same fields as the [`SwapsEvent`](#swapsevent) event.

---

Carbon 2.0.0 documentation · Web: https://carbon.sevenlabs.org/decoders/jupiter-swap · Last updated 2026-11-09 · Index of all pages: https://carbon.sevenlabs.org/llms.txt
