1. Decoders

Decoders

All 63 program decoders published with Carbon 2.0.0: crates, program IDs and what each one decodes.

On this page

Carbon 2.0.0 ships 63 decoder crates for Solana programs, covering 1895 instructions, 301 account types and 455 events. Each page lists the crate, program ID, every instruction with its discriminator, data fields and accounts, every account and event, and a runnable example.

What a decoder is#

A decoder crate turns raw instructions and account data of one program into Rust types. Every crate exports the same items:

ItemWhat it is
PROGRAM_IDThe program's address, a Pubkey constant. Use it to point a datasource at the program.
<Program>DecoderA unit struct that implements InstructionDecoder and AccountDecoder. Pass it to the pipeline builder.
instructions::<Program>InstructionOne variant per instruction: { program_id, data, accounts }, with typed instruction data and named accounts.
accounts::<Program>AccountOne variant per account type, wrapping the decoded struct.
instructions::CpiEventFor Anchor programs that emit events with emit_cpi!: one variant per event.
typesStructs and enums used inside instructions, accounts and events.

Every crate has the optional features serde, postgres and graphql. See decoders for how decoding fits into a pipeline.

Use a decoder#

Add the crate at the same version as carbon-core, then register the decoder with a processor for its instruction or account enum:

Terminal
cargo add carbon-core@2.0.0 carbon-pump-swap-decoder@2.0.0

This fragment goes in your pipeline setup; BuyLogger and PoolLogger are your processors:

Rust
use carbon_pump_swap_decoder::{PumpSwapDecoder, PROGRAM_ID};

Pipeline::builder()
    .datasource(datasource) // e.g. an RpcTransactionCrawler for PROGRAM_ID
    .instruction(PumpSwapDecoder, BuyLogger)
    .account(PumpSwapDecoder, PoolLogger)
    .build()?
    .run()
    .await

Each decoder page has a complete program in its Usage section, and the quickstart walks through one end to end. To decode several programs in one pipeline, see multiple programs.

Generate your own#

Every crate here is generated by the Carbon CLI from the program's Anchor or Codama IDL. For a program that is not listed, generate a decoder the same way: see generate a decoder. To write one by hand, see custom decoder.

Catalog#

Instruction counts exclude the CpiEvent wrapper. Program IDs are the mainnet addresses compiled into each crate as PROGRAM_ID.

Core & SPL#

See core and SPL program decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Address Lookup Tablecarbon-address-lookup-table-decoderAddressLookupTab1e1111111111111111111111111510
Associated Token Accountcarbon-associated-token-account-decoderATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL300
SPL Memocarbon-memo-program-decoderMemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr100
SPL Name Servicecarbon-name-service-decodernamesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX510
SPL Tokencarbon-token-program-decoderTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA2830
Stake Programcarbon-stake-program-decoderStake111111111111111111111111111111111111111800
System Programcarbon-system-program-decoder111111111111111111111111111111111310
Token-2022carbon-token-2022-decoderTokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb9130

DEX & AMM#

See dEX and AMM decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
BonkSwapcarbon-bonkswap-decoderBSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p1950
FluxBeamcarbon-fluxbeam-decoderFLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X600
Gavelcarbon-gavel-decodersrAMMzfVHVAtgSJc8iH6CfKzuWuUTzLHVCE81QU1rgi1020
Heavencarbon-heaven-decoderHEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o5467
Jupiter Limit Ordercarbon-jupiter-limit-order-decoderjupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu923
Jupiter Limit Order v2carbon-jupiter-limit-order-2-decoderj1o2qRpjcyUwEvwtcfhEQefh773ZgjxcVRry7LDqg5X824
Kamino Limit Ordercarbon-kamino-limit-order-decoderLiMoM9rMhrdYrfzUCxQppvxCSG1FcrUK9G8uLq4A1GF1532
Lifinity AMM v2carbon-lifinity-amm-v2-decoder2wT8Yq49kHgDzXuPxZSaeLaH1qbmGXtEyPy64bL7aD3c310
Meteora DAMM v2carbon-meteora-damm-v2-decodercpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG38923
Meteora DLMMcarbon-meteora-dlmm-decoderLBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo761230
Meteora Poolscarbon-meteora-pools-decoderEo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB26318
OpenBook v2carbon-openbook-v2-decoderopnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb2968
Orca Whirlpoolscarbon-orca-whirlpool-decoderwhirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc66126
PancakeSwapcarbon-pancake-swap-decoderHpNfyc2Saw7RKkQd8nEL4khUcuPhQ7WwY1B2qjx8jxFq271011
Phoenix v1carbon-phoenix-v1-decoderPhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY2800
PumpSwapcarbon-pump-swap-decoderpAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA25722
Raydium AMM v4carbon-raydium-amm-v4-decoder675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp81830
Raydium CLMMcarbon-raydium-clmm-decoderCAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK341215
Raydium CPMMcarbon-raydium-cpmm-decoderCPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C1442
Raydium Stable Swapcarbon-raydium-stable-swap-decoder5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h600
Stabble Stable Swapcarbon-stabble-stable-swap-decoderswapNyd8XiQwJ6ianp9snpu4brUqFxadzvHebnAXjJZ1932
Stabble Weighted Swapcarbon-stabble-weighted-swap-decoderswapFpHZwjELNnjvThjajtiVmkz3yPQEHjLtka2fwHW1322

Lending#

See lending decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Jupiter Lendcarbon-jupiter-lend-decoderjupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC24719
Kamino Lendingcarbon-kamino-lending-decoderKLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD63105
Kamino Vaultcarbon-kamino-vault-decoderkvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr1220
marginfi v2carbon-marginfi-v2-decoderMFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA911530
Meteora Vaultcarbon-meteora-vault-decoder24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi1428
Sharkycarbon-sharky-decoderSHARKobtfF1bHhxD2eqftjHBdVSCbKo9JtgK71FhELP3590

Perpetuals & derivatives#

See perpetuals and derivatives decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Drift v2carbon-drift-v2-decoderdRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH2492726
Jupiter Perpetualscarbon-jupiter-perpetuals-decoderPERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu59825
Zeta Marketscarbon-zeta-decoderZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD107238

Launchpads#

See launchpad decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Boopcarbon-boop-decoderboop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry429425
Meteora DBCcarbon-meteora-dbc-decoderdbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN28923
Moonshotcarbon-moonshot-decoderMoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG622
Pump.funcarbon-pumpfun-decoder6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P38623
Raydium Launchpadcarbon-raydium-launchpad-decoderLanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj2554
Vertigocarbon-vertigo-decodervrTGoBuy5rYSxAfV3jaRJWHH6nN9WK4NRExGxsk1bCJ613
Virtualscarbon-virtuals-decoder5U3EU2ubXtK84QcRjWVmYt9RaDyA8gKxdUrPFXmZyaki814
Wavebreakcarbon-wavebreak-decoderwaveQX2yP3H1pVU8djGvEHmYg8uamQ84AuyGtpsrXTF6450

Liquid staking & restaking#

See liquid staking and restaking decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Marinade Financecarbon-marinade-finance-decoderMarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD28225
Solayer Restakingcarbon-solayer-restaking-program-decodersSo1iU21jBrU9VaJ8PJib1MtorefUV4fzC9GURa2KNn410

NFTs & metadata#

See nFT and metadata decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Bubblegumcarbon-bubblegum-decoderBGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY1720
Metaplex Corecarbon-mpl-core-decoderCoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d4260
Metaplex Token Metadatacarbon-mpl-token-metadata-decodermetaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s58140

Bridges & messaging#

See bridge and messaging decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Circle CCTP Message Transmitter v2carbon-circle-message-transmitter-v2-decoderCCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC15311
Circle CCTP Token Messenger v2carbon-circle-token-messenger-v2-decoderCCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe25722

Aggregators & routing#

See aggregator and routing decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
DFlow Aggregator v4carbon-dflow-aggregator-v4-decoderDF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH1712
Jupiter Swapcarbon-jupiter-swap-decoderJUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV41716
OKX DEXcarbon-okx-dex-decoder6m2CDdhRgxpH4WjvdzxAYbGxwdGUz5MziiL5jek2kBma1402
OnChain Labs DEX v2carbon-onchain-labs-dex-v2-decoderproVF4pMXVaYqmy4NjniPh4pqKNfMmsihgd4wdkCX3u1916

Other#

See other program decoders for these programs together.

ProgramCrateProgram IDInstructionsAccountsEvents
Jupiter DCAcarbon-jupiter-dca-decoderDCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M1216
Kamino Farmscarbon-kamino-farms-decoderFarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr2640
Pump Feescarbon-pump-fees-decoderpfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ17714
Raydium Liquidity Lockingcarbon-raydium-liquidity-locking-decoderLockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE421
Swigcarbon-swig-decoderswigypWHEksbC64pWKwah1WTeh9JXwx8H1rJHLdbQMB1500

Your endpoints

Code samples use these instead of the placeholders, so you can copy and run them as they are. They’re stored only in this browser and never sent anywhere.