# Lending decoders (Carbon 2.0)

> Decode 6 Solana lending programs in Rust, including Kamino Lending, marginfi v2, Jupiter Lend and Kamino Vault, with Carbon decoder crates.

Carbon 2.0.0 has decoder crates for 6 lending programs on Solana: 239 instructions, 45 account types and 62 events in all. Use them to index deposits, borrows, repayments, liquidations, reserves, obligations and vaults as typed Rust values instead of parsing raw bytes. Each program's page lists every instruction with its discriminator, data fields and accounts, every account and event, and a complete program that runs against the public RPC.

## Programs

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

| Program                                                                   | Crate                           | Program ID                                     | Instructions | Accounts | Events |
| ------------------------------------------------------------------------- | ------------------------------- | ---------------------------------------------- | -----------: | -------: | -----: |
| [Jupiter Lend](https://carbon.sevenlabs.org/decoders/jupiter-lend.md)     | `carbon-jupiter-lend-decoder`   | `jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC`  |           24 |        7 |     19 |
| [Kamino Lending](https://carbon.sevenlabs.org/decoders/kamino-lending.md) | `carbon-kamino-lending-decoder` | `KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD`  |           63 |       10 |      5 |
| [Kamino Vault](https://carbon.sevenlabs.org/decoders/kamino-vault.md)     | `carbon-kamino-vault-decoder`   | `kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr`  |           12 |        2 |      0 |
| [marginfi v2](https://carbon.sevenlabs.org/decoders/marginfi-v2.md)       | `carbon-marginfi-v2-decoder`    | `MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA`  |           91 |       15 |     30 |
| [Meteora Vault](https://carbon.sevenlabs.org/decoders/meteora-vault.md)   | `carbon-meteora-vault-decoder`  | `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi` |           14 |        2 |      8 |
| [Sharky](https://carbon.sevenlabs.org/decoders/sharky.md)                 | `carbon-sharky-decoder`         | `SHARKobtfF1bHhxD2eqftjHBdVSCbKo9JtgK71FhELP`  |           35 |        9 |      0 |

## Decode several in one pipeline

Add `carbon-core` and the decoder crates you need, all at the same version. For every program in this category:

```sh
cargo add carbon-core@2.0.0 carbon-jupiter-lend-decoder@2.0.0 carbon-kamino-lending-decoder@2.0.0 carbon-kamino-vault-decoder@2.0.0 carbon-marginfi-v2-decoder@2.0.0 carbon-meteora-vault-decoder@2.0.0 carbon-sharky-decoder@2.0.0
```

Register each decoder with a processor for its instruction enum. This fragment goes in your pipeline setup; the processors are yours, one per program, each implementing `Processor` for that program's instruction input (see [processors](https://carbon.sevenlabs.org/concepts/processors.md)):

```rust
use carbon_kamino_lending_decoder::KaminoLendingDecoder;
use carbon_marginfi_v2_decoder::MarginfiV2Decoder;
use carbon_jupiter_lend_decoder::JupiterLendDecoder;

Pipeline::builder()
    .datasource(datasource) // a datasource that emits these programs' transactions
    .instruction(KaminoLendingDecoder, KaminoLendingProcessor)
    .instruction(MarginfiV2Decoder, MarginfiV2Processor)
    .instruction(JupiterLendDecoder, JupiterLendProcessor)
    .build()?
    .run()
    .await
```

Each decoder only returns instructions whose program ID matches its own `PROGRAM_ID`, so one pipeline can hold all of them. For datasource filters that follow several programs, and one processor that sees every program's instructions in a transaction, see [index multiple programs](https://carbon.sevenlabs.org/guides/multiple-programs.md).

## A program that is not listed

Generate a decoder from the program's Anchor or Codama IDL with the Carbon CLI: see [generate a decoder](https://carbon.sevenlabs.org/guides/generate-a-decoder.md). Every crate above was generated the same way. The [full catalog](https://carbon.sevenlabs.org/decoders.md) lists decoders in every category.

---

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