# Jupiter Lend decoder (Carbon 2.0)

> Decode Jupiter Lend instructions, accounts and events in Rust with carbon-jupiter-lend-decoder 2.0.0. Program ID jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC.

`carbon-jupiter-lend-decoder` decodes the instructions, accounts and events of the Jupiter Lend program (`jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC`): 24 instructions, 7 account types, 19 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-lend-decoder`](https://crates.io/crates/carbon-jupiter-lend-decoder/2.0.0) 2.0.0                 |
| Install          | `cargo add carbon-jupiter-lend-decoder@2.0.0`                                                                     |
| Program ID       | `jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC` (`carbon_jupiter_lend_decoder::PROGRAM_ID`)                         |
| Category         | [Lending](https://carbon.sevenlabs.org/decoders/lending.md)                                                       |
| Decoder          | `carbon_jupiter_lend_decoder::JupiterLendDecoder`                                                                 |
| Instruction enum | `instructions::JupiterLendInstruction`                                                                            |
| Account enum     | `accounts::JupiterLendAccount`                                                                                    |
| Event enum       | `instructions::CpiEvent`                                                                                          |
| Features         | `serde`, `postgres`, `graphql` (none enabled by default)                                                          |
| API docs         | [docs.rs/carbon-jupiter-lend-decoder/2.0.0](https://docs.rs/carbon-jupiter-lend-decoder/2.0.0)                    |
| Source           | [decoders/jupiter-lend-decoder](https://github.com/sevenlabs-hq/carbon/tree/v2.0.0/decoders/jupiter-lend-decoder) |

Other lending decoders: [Kamino Lending](https://carbon.sevenlabs.org/decoders/kamino-lending.md), [Kamino Vault](https://carbon.sevenlabs.org/decoders/kamino-vault.md), [marginfi v2](https://carbon.sevenlabs.org/decoders/marginfi-v2.md), [Meteora Vault](https://carbon.sevenlabs.org/decoders/meteora-vault.md), [Sharky](https://carbon.sevenlabs.org/decoders/sharky.md). To decode several in one pipeline, see [lending decoders](https://carbon.sevenlabs.org/decoders/lending.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 Lend transactions from the public RPC and prints every decoded `ChangeStatus` instruction. Add the dependencies:

```sh
cargo add carbon-core@2.0.0 carbon-jupiter-lend-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_lend_decoder::{
        instructions::JupiterLendInstruction, JupiterLendDecoder, 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(JupiterLendDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

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

Each `ChangeStatus` instruction prints one line with the transaction signature and the decoded `ChangeStatus` 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 `JupiterLendInstruction::CpiEvent { data: CpiEvent::LogBorrowRateCap(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 `AuthorizationList` 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_lend_decoder::{accounts::JupiterLendAccount, JupiterLendDecoder, 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(JupiterLendDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

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

Each update to a `AuthorizationList` 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 `JupiterLendInstruction`. Each is `JupiterLendInstruction::<Variant> { program_id, data, accounts }`, where `data` and `accounts` are the types listed under the variant, exported from `carbon_jupiter_lend_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 `jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC`.
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.

### `ChangeStatus`

Discriminator `ec9183e4e311c0ff` · data `ChangeStatus` · accounts `ChangeStatusInstructionAccounts`.

| Field    | Type   |
| -------- | ------ |
| `status` | `bool` |

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

Fields of `ChangeStatusInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `authority` | `Pubkey`           |
| 1  | `liquidity` | `Pubkey`           |
| 2  | `auth_list` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `Claim`

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

| Field       | Type     |
| ----------- | -------- |
| `recipient` | `Pubkey` |

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

Fields of `ClaimInstructionAccounts`, in account order:

| #  | Field                      | Type               |
| -- | -------------------------- | ------------------ |
| 0  | `user`                     | `Pubkey`           |
| 1  | `liquidity`                | `Pubkey`           |
| 2  | `token_reserve`            | `Pubkey`           |
| 3  | `mint`                     | `Pubkey`           |
| 4  | `recipient_token_account`  | `Pubkey`           |
| 5  | `vault`                    | `Pubkey`           |
| 6  | `claim_account`            | `Pubkey`           |
| 7  | `token_program`            | `Pubkey`           |
| 8  | `associated_token_program` | `Pubkey`           |
| 9… | `remaining`                | `Vec<AccountMeta>` |

### `CloseClaimAccount`

Discriminator `f192cbd83ade5b76` · data `CloseClaimAccount` · accounts `CloseClaimAccountInstructionAccounts`.

| Field  | Type     |
| ------ | -------- |
| `mint` | `Pubkey` |

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

Fields of `CloseClaimAccountInstructionAccounts`, in account order:

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

### `CollectRevenue`

Discriminator `5760d324f02bf657` · data `CollectRevenue` · accounts `CollectRevenueInstructionAccounts`.

No data fields.

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

Fields of `CollectRevenueInstructionAccounts`, in account order:

| #   | Field                       | Type               |
| --- | --------------------------- | ------------------ |
| 0   | `authority`                 | `Pubkey`           |
| 1   | `liquidity`                 | `Pubkey`           |
| 2   | `auth_list`                 | `Pubkey`           |
| 3   | `mint`                      | `Pubkey`           |
| 4   | `revenue_collector_account` | `Pubkey`           |
| 5   | `revenue_collector`         | `Pubkey`           |
| 6   | `token_reserve`             | `Pubkey`           |
| 7   | `vault`                     | `Pubkey`           |
| 8   | `token_program`             | `Pubkey`           |
| 9   | `associated_token_program`  | `Pubkey`           |
| 10  | `system_program`            | `Pubkey`           |
| 11… | `remaining`                 | `Vec<AccountMeta>` |

### `InitClaimAccount`

Discriminator `708d2faa2a639091` · data `InitClaimAccount` · accounts `InitClaimAccountInstructionAccounts`.

| Field  | Type     |
| ------ | -------- |
| `mint` | `Pubkey` |
| `user` | `Pubkey` |

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

Fields of `InitClaimAccountInstructionAccounts`, in account order:

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

### `InitLiquidity`

Discriminator `5fbdd8b7bc3ef46c` · data `InitLiquidity` · accounts `InitLiquidityInstructionAccounts`.

| Field               | Type     |
| ------------------- | -------- |
| `authority`         | `Pubkey` |
| `revenue_collector` | `Pubkey` |

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

Fields of `InitLiquidityInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `signer`         | `Pubkey`           |
| 1  | `liquidity`      | `Pubkey`           |
| 2  | `auth_list`      | `Pubkey`           |
| 3  | `system_program` | `Pubkey`           |
| 4… | `remaining`      | `Vec<AccountMeta>` |

### `InitNewProtocol`

Discriminator `c19305208a87d59e` · data `InitNewProtocol` · accounts `InitNewProtocolInstructionAccounts`.

| Field         | Type     |
| ------------- | -------- |
| `supply_mint` | `Pubkey` |
| `borrow_mint` | `Pubkey` |
| `protocol`    | `Pubkey` |

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

Fields of `InitNewProtocolInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `authority`            | `Pubkey`           |
| 1  | `auth_list`            | `Pubkey`           |
| 2  | `user_supply_position` | `Pubkey`           |
| 3  | `user_borrow_position` | `Pubkey`           |
| 4  | `system_program`       | `Pubkey`           |
| 5… | `remaining`            | `Vec<AccountMeta>` |

### `InitTokenReserve`

Discriminator `e4eb41819f0f0654` · data `InitTokenReserve` · accounts `InitTokenReserveInstructionAccounts`.

No data fields.

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

Fields of `InitTokenReserveInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `authority`                | `Pubkey`           |
| 1   | `liquidity`                | `Pubkey`           |
| 2   | `auth_list`                | `Pubkey`           |
| 3   | `mint`                     | `Pubkey`           |
| 4   | `vault`                    | `Pubkey`           |
| 5   | `rate_model`               | `Pubkey`           |
| 6   | `token_reserve`            | `Pubkey`           |
| 7   | `token_program`            | `Pubkey`           |
| 8   | `associated_token_program` | `Pubkey`           |
| 9   | `system_program`           | `Pubkey`           |
| 10… | `remaining`                | `Vec<AccountMeta>` |

### `Operate`

Discriminator `d96ad06374972a87` · data `Operate` · accounts `OperateInstructionAccounts`.

| Field           | Type                            |
| --------------- | ------------------------------- |
| `supply_amount` | `i128`                          |
| `borrow_amount` | `i128`                          |
| `withdraw_to`   | `Pubkey`                        |
| `borrow_to`     | `Pubkey`                        |
| `transfer_type` | [`TransferType`](#transfertype) |

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

Fields of `OperateInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `protocol`                 | `Pubkey`           |
| 1   | `liquidity`                | `Pubkey`           |
| 2   | `token_reserve`            | `Pubkey`           |
| 3   | `mint`                     | `Pubkey`           |
| 4   | `vault`                    | `Pubkey`           |
| 5   | `user_supply_position`     | `Option<Pubkey>`   |
| 6   | `user_borrow_position`     | `Option<Pubkey>`   |
| 7   | `rate_model`               | `Pubkey`           |
| 8   | `withdraw_to_account`      | `Option<Pubkey>`   |
| 9   | `borrow_to_account`        | `Option<Pubkey>`   |
| 10  | `borrow_claim_account`     | `Option<Pubkey>`   |
| 11  | `withdraw_claim_account`   | `Option<Pubkey>`   |
| 12  | `token_program`            | `Pubkey`           |
| 13  | `associated_token_program` | `Pubkey`           |
| 14… | `remaining`                | `Vec<AccountMeta>` |

### `PauseUser`

Discriminator `123f2b5eef35650e` · data `PauseUser` · accounts `PauseUserInstructionAccounts`.

| Field           | Type         |
| --------------- | ------------ |
| `protocol`      | `Pubkey`     |
| `supply_mint`   | `Pubkey`     |
| `borrow_mint`   | `Pubkey`     |
| `supply_status` | `Option<u8>` |
| `borrow_status` | `Option<u8>` |

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

Fields of `PauseUserInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `authority`            | `Pubkey`           |
| 1  | `auth_list`            | `Pubkey`           |
| 2  | `user_supply_position` | `Pubkey`           |
| 3  | `user_borrow_position` | `Pubkey`           |
| 4… | `remaining`            | `Vec<AccountMeta>` |

### `PreOperate`

Discriminator `81cd9e9bc69b4885` · data `PreOperate` · accounts `PreOperateInstructionAccounts`.

| Field  | Type     |
| ------ | -------- |
| `mint` | `Pubkey` |

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

Fields of `PreOperateInstructionAccounts`, in account order:

| #  | Field                      | Type               |
| -- | -------------------------- | ------------------ |
| 0  | `protocol`                 | `Pubkey`           |
| 1  | `liquidity`                | `Pubkey`           |
| 2  | `user_supply_position`     | `Option<Pubkey>`   |
| 3  | `user_borrow_position`     | `Option<Pubkey>`   |
| 4  | `vault`                    | `Pubkey`           |
| 5  | `token_reserve`            | `Pubkey`           |
| 6  | `associated_token_program` | `Pubkey`           |
| 7  | `token_program`            | `Pubkey`           |
| 8… | `remaining`                | `Vec<AccountMeta>` |

### `UnpauseUser`

Discriminator `477380fcb67eea3e` · data `UnpauseUser` · accounts `UnpauseUserInstructionAccounts`.

| Field           | Type         |
| --------------- | ------------ |
| `protocol`      | `Pubkey`     |
| `supply_mint`   | `Pubkey`     |
| `borrow_mint`   | `Pubkey`     |
| `supply_status` | `Option<u8>` |
| `borrow_status` | `Option<u8>` |

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

Fields of `UnpauseUserInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `authority`            | `Pubkey`           |
| 1  | `auth_list`            | `Pubkey`           |
| 2  | `user_supply_position` | `Pubkey`           |
| 3  | `user_borrow_position` | `Pubkey`           |
| 4… | `remaining`            | `Vec<AccountMeta>` |

### `UpdateAuthority`

Discriminator `202e401c954bf358` · data `UpdateAuthority` · accounts `UpdateAuthorityInstructionAccounts`.

| Field           | Type     |
| --------------- | -------- |
| `new_authority` | `Pubkey` |

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

Fields of `UpdateAuthorityInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `authority` | `Pubkey`           |
| 1  | `liquidity` | `Pubkey`           |
| 2  | `auth_list` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateAuths`

Discriminator `5d60b29c3975fdd1` · data `UpdateAuths` · accounts `UpdateAuthsInstructionAccounts`.

| Field         | Type                               |
| ------------- | ---------------------------------- |
| `auth_status` | [`Vec<AddressBool>`](#addressbool) |

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

Fields of `UpdateAuthsInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `authority` | `Pubkey`           |
| 1  | `liquidity` | `Pubkey`           |
| 2  | `auth_list` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateExchangePrice`

Discriminator `eff40af874193596` · data `UpdateExchangePrice` · accounts `UpdateExchangePriceInstructionAccounts`.

| Field  | Type     |
| ------ | -------- |
| `mint` | `Pubkey` |

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

Fields of `UpdateExchangePriceInstructionAccounts`, in account order:

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

### `UpdateGuardians`

Discriminator `2b3efa8a8d758461` · data `UpdateGuardians` · accounts `UpdateGuardiansInstructionAccounts`.

| Field             | Type                               |
| ----------------- | ---------------------------------- |
| `guardian_status` | [`Vec<AddressBool>`](#addressbool) |

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

Fields of `UpdateGuardiansInstructionAccounts`, in account order:

| #  | Field       | Type               |
| -- | ----------- | ------------------ |
| 0  | `authority` | `Pubkey`           |
| 1  | `liquidity` | `Pubkey`           |
| 2  | `auth_list` | `Pubkey`           |
| 3… | `remaining` | `Vec<AccountMeta>` |

### `UpdateRateDataV1`

Discriminator `0614227a1696b416` · data `UpdateRateDataV1` · accounts `UpdateRateDataV1InstructionAccounts`.

| Field       | Type                                    |
| ----------- | --------------------------------------- |
| `rate_data` | [`RateDataV1Params`](#ratedatav1params) |

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

Fields of `UpdateRateDataV1InstructionAccounts`, in account order:

| #  | Field           | Type               |
| -- | --------------- | ------------------ |
| 0  | `authority`     | `Pubkey`           |
| 1  | `auth_list`     | `Pubkey`           |
| 2  | `rate_model`    | `Pubkey`           |
| 3  | `mint`          | `Pubkey`           |
| 4  | `token_reserve` | `Pubkey`           |
| 5… | `remaining`     | `Vec<AccountMeta>` |

### `UpdateRateDataV2`

Discriminator `74493592d82de47c` · data `UpdateRateDataV2` · accounts `UpdateRateDataV2InstructionAccounts`.

| Field       | Type                                    |
| ----------- | --------------------------------------- |
| `rate_data` | [`RateDataV2Params`](#ratedatav2params) |

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

Fields of `UpdateRateDataV2InstructionAccounts`, in account order:

| #  | Field           | Type               |
| -- | --------------- | ------------------ |
| 0  | `authority`     | `Pubkey`           |
| 1  | `auth_list`     | `Pubkey`           |
| 2  | `rate_model`    | `Pubkey`           |
| 3  | `mint`          | `Pubkey`           |
| 4  | `token_reserve` | `Pubkey`           |
| 5… | `remaining`     | `Vec<AccountMeta>` |

### `UpdateRevenueCollector`

Discriminator `a78e7cf0dc718d3b` · data `UpdateRevenueCollector` · accounts `UpdateRevenueCollectorInstructionAccounts`.

| Field               | Type     |
| ------------------- | -------- |
| `revenue_collector` | `Pubkey` |

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

Fields of `UpdateRevenueCollectorInstructionAccounts`, in account order:

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

### `UpdateTokenConfig`

Discriminator `e77ab54fff4f90a7` · data `UpdateTokenConfig` · accounts `UpdateTokenConfigInstructionAccounts`.

| Field          | Type                          |
| -------------- | ----------------------------- |
| `token_config` | [`TokenConfig`](#tokenconfig) |

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

Fields of `UpdateTokenConfigInstructionAccounts`, in account order:

| #  | Field           | Type               |
| -- | --------------- | ------------------ |
| 0  | `authority`     | `Pubkey`           |
| 1  | `auth_list`     | `Pubkey`           |
| 2  | `rate_model`    | `Pubkey`           |
| 3  | `mint`          | `Pubkey`           |
| 4  | `token_reserve` | `Pubkey`           |
| 5… | `remaining`     | `Vec<AccountMeta>` |

### `UpdateUserBorrowConfig`

Discriminator `64b0c9aef70236a8` · data `UpdateUserBorrowConfig` · accounts `UpdateUserBorrowConfigInstructionAccounts`.

| Field                | Type                                    |
| -------------------- | --------------------------------------- |
| `user_borrow_config` | [`UserBorrowConfig`](#userborrowconfig) |

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

Fields of `UpdateUserBorrowConfigInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `authority`            | `Pubkey`           |
| 1  | `protocol`             | `Pubkey`           |
| 2  | `auth_list`            | `Pubkey`           |
| 3  | `rate_model`           | `Pubkey`           |
| 4  | `mint`                 | `Pubkey`           |
| 5  | `token_reserve`        | `Pubkey`           |
| 6  | `user_borrow_position` | `Pubkey`           |
| 7… | `remaining`            | `Vec<AccountMeta>` |

### `UpdateUserClass`

Discriminator `0cce44873fd43077` · data `UpdateUserClass` · accounts `UpdateUserClassInstructionAccounts`.

| Field        | Type                           |
| ------------ | ------------------------------ |
| `user_class` | [`Vec<AddressU8>`](#addressu8) |

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

Fields of `UpdateUserClassInstructionAccounts`, in account order:

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

### `UpdateUserSupplyConfig`

Discriminator `d9efe1da2131eab7` · data `UpdateUserSupplyConfig` · accounts `UpdateUserSupplyConfigInstructionAccounts`.

| Field                | Type                                    |
| -------------------- | --------------------------------------- |
| `user_supply_config` | [`UserSupplyConfig`](#usersupplyconfig) |

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

Fields of `UpdateUserSupplyConfigInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `authority`            | `Pubkey`           |
| 1  | `protocol`             | `Pubkey`           |
| 2  | `auth_list`            | `Pubkey`           |
| 3  | `rate_model`           | `Pubkey`           |
| 4  | `mint`                 | `Pubkey`           |
| 5  | `token_reserve`        | `Pubkey`           |
| 6  | `user_supply_position` | `Pubkey`           |
| 7… | `remaining`            | `Vec<AccountMeta>` |

### `UpdateUserWithdrawalLimit`

Discriminator `a209ba09d51ead4e` · data `UpdateUserWithdrawalLimit` · accounts `UpdateUserWithdrawalLimitInstructionAccounts`.

| Field       | Type     |
| ----------- | -------- |
| `new_limit` | `u128`   |
| `protocol`  | `Pubkey` |
| `mint`      | `Pubkey` |

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

Fields of `UpdateUserWithdrawalLimitInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `authority`            | `Pubkey`           |
| 1  | `auth_list`            | `Pubkey`           |
| 2  | `user_supply_position` | `Pubkey`           |
| 3… | `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 `JupiterLendAccount`. Each wraps a boxed struct from `carbon_jupiter_lend_decoder::accounts::<module>`. `decode_account` only considers accounts owned by `PROGRAM_ID` and returns the first variant that matches.

### `AuthorizationList`

Discriminator `139d752beca7fb45` · `accounts::authorization_list::AuthorizationList`.

| Field          | Type                           |
| -------------- | ------------------------------ |
| `auth_users`   | `Vec<Pubkey>`                  |
| `guardians`    | `Vec<Pubkey>`                  |
| `user_classes` | [`Vec<UserClass>`](#userclass) |

### `Liquidity`

Discriminator `36fcf9e289ac793a` · `accounts::liquidity::Liquidity`.

| Field               | Type     |
| ------------------- | -------- |
| `authority`         | `Pubkey` |
| `revenue_collector` | `Pubkey` |
| `status`            | `bool`   |
| `bump`              | `u8`     |

### `RateModel`

Discriminator `5e03cbdb6b8904a2` · `accounts::rate_model::RateModel`.

| Field               | Type     |
| ------------------- | -------- |
| `mint`              | `Pubkey` |
| `version`           | `u8`     |
| `rate_at_zero`      | `u16`    |
| `kink1_utilization` | `u16`    |
| `rate_at_kink1`     | `u16`    |
| `rate_at_max`       | `u16`    |
| `kink2_utilization` | `u16`    |
| `rate_at_kink2`     | `u16`    |

### `TokenReserve`

Discriminator `15123b8778141f0c` · `accounts::token_reserve::TokenReserve`.

| Field                        | Type     |
| ---------------------------- | -------- |
| `mint`                       | `Pubkey` |
| `vault`                      | `Pubkey` |
| `borrow_rate`                | `u16`    |
| `fee_on_interest`            | `u16`    |
| `last_utilization`           | `u16`    |
| `last_update_timestamp`      | `u64`    |
| `supply_exchange_price`      | `u64`    |
| `borrow_exchange_price`      | `u64`    |
| `max_utilization`            | `u16`    |
| `total_supply_with_interest` | `u64`    |
| `total_supply_interest_free` | `u64`    |
| `total_borrow_with_interest` | `u64`    |
| `total_borrow_interest_free` | `u64`    |
| `total_claim_amount`         | `u64`    |
| `interacting_protocol`       | `Pubkey` |
| `interacting_timestamp`      | `u64`    |
| `interacting_balance`        | `u64`    |

### `UserBorrowPosition`

Discriminator `497e417bdc7ec518` · `accounts::user_borrow_position::UserBorrowPosition`.

| Field               | Type     |
| ------------------- | -------- |
| `protocol`          | `Pubkey` |
| `mint`              | `Pubkey` |
| `with_interest`     | `u8`     |
| `amount`            | `u64`    |
| `debt_ceiling`      | `u64`    |
| `last_update`       | `u64`    |
| `expand_pct`        | `u16`    |
| `expand_duration`   | `u32`    |
| `base_debt_ceiling` | `u64`    |
| `max_debt_ceiling`  | `u64`    |
| `status`            | `u8`     |

### `UserClaim`

Discriminator `e48ec3b5e49320d1` · `accounts::user_claim::UserClaim`.

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

### `UserSupplyPosition`

Discriminator `cadb88763db11592` · `accounts::user_supply_position::UserSupplyPosition`.

| Field                   | Type     |
| ----------------------- | -------- |
| `protocol`              | `Pubkey` |
| `mint`                  | `Pubkey` |
| `with_interest`         | `u8`     |
| `amount`                | `u64`    |
| `withdrawal_limit`      | `u128`   |
| `last_update`           | `u64`    |
| `expand_pct`            | `u16`    |
| `expand_duration`       | `u64`    |
| `base_withdrawal_limit` | `u64`    |
| `status`                | `u8`     |

## Events

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

### `LogBorrowRateCap`

Discriminator `9c83e85efe9c0e75` · `events::log_borrow_rate_cap::LogBorrowRateCapEvent`.

| Field   | Type     |
| ------- | -------- |
| `token` | `Pubkey` |

### `LogChangeStatus`

Discriminator `594d25ac8d1f4a2a` · `events::log_change_status::LogChangeStatusEvent`.

| Field        | Type   |
| ------------ | ------ |
| `new_status` | `bool` |

### `LogClaim`

Discriminator `ee329d55973ae72d` · `events::log_claim::LogClaimEvent`.

| Field       | Type     |
| ----------- | -------- |
| `user`      | `Pubkey` |
| `token`     | `Pubkey` |
| `recipient` | `Pubkey` |
| `amount`    | `u64`    |

### `LogCollectRevenue`

Discriminator `40c616c27b57a652` · `events::log_collect_revenue::LogCollectRevenueEvent`.

| Field            | Type     |
| ---------------- | -------- |
| `token`          | `Pubkey` |
| `revenue_amount` | `u128`   |

### `LogOperate`

Discriminator `b40851471384ad08` · `events::log_operate::LogOperateEvent`.

| Field                   | Type     |
| ----------------------- | -------- |
| `user`                  | `Pubkey` |
| `token`                 | `Pubkey` |
| `supply_amount`         | `i128`   |
| `borrow_amount`         | `i128`   |
| `withdraw_to`           | `Pubkey` |
| `borrow_to`             | `Pubkey` |
| `supply_exchange_price` | `u64`    |
| `borrow_exchange_price` | `u64`    |

### `LogPauseUser`

Discriminator `641172e0b41e34aa` · `events::log_pause_user::LogPauseUserEvent`.

| Field    | Type     |
| -------- | -------- |
| `user`   | `Pubkey` |
| `mint`   | `Pubkey` |
| `status` | `u8`     |

### `LogUnpauseUser`

Discriminator `aa5b8460b34da81a` · `events::log_unpause_user::LogUnpauseUserEvent`.

| Field    | Type     |
| -------- | -------- |
| `user`   | `Pubkey` |
| `mint`   | `Pubkey` |
| `status` | `u8`     |

### `LogUpdateAuthority`

Discriminator `96989d8f0687c165` · `events::log_update_authority::LogUpdateAuthorityEvent`.

| Field           | Type     |
| --------------- | -------- |
| `new_authority` | `Pubkey` |

### `LogUpdateAuths`

Discriminator `58506d306fcb4cfb` · `events::log_update_auths::LogUpdateAuthsEvent`.

| Field         | Type                               |
| ------------- | ---------------------------------- |
| `auth_status` | [`Vec<AddressBool>`](#addressbool) |

### `LogUpdateExchangePrices`

Discriminator `bec245cc1e56b5a3` · `events::log_update_exchange_prices::LogUpdateExchangePricesEvent`.

| Field                   | Type     |
| ----------------------- | -------- |
| `token`                 | `Pubkey` |
| `supply_exchange_price` | `u128`   |
| `borrow_exchange_price` | `u128`   |
| `borrow_rate`           | `u16`    |
| `utilization`           | `u16`    |

### `LogUpdateGuardians`

Discriminator `e71cbf33358c4f8e` · `events::log_update_guardians::LogUpdateGuardiansEvent`.

| Field             | Type                               |
| ----------------- | ---------------------------------- |
| `guardian_status` | [`Vec<AddressBool>`](#addressbool) |

### `LogUpdateRateDataV1`

Discriminator `1e6683c0001e55df` · `events::log_update_rate_data_v1::LogUpdateRateDataV1Event`.

| Field       | Type                                    |
| ----------- | --------------------------------------- |
| `token`     | `Pubkey`                                |
| `rate_data` | [`RateDataV1Params`](#ratedatav1params) |

### `LogUpdateRateDataV2`

Discriminator `ce35c34671d35c81` · `events::log_update_rate_data_v2::LogUpdateRateDataV2Event`.

| Field       | Type                                    |
| ----------- | --------------------------------------- |
| `token`     | `Pubkey`                                |
| `rate_data` | [`RateDataV2Params`](#ratedatav2params) |

### `LogUpdateRevenueCollector`

Discriminator `2c8f50fad393b49f` · `events::log_update_revenue_collector::LogUpdateRevenueCollectorEvent`.

| Field               | Type     |
| ------------------- | -------- |
| `revenue_collector` | `Pubkey` |

### `LogUpdateTokenConfigs`

Discriminator `18cdbf822f28e9da` · `events::log_update_token_configs::LogUpdateTokenConfigsEvent`.

| Field          | Type                          |
| -------------- | ----------------------------- |
| `token_config` | [`TokenConfig`](#tokenconfig) |

### `LogUpdateUserBorrowConfigs`

Discriminator `d2fbf29fcd219a4a` · `events::log_update_user_borrow_configs::LogUpdateUserBorrowConfigsEvent`.

| Field                | Type                                    |
| -------------------- | --------------------------------------- |
| `user`               | `Pubkey`                                |
| `token`              | `Pubkey`                                |
| `user_borrow_config` | [`UserBorrowConfig`](#userborrowconfig) |

### `LogUpdateUserClass`

Discriminator `b9c16af80b350088` · `events::log_update_user_class::LogUpdateUserClassEvent`.

| Field        | Type                           |
| ------------ | ------------------------------ |
| `user_class` | [`Vec<AddressU8>`](#addressu8) |

### `LogUpdateUserSupplyConfigs`

Discriminator `8ea0155a57581233` · `events::log_update_user_supply_configs::LogUpdateUserSupplyConfigsEvent`.

| Field                | Type                                    |
| -------------------- | --------------------------------------- |
| `user`               | `Pubkey`                                |
| `token`              | `Pubkey`                                |
| `user_supply_config` | [`UserSupplyConfig`](#usersupplyconfig) |

### `LogUpdateUserWithdrawalLimit`

Discriminator `728398bd78fd5869` · `events::log_update_user_withdrawal_limit::LogUpdateUserWithdrawalLimitEvent`.

| Field       | Type     |
| ----------- | -------- |
| `user`      | `Pubkey` |
| `token`     | `Pubkey` |
| `new_limit` | `u128`   |

## Types

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

### `AddressBool`

Struct `types::AddressBool`.

| Field   | Type     |
| ------- | -------- |
| `addr`  | `Pubkey` |
| `value` | `bool`   |

### `AddressU8`

Struct `types::AddressU8`.

| Field   | Type     |
| ------- | -------- |
| `addr`  | `Pubkey` |
| `value` | `u8`     |

### `LogBorrowRateCap`

Struct `types::LogBorrowRateCap`. Same fields as the [`LogBorrowRateCap`](#logborrowratecap) event.

### `LogChangeStatus`

Struct `types::LogChangeStatus`. Same fields as the [`LogChangeStatus`](#logchangestatus) event.

### `LogClaim`

Struct `types::LogClaim`. Same fields as the [`LogClaim`](#logclaim) event.

### `LogCollectRevenue`

Struct `types::LogCollectRevenue`. Same fields as the [`LogCollectRevenue`](#logcollectrevenue) event.

### `LogOperate`

Struct `types::LogOperate`. Same fields as the [`LogOperate`](#logoperate) event.

### `LogPauseUser`

Struct `types::LogPauseUser`. Same fields as the [`LogPauseUser`](#logpauseuser) event.

### `LogUnpauseUser`

Struct `types::LogUnpauseUser`. Same fields as the [`LogUnpauseUser`](#logunpauseuser) event.

### `LogUpdateAuthority`

Struct `types::LogUpdateAuthority`. Same fields as the [`LogUpdateAuthority`](#logupdateauthority) event.

### `LogUpdateAuths`

Struct `types::LogUpdateAuths`. Same fields as the [`LogUpdateAuths`](#logupdateauths) event.

### `LogUpdateExchangePrices`

Struct `types::LogUpdateExchangePrices`. Same fields as the [`LogUpdateExchangePrices`](#logupdateexchangeprices) event.

### `LogUpdateGuardians`

Struct `types::LogUpdateGuardians`. Same fields as the [`LogUpdateGuardians`](#logupdateguardians) event.

### `LogUpdateRateDataV1`

Struct `types::LogUpdateRateDataV1`. Same fields as the [`LogUpdateRateDataV1`](#logupdateratedatav1) event.

### `LogUpdateRateDataV2`

Struct `types::LogUpdateRateDataV2`. Same fields as the [`LogUpdateRateDataV2`](#logupdateratedatav2) event.

### `LogUpdateRevenueCollector`

Struct `types::LogUpdateRevenueCollector`. Same fields as the [`LogUpdateRevenueCollector`](#logupdaterevenuecollector) event.

### `LogUpdateTokenConfigs`

Struct `types::LogUpdateTokenConfigs`. Same fields as the [`LogUpdateTokenConfigs`](#logupdatetokenconfigs) event.

### `LogUpdateUserBorrowConfigs`

Struct `types::LogUpdateUserBorrowConfigs`. Same fields as the [`LogUpdateUserBorrowConfigs`](#logupdateuserborrowconfigs) event.

### `LogUpdateUserClass`

Struct `types::LogUpdateUserClass`. Same fields as the [`LogUpdateUserClass`](#logupdateuserclass) event.

### `LogUpdateUserSupplyConfigs`

Struct `types::LogUpdateUserSupplyConfigs`. Same fields as the [`LogUpdateUserSupplyConfigs`](#logupdateusersupplyconfigs) event.

### `LogUpdateUserWithdrawalLimit`

Struct `types::LogUpdateUserWithdrawalLimit`. Same fields as the [`LogUpdateUserWithdrawalLimit`](#logupdateuserwithdrawallimit) event.

### `RateDataV1Params`

> _From the program's IDL:_
>
> @notice struct to set borrow rate data for version 1

Struct `types::RateDataV1Params`.

| Field                      | Type   | Description                                                                                                                                                                                                                                        |
| -------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `kink`                     | `u128` | @param kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100                                                                                                                                                                                        |
| `rate_at_utilization_zero` | `u128` | @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100 i.e. constant minimum borrow rate e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then) |
| `rate_at_utilization_kink` | `u128` | @param rateAtUtilizationKink borrow rate when utilization is at kink. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 7% at kink then rateAtUtilizationKink would be 700                                                                  |
| `rate_at_utilization_max`  | `u128` | @param rateAtUtilizationMax borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500                                                       |

### `RateDataV2Params`

> _From the program's IDL:_
>
> @notice struct to set borrow rate data for version 2

Struct `types::RateDataV2Params`.

| Field                       | Type   | Description                                                                                                                                                                                                                                        |
| --------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `kink1`                     | `u128` | @param kink1 first kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 utilization below kink 1 usually means slow increase in rate, once utilization is above kink 1 borrow rate increases faster                                                |
| `kink2`                     | `u128` | @param kink2 second kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100 utilization below kink 2 usually means slow / medium increase in rate, once utilization is above kink 2 borrow rate increases fast                                        |
| `rate_at_utilization_zero`  | `u128` | @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100 i.e. constant minimum borrow rate e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then) |
| `rate_at_utilization_kink1` | `u128` | @param rateAtUtilizationKink1 desired borrow rate when utilization is at first kink. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 7% at first kink then rateAtUtilizationKink would be 700                                             |
| `rate_at_utilization_kink2` | `u128` | @param rateAtUtilizationKink2 desired borrow rate when utilization is at second kink. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 7% at second kink then rateAtUtilizationKink would be 1_200                                         |
| `rate_at_utilization_max`   | `u128` | @param rateAtUtilizationMax desired borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100 e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500                                               |

### `TokenConfig`

> _From the program's IDL:_
>
> @notice struct to set token config

Struct `types::TokenConfig`.

| Field             | Type     | Description                                                                                                                                                |
| ----------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `token`           | `Pubkey` | @param token address                                                                                                                                       |
| `fee`             | `u128`   | @param fee charges on borrower's interest. in 1e2: 100% = 10_000; 1% = 100                                                                                 |
| `max_utilization` | `u128`   | @param maxUtilization maximum allowed utilization. in 1e2: 100% = 10_000; 1% = 100 set to 100% to disable and have default limit of 100% (avoiding SLOAD). |

### `TransferType`

Enum `types::TransferType`.

| Variant  |
| -------- |
| `SKIP`   |
| `DIRECT` |
| `CLAIM`  |

### `UserBorrowConfig`

> _From the program's IDL:_
>
> @notice struct to set user borrow & payback config

Struct `types::UserBorrowConfig`.

| Field               | Type   | Description                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode`              | `u8`   | @param mode: 0 = without interest. 1 = with interest                                                                                                                                                                                                                                                                                                                                     |
| `expand_percent`    | `u128` | @param expandPercent debt limit expand percent. in 1e2: 100% = 10_000; 1% = 100 Also used to calculate rate at which debt limit should decrease (instant).                                                                                                                                                                                                                               |
| `expand_duration`   | `u128` | @param expandDuration debt limit expand duration in seconds. used to calculate rate together with expandPercent                                                                                                                                                                                                                                                                          |
| `base_debt_ceiling` | `u128` | @param baseDebtCeiling base borrow limit. until here, borrow limit remains as baseDebtCeiling (user can borrow until this point at once without stepped expansion). Above this, automated limit comes in place. amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: with interest -> raw, without interest -> normal |
| `max_debt_ceiling`  | `u128` | @param maxDebtCeiling max borrow ceiling, maximum amount the user can borrow. amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: with interest -> raw, without interest -> normal                                                                                                                                   |

### `UserClass`

Struct `types::UserClass`.

| Field   | Type     |
| ------- | -------- |
| `addr`  | `Pubkey` |
| `class` | `u8`     |

### `UserSupplyConfig`

> _From the program's IDL:_
>
> @notice struct to set user supply & withdrawal config

Struct `types::UserSupplyConfig`.

| Field                   | Type   | Description                                                                                                                                                                                                                                                      |
| ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode`                  | `u8`   | @param mode: 0 = without interest. 1 = with interest                                                                                                                                                                                                             |
| `expand_percent`        | `u128` | @param expandPercent withdrawal limit expand percent. in 1e2: 100% = 10_000; 1% = 100 Also used to calculate rate at which withdrawal limit should decrease (instant).                                                                                           |
| `expand_duration`       | `u128` | @param expandDuration withdrawal limit expand duration in seconds. used to calculate rate together with expandPercent                                                                                                                                            |
| `base_withdrawal_limit` | `u128` | @param baseWithdrawalLimit base limit, below this, user can withdraw the entire amount. amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token: with interest -> raw, without interest -> normal |

---

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