Jupiter Perpetuals decoder

Decode Jupiter Perpetuals instructions, accounts and events in Rust with the carbon-jupiter-perpetuals-decoder crate.

On this page

carbon-jupiter-perpetuals-decoder decodes the instructions, accounts and events of the Jupiter Perpetuals program (PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu): 59 instructions, 8 account types, 25 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-jupiter-perpetuals-decoder 2.0.0
Installcargo add carbon-jupiter-perpetuals-decoder@2.0.0
Program IDPERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu (carbon_jupiter_perpetuals_decoder::PROGRAM_ID)
CategoryPerpetuals & derivatives
Decodercarbon_jupiter_perpetuals_decoder::JupiterPerpetualsDecoder
Instruction enuminstructions::JupiterPerpetualsInstruction
Account enumaccounts::JupiterPerpetualsAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-jupiter-perpetuals-decoder/2.0.0
Sourcedecoders/jupiter-perpetuals-decoder

Other perpetuals and derivatives decoders: Drift v2, Zeta Markets. To decode several in one pipeline, see perpetuals and derivatives decoders.

The serde feature derives Serialize/Deserialize on every type, postgres adds tables and processors for Postgres, and graphql adds a schema for the GraphQL server.

Usage#

This program crawls recent Jupiter Perpetuals transactions from the public RPC and prints every decoded AddCustody instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-jupiter-perpetuals-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
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_jupiter_perpetuals_decoder::{
        instructions::JupiterPerpetualsInstruction, JupiterPerpetualsDecoder, 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(JupiterPerpetualsDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, JupiterPerpetualsInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, JupiterPerpetualsInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let JupiterPerpetualsInstruction::AddCustody { data, accounts, .. } = input.decoded_instruction {
            println!("add_custody {signature}: {data:?} admin={}", accounts.admin);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each AddCustody instruction prints one line with the transaction signature and the decoded AddCustody 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 for the crawler options.

Events published with Anchor's emit_cpi! arrive as the CpiEvent instruction. Match them with JupiterPerpetualsInstruction::CpiEvent { data: CpiEvent::CreatePositionRequestEvent(event), .. } (import instructions::CpiEvent); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_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 Pool account as it changes. Add the datasource and the Solana RPC types it takes:

Terminal
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
src/main.rs
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_jupiter_perpetuals_decoder::{
        accounts::JupiterPerpetualsAccount, JupiterPerpetualsDecoder, 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(JupiterPerpetualsDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, JupiterPerpetualsAccount>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, JupiterPerpetualsAccount>,
    ) -> CarbonResult<()> {
        if let JupiterPerpetualsAccount::Pool(pool) = &input.decoded_account.data {
            println!("pool {}: {pool:?}", input.metadata.pubkey);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each update to a Pool 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.

Instructions#

Variants of JupiterPerpetualsInstruction. Each is JupiterPerpetualsInstruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_jupiter_perpetuals_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 PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu.
  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 AccountMetas. 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.

AddCustody#

Discriminator f7fe7e111a06d775 · data AddCustody · accounts AddCustodyInstructionAccounts.

FieldType
paramsAddCustodyParams

Required accounts: 10; extras go to remaining.

Fields of AddCustodyInstructionAccounts, in account order:

#FieldType
0adminPubkey
1transfer_authorityPubkey
2perpetualsPubkey
3poolPubkey
4custodyPubkey
5custody_token_accountPubkey
6custody_token_mintPubkey
7system_programPubkey
8token_programPubkey
9rentPubkey
10…remainingVec<AccountMeta>

AddLiquidity2#

Discriminator e4a24e1c46db7473 · data AddLiquidity2 · accounts AddLiquidity2InstructionAccounts.

FieldType
paramsAddLiquidity2Params

Required accounts: 14; extras go to remaining.

Fields of AddLiquidity2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1funding_accountPubkey
2lp_token_accountPubkey
3transfer_authorityPubkey
4perpetualsPubkey
5poolPubkey
6custodyPubkey
7custody_doves_price_accountPubkey
8custody_pythnet_price_accountPubkey
9custody_token_accountPubkey
10lp_token_mintPubkey
11token_programPubkey
12event_authorityPubkey
13programPubkey
14…remainingVec<AccountMeta>

AddPool#

Discriminator 73e6d4d3af3127a9 · data AddPool · accounts AddPoolInstructionAccounts.

FieldType
paramsAddPoolParams

Required accounts: 8; extras go to remaining.

Fields of AddPoolInstructionAccounts, in account order:

#FieldType
0adminPubkey
1transfer_authorityPubkey
2perpetualsPubkey
3poolPubkey
4lp_token_mintPubkey
5system_programPubkey
6token_programPubkey
7rentPubkey
8…remainingVec<AccountMeta>

BorrowFromCustody#

Discriminator 99b741417121f92d · data BorrowFromCustody · accounts BorrowFromCustodyInstructionAccounts.

Required accounts: 12; extras go to remaining.

Fields of BorrowFromCustodyInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4transfer_authorityPubkey
5borrow_positionPubkey
6custody_token_accountPubkey
7user_token_accountPubkey
8lp_token_mintPubkey
9token_programPubkey
10event_authorityPubkey
11programPubkey
12…remainingVec<AccountMeta>

CloseBorrowPosition#

Discriminator cce291cde825038c · data CloseBorrowPosition · accounts CloseBorrowPositionInstructionAccounts.

Required accounts: 5; extras go to remaining.

Fields of CloseBorrowPositionInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1borrow_positionPubkey
2system_programPubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

ClosePositionRequest2#

Discriminator 7944a21cd82fc842 · data ClosePositionRequest2 · accounts ClosePositionRequest2InstructionAccounts.

No data fields.

Required accounts: 13; extras go to remaining.

Fields of ClosePositionRequest2InstructionAccounts, in account order:

#FieldType
0keeperOption<Pubkey>
1ownerPubkey
2owner_ataPubkey
3poolPubkey
4position_requestPubkey
5position_request_ataPubkey
6positionPubkey
7mintPubkey
8token_programPubkey
9system_programPubkey
10associated_token_programPubkey
11event_authorityPubkey
12programPubkey
13…remainingVec<AccountMeta>

ClosePositionRequest3#

Discriminator 7a822112d32ca13a · data ClosePositionRequest3 · accounts ClosePositionRequest3InstructionAccounts.

No data fields.

Required accounts: 14; extras go to remaining.

Fields of ClosePositionRequest3InstructionAccounts, in account order:

#FieldType
0keeperOption<Pubkey>
1ownerPubkey
2owner_ataPubkey
3poolPubkey
4position_requestPubkey
5position_request_ataPubkey
6positionPubkey
7custodyPubkey
8mintPubkey
9token_programPubkey
10system_programPubkey
11associated_token_programPubkey
12event_authorityPubkey
13programPubkey
14…remainingVec<AccountMeta>

CreateAndDelegateStakeAccount#

Discriminator 62d17a1bde895e86 · data CreateAndDelegateStakeAccount · accounts CreateAndDelegateStakeAccountInstructionAccounts.

Required accounts: 18; extras go to remaining.

Fields of CreateAndDelegateStakeAccountInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4custody_token_accountPubkey
5transfer_authorityPubkey
6stake_accountPubkey
7stake_infoPubkey
8validator_vote_accountPubkey
9stake_configPubkey
10wsol_mintPubkey
11temp_wsol_accountPubkey
12rentPubkey
13clockPubkey
14stake_historyPubkey
15stake_programPubkey
16system_programPubkey
17token_programPubkey
18…remainingVec<AccountMeta>

CreateDecreasePositionMarketRequest#

Discriminator 4ac6c356c163014f · data CreateDecreasePositionMarketRequest · accounts CreateDecreasePositionMarketRequestInstructionAccounts.

Required accounts: 16; extras go to remaining.

Fields of CreateDecreasePositionMarketRequestInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1receiving_accountPubkey
2perpetualsPubkey
3poolPubkey
4positionPubkey
5position_requestPubkey
6position_request_ataPubkey
7custodyPubkey
8collateral_custodyPubkey
9desired_mintPubkey
10referralOption<Pubkey>
11token_programPubkey
12associated_token_programPubkey
13system_programPubkey
14event_authorityPubkey
15programPubkey
16…remainingVec<AccountMeta>

CreateDecreasePositionRequest2#

Discriminator 6940c952fa0e6d4d · data CreateDecreasePositionRequest2 · accounts CreateDecreasePositionRequest2InstructionAccounts.

Required accounts: 18; extras go to remaining.

Fields of CreateDecreasePositionRequest2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1receiving_accountPubkey
2perpetualsPubkey
3poolPubkey
4positionPubkey
5position_requestPubkey
6position_request_ataPubkey
7custodyPubkey
8custody_doves_price_accountPubkey
9custody_pythnet_price_accountPubkey
10collateral_custodyPubkey
11desired_mintPubkey
12referralOption<Pubkey>
13token_programPubkey
14associated_token_programPubkey
15system_programPubkey
16event_authorityPubkey
17programPubkey
18…remainingVec<AccountMeta>

CreateIncreasePositionMarketRequest#

Discriminator b855c71869ab9c38 · data CreateIncreasePositionMarketRequest · accounts CreateIncreasePositionMarketRequestInstructionAccounts.

Required accounts: 16; extras go to remaining.

Fields of CreateIncreasePositionMarketRequestInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1funding_accountPubkey
2perpetualsPubkey
3poolPubkey
4positionPubkey
5position_requestPubkey
6position_request_ataPubkey
7custodyPubkey
8collateral_custodyPubkey
9input_mintPubkey
10referralOption<Pubkey>
11token_programPubkey
12associated_token_programPubkey
13system_programPubkey
14event_authorityPubkey
15programPubkey
16…remainingVec<AccountMeta>

CreateTokenLedger#

Discriminator e8f2c5fdf08f8134 · data CreateTokenLedger · accounts CreateTokenLedgerInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of CreateTokenLedgerInstructionAccounts, in account order:

#FieldType
0token_ledgerPubkey
1payerPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

CreateTokenMetadata#

Discriminator dd50b02599bca044 · data CreateTokenMetadata · accounts CreateTokenMetadataInstructionAccounts.

Required accounts: 9; extras go to remaining.

Fields of CreateTokenMetadataInstructionAccounts, in account order:

#FieldType
0adminPubkey
1perpetualsPubkey
2poolPubkey
3transfer_authorityPubkey
4metadataPubkey
5lp_token_mintPubkey
6token_metadata_programPubkey
7system_programPubkey
8rentPubkey
9…remainingVec<AccountMeta>

DecreasePosition4#

Discriminator b9a172af609403aa · data DecreasePosition4 · accounts DecreasePosition4InstructionAccounts.

Required accounts: 18; extras go to remaining.

Fields of DecreasePosition4InstructionAccounts, in account order:

#FieldType
0keeperPubkey
1ownerPubkey
2transfer_authorityPubkey
3perpetualsPubkey
4poolPubkey
5position_requestPubkey
6position_request_ataPubkey
7positionPubkey
8custodyPubkey
9custody_doves_price_accountPubkey
10custody_pythnet_price_accountPubkey
11collateral_custodyPubkey
12collateral_custody_doves_price_accountPubkey
13collateral_custody_pythnet_price_accountPubkey
14collateral_custody_token_accountPubkey
15token_programPubkey
16event_authorityPubkey
17programPubkey
18…remainingVec<AccountMeta>

DecreasePositionWithInternalSwap#

Discriminator 8311996e77646126 · data DecreasePositionWithInternalSwap · accounts DecreasePositionWithInternalSwapInstructionAccounts.

Required accounts: 22; extras go to remaining.

Fields of DecreasePositionWithInternalSwapInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1ownerPubkey
2transfer_authorityPubkey
3perpetualsPubkey
4poolPubkey
5position_requestPubkey
6position_request_ataPubkey
7positionPubkey
8custodyPubkey
9custody_doves_price_accountPubkey
10custody_pythnet_price_accountPubkey
11collateral_custodyPubkey
12collateral_custody_doves_price_accountPubkey
13collateral_custody_pythnet_price_accountPubkey
14collateral_custody_token_accountPubkey
15dispensing_custodyPubkey
16dispensing_custody_doves_price_accountPubkey
17dispensing_custody_pythnet_price_accountPubkey
18dispensing_custody_token_accountPubkey
19token_programPubkey
20event_authorityPubkey
21programPubkey
22…remainingVec<AccountMeta>

DecreasePositionWithTpsl#

Discriminator 6c12cbd1e36741a5 · data DecreasePositionWithTpsl · accounts DecreasePositionWithTpslInstructionAccounts.

Required accounts: 16; extras go to remaining.

Fields of DecreasePositionWithTpslInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1ownerPubkey
2transfer_authorityPubkey
3perpetualsPubkey
4poolPubkey
5position_requestPubkey
6position_request_ataPubkey
7positionPubkey
8custodyPubkey
9custody_doves_price_accountPubkey
10collateral_custodyPubkey
11collateral_custody_doves_price_accountPubkey
12collateral_custody_token_accountPubkey
13token_programPubkey
14event_authorityPubkey
15programPubkey
16…remainingVec<AccountMeta>

DecreasePositionWithTpslAndInternalSwap#

Discriminator 026fc8e723417beb · data DecreasePositionWithTpslAndInternalSwap · accounts DecreasePositionWithTpslAndInternalSwapInstructionAccounts.

Required accounts: 19; extras go to remaining.

Fields of DecreasePositionWithTpslAndInternalSwapInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1ownerPubkey
2transfer_authorityPubkey
3perpetualsPubkey
4poolPubkey
5position_requestPubkey
6position_request_ataPubkey
7positionPubkey
8custodyPubkey
9custody_doves_price_accountPubkey
10collateral_custodyPubkey
11collateral_custody_doves_price_accountPubkey
12collateral_custody_token_accountPubkey
13dispensing_custodyPubkey
14dispensing_custody_doves_price_accountPubkey
15dispensing_custody_token_accountPubkey
16token_programPubkey
17event_authorityPubkey
18programPubkey
19…remainingVec<AccountMeta>

DepositCollateralForBorrows#

Discriminator 1102c3be4c10ee4a · data DepositCollateralForBorrows · accounts DepositCollateralForBorrowsInstructionAccounts.

FieldType
paramsDepositParams

Required accounts: 13; extras go to remaining.

Fields of DepositCollateralForBorrowsInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4transfer_authorityPubkey
5borrow_positionPubkey
6collateral_token_accountPubkey
7user_token_accountPubkey
8lp_token_mintPubkey
9token_programPubkey
10system_programPubkey
11event_authorityPubkey
12programPubkey
13…remainingVec<AccountMeta>

GetAddLiquidityAmountAndFee2#

Discriminator 6d9d37a908510476 · data GetAddLiquidityAmountAndFee2 · accounts GetAddLiquidityAmountAndFee2InstructionAccounts.

Required accounts: 6; extras go to remaining.

Fields of GetAddLiquidityAmountAndFee2InstructionAccounts, in account order:

#FieldType
0perpetualsPubkey
1poolPubkey
2custodyPubkey
3custody_doves_price_accountPubkey
4custody_pythnet_price_accountPubkey
5lp_token_mintPubkey
6…remainingVec<AccountMeta>

GetAssetsUnderManagement2#

Discriminator c1d20df971951d54 · data GetAssetsUnderManagement2 · accounts GetAssetsUnderManagement2InstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of GetAssetsUnderManagement2InstructionAccounts, in account order:

#FieldType
0perpetualsPubkey
1poolPubkey
2…remainingVec<AccountMeta>

GetRemoveLiquidityAmountAndFee2#

Discriminator b73b486edff3968e · data GetRemoveLiquidityAmountAndFee2 · accounts GetRemoveLiquidityAmountAndFee2InstructionAccounts.

Required accounts: 6; extras go to remaining.

Fields of GetRemoveLiquidityAmountAndFee2InstructionAccounts, in account order:

#FieldType
0perpetualsPubkey
1poolPubkey
2custodyPubkey
3custody_doves_price_accountPubkey
4custody_pythnet_price_accountPubkey
5lp_token_mintPubkey
6…remainingVec<AccountMeta>

IncreasePosition4#

Discriminator 439335172b391043 · data IncreasePosition4 · accounts IncreasePosition4InstructionAccounts.

Required accounts: 16; extras go to remaining.

Fields of IncreasePosition4InstructionAccounts, in account order:

#FieldType
0keeperPubkey
1perpetualsPubkey
2poolPubkey
3position_requestPubkey
4position_request_ataPubkey
5positionPubkey
6custodyPubkey
7custody_doves_price_accountPubkey
8custody_pythnet_price_accountPubkey
9collateral_custodyPubkey
10collateral_custody_doves_price_accountPubkey
11collateral_custody_pythnet_price_accountPubkey
12collateral_custody_token_accountPubkey
13token_programPubkey
14event_authorityPubkey
15programPubkey
16…remainingVec<AccountMeta>

IncreasePositionPreSwap#

Discriminator 1a88e1d916155314 · data IncreasePositionPreSwap · accounts IncreasePositionPreSwapInstructionAccounts.

Required accounts: 11; extras go to remaining.

Fields of IncreasePositionPreSwapInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1keeper_ataPubkey
2position_requestPubkey
3position_request_ataPubkey
4positionPubkey
5collateral_custodyPubkey
6collateral_custody_token_accountPubkey
7instructionPubkey
8token_programPubkey
9event_authorityPubkey
10programPubkey
11…remainingVec<AccountMeta>

IncreasePositionWithInternalSwap#

Discriminator 72376a8cc7dd2070 · data IncreasePositionWithInternalSwap · accounts IncreasePositionWithInternalSwapInstructionAccounts.

Required accounts: 20; extras go to remaining.

Fields of IncreasePositionWithInternalSwapInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1perpetualsPubkey
2poolPubkey
3position_requestPubkey
4position_request_ataPubkey
5positionPubkey
6custodyPubkey
7custody_doves_price_accountPubkey
8custody_pythnet_price_accountPubkey
9collateral_custodyPubkey
10collateral_custody_doves_price_accountPubkey
11collateral_custody_pythnet_price_accountPubkey
12collateral_custody_token_accountPubkey
13receiving_custodyPubkey
14receiving_custody_doves_price_accountPubkey
15receiving_custody_pythnet_price_accountPubkey
16receiving_custody_token_accountPubkey
17token_programPubkey
18event_authorityPubkey
19programPubkey
20…remainingVec<AccountMeta>

Init#

Discriminator dc3bcfec6cfa2f64 · data Init · accounts InitInstructionAccounts.

FieldType
paramsInitParams

Required accounts: 8; extras go to remaining.

Fields of InitInstructionAccounts, in account order:

#FieldType
0upgrade_authorityPubkey
1adminPubkey
2transfer_authorityPubkey
3perpetualsPubkey
4perpetuals_programPubkey
5perpetuals_program_dataPubkey
6system_programPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

InstantCreateLimitOrder#

Discriminator c225c37b287f7e9c · data InstantCreateLimitOrder · accounts InstantCreateLimitOrderInstructionAccounts.

Required accounts: 20; extras go to remaining.

Fields of InstantCreateLimitOrderInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1api_keeperPubkey
2ownerPubkey
3funding_accountPubkey
4perpetualsPubkey
5poolPubkey
6positionPubkey
7position_requestPubkey
8position_request_ataPubkey
9custodyPubkey
10custody_doves_price_accountPubkey
11custody_pythnet_price_accountPubkey
12collateral_custodyPubkey
13input_mintPubkey
14referralOption<Pubkey>
15token_programPubkey
16associated_token_programPubkey
17system_programPubkey
18event_authorityPubkey
19programPubkey
20…remainingVec<AccountMeta>

InstantCreateTpsl#

Discriminator 7562427f1e3249b9 · data InstantCreateTpsl · accounts InstantCreateTpslInstructionAccounts.

Required accounts: 20; extras go to remaining.

Fields of InstantCreateTpslInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1api_keeperPubkey
2ownerPubkey
3receiving_accountPubkey
4perpetualsPubkey
5poolPubkey
6positionPubkey
7position_requestPubkey
8position_request_ataPubkey
9custodyPubkey
10custody_doves_price_accountPubkey
11custody_pythnet_price_accountPubkey
12collateral_custodyPubkey
13desired_mintPubkey
14referralOption<Pubkey>
15token_programPubkey
16associated_token_programPubkey
17system_programPubkey
18event_authorityPubkey
19programPubkey
20…remainingVec<AccountMeta>

InstantDecreasePosition#

Discriminator 2e17f02c1e8a5e8c · data InstantDecreasePosition · accounts InstantDecreasePositionInstructionAccounts.

Required accounts: 22; extras go to remaining.

Fields of InstantDecreasePositionInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1api_keeperPubkey
2ownerPubkey
3receiving_accountPubkey
4transfer_authorityPubkey
5perpetualsPubkey
6poolPubkey
7positionPubkey
8custodyPubkey
9custody_doves_price_accountPubkey
10custody_pythnet_price_accountPubkey
11collateral_custodyPubkey
12collateral_custody_doves_price_accountPubkey
13collateral_custody_pythnet_price_accountPubkey
14collateral_custody_token_accountPubkey
15desired_mintPubkey
16referralOption<Pubkey>
17token_programPubkey
18associated_token_programPubkey
19system_programPubkey
20event_authorityPubkey
21programPubkey
22…remainingVec<AccountMeta>

InstantDecreasePosition2#

Discriminator a2bfc83e8b3eb011 · data InstantDecreasePosition2 · accounts InstantDecreasePosition2InstructionAccounts.

Required accounts: 22; extras go to remaining.

Fields of InstantDecreasePosition2InstructionAccounts, in account order:

#FieldType
0keeperPubkey
1api_keeperPubkey
2ownerPubkey
3receiving_accountPubkey
4transfer_authorityPubkey
5perpetualsPubkey
6poolPubkey
7positionPubkey
8custodyPubkey
9custody_doves_price_accountPubkey
10collateral_custodyPubkey
11collateral_custody_doves_price_accountPubkey
12collateral_custody_token_accountPubkey
13desired_mintPubkey
14referralOption<Pubkey>
15position_requestPubkey
16position_request_ataPubkey
17token_programPubkey
18associated_token_programPubkey
19system_programPubkey
20event_authorityPubkey
21programPubkey
22…remainingVec<AccountMeta>

InstantIncreasePosition#

Discriminator a47e44b6dfa640b7 · data InstantIncreasePosition · accounts InstantIncreasePositionInstructionAccounts.

Required accounts: 20; extras go to remaining.

Fields of InstantIncreasePositionInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1api_keeperPubkey
2ownerPubkey
3funding_accountPubkey
4perpetualsPubkey
5poolPubkey
6positionPubkey
7custodyPubkey
8custody_doves_price_accountPubkey
9custody_pythnet_price_accountPubkey
10collateral_custodyPubkey
11collateral_custody_doves_price_accountPubkey
12collateral_custody_pythnet_price_accountPubkey
13collateral_custody_token_accountPubkey
14token_ledgerOption<Pubkey>
15referralOption<Pubkey>
16token_programPubkey
17system_programPubkey
18event_authorityPubkey
19programPubkey
20…remainingVec<AccountMeta>

InstantIncreasePositionPreSwap#

Discriminator c52656a5c71726ea · data InstantIncreasePositionPreSwap · accounts InstantIncreasePositionPreSwapInstructionAccounts.

Required accounts: 16; extras go to remaining.

Fields of InstantIncreasePositionPreSwapInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1funding_accountPubkey
2receiving_accountPubkey
3transfer_authorityPubkey
4perpetualsPubkey
5poolPubkey
6receiving_custodyPubkey
7receiving_custody_doves_price_accountPubkey
8receiving_custody_token_accountPubkey
9dispensing_custodyPubkey
10dispensing_custody_doves_price_accountPubkey
11dispensing_custody_token_accountPubkey
12token_programPubkey
13instructionPubkey
14event_authorityPubkey
15programPubkey
16…remainingVec<AccountMeta>

InstantUpdateLimitOrder#

Discriminator 88f5e53a798d0ccf · data InstantUpdateLimitOrder · accounts InstantUpdateLimitOrderInstructionAccounts.

Required accounts: 10; extras go to remaining.

Fields of InstantUpdateLimitOrderInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1api_keeperPubkey
2ownerPubkey
3perpetualsPubkey
4poolPubkey
5positionPubkey
6position_requestPubkey
7custodyPubkey
8custody_doves_price_accountPubkey
9custody_pythnet_price_accountPubkey
10…remainingVec<AccountMeta>

InstantUpdateTpsl#

Discriminator 90e47225a5f26f65 · data InstantUpdateTpsl · accounts InstantUpdateTpslInstructionAccounts.

Required accounts: 12; extras go to remaining.

Fields of InstantUpdateTpslInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1api_keeperPubkey
2ownerPubkey
3perpetualsPubkey
4poolPubkey
5positionPubkey
6position_requestPubkey
7custodyPubkey
8custody_doves_price_accountPubkey
9custody_pythnet_price_accountPubkey
10event_authorityPubkey
11programPubkey
12…remainingVec<AccountMeta>

LiquidateBorrowPosition#

Discriminator ebc91185ea4854d2 · data LiquidateBorrowPosition · accounts LiquidateBorrowPositionInstructionAccounts.

Required accounts: 11; extras go to remaining.

Fields of LiquidateBorrowPositionInstructionAccounts, in account order:

#FieldType
0signerPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4transfer_authorityPubkey
5borrow_positionPubkey
6collateral_token_accountPubkey
7lp_token_mintPubkey
8token_programPubkey
9event_authorityPubkey
10programPubkey
11…remainingVec<AccountMeta>

LiquidateFullPosition4#

Discriminator 40b05833a8bc9caf · data LiquidateFullPosition4 · accounts LiquidateFullPosition4InstructionAccounts.

Required accounts: 13; extras go to remaining.

Fields of LiquidateFullPosition4InstructionAccounts, in account order:

#FieldType
0signerPubkey
1perpetualsPubkey
2poolPubkey
3positionPubkey
4custodyPubkey
5custody_doves_price_accountPubkey
6custody_pythnet_price_accountPubkey
7collateral_custodyPubkey
8collateral_custody_doves_price_accountPubkey
9collateral_custody_pythnet_price_accountPubkey
10collateral_custody_token_accountPubkey
11event_authorityPubkey
12programPubkey
13…remainingVec<AccountMeta>

OperatorSetCustodyConfig#

Discriminator a6895ccc91e018da · data OperatorSetCustodyConfig · accounts OperatorSetCustodyConfigInstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of OperatorSetCustodyConfigInstructionAccounts, in account order:

#FieldType
0operatorPubkey
1custodyPubkey
2…remainingVec<AccountMeta>

OperatorSetPoolConfig#

Discriminator 4cc95012c75cf669 · data OperatorSetPoolConfig · accounts OperatorSetPoolConfigInstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of OperatorSetPoolConfigInstructionAccounts, in account order:

#FieldType
0operatorPubkey
1poolPubkey
2…remainingVec<AccountMeta>

PartialLiquidateBorrowPosition#

Discriminator faa60d4a61cc82d1 · data PartialLiquidateBorrowPosition · accounts PartialLiquidateBorrowPositionInstructionAccounts.

Required accounts: 11; extras go to remaining.

Fields of PartialLiquidateBorrowPositionInstructionAccounts, in account order:

#FieldType
0signerPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4transfer_authorityPubkey
5borrow_positionPubkey
6collateral_token_accountPubkey
7lp_token_mintPubkey
8token_programPubkey
9event_authorityPubkey
10programPubkey
11…remainingVec<AccountMeta>

ReallocCustody#

Discriminator 7b3a6d8b8507e1c8 · data ReallocCustody · accounts ReallocCustodyInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of ReallocCustodyInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1custodyPubkey
2system_programPubkey
3rentPubkey
4…remainingVec<AccountMeta>

ReallocPool#

Discriminator 728025a747e328b2 · data ReallocPool · accounts ReallocPoolInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of ReallocPoolInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1poolPubkey
2system_programPubkey
3rentPubkey
4…remainingVec<AccountMeta>

RedeemStake#

Discriminator b2cbfa698576ff45 · data RedeemStake · accounts RedeemStakeInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of RedeemStakeInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4stake_accountPubkey
5stake_infoPubkey
6…remainingVec<AccountMeta>

RefreshAssetsUnderManagement#

Discriminator a200d737e10fb900 · data RefreshAssetsUnderManagement · accounts RefreshAssetsUnderManagementInstructionAccounts.

Required accounts: 4; extras go to remaining.

Fields of RefreshAssetsUnderManagementInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1perpetualsPubkey
2poolPubkey
3lp_token_mintPubkey
4…remainingVec<AccountMeta>

RemoveLiquidity2#

Discriminator e6d7527ff165e392 · data RemoveLiquidity2 · accounts RemoveLiquidity2InstructionAccounts.

FieldType
paramsRemoveLiquidity2Params

Required accounts: 14; extras go to remaining.

Fields of RemoveLiquidity2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1receiving_accountPubkey
2lp_token_accountPubkey
3transfer_authorityPubkey
4perpetualsPubkey
5poolPubkey
6custodyPubkey
7custody_doves_price_accountPubkey
8custody_pythnet_price_accountPubkey
9custody_token_accountPubkey
10lp_token_mintPubkey
11token_programPubkey
12event_authorityPubkey
13programPubkey
14…remainingVec<AccountMeta>

RepayToCustody#

Discriminator d3dbb7def84a051a · data RepayToCustody · accounts RepayToCustodyInstructionAccounts.

FieldType
paramsRepayToCustodyParams

Required accounts: 10; extras go to remaining.

Fields of RepayToCustodyInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4borrow_positionPubkey
5custody_token_accountPubkey
6user_token_accountPubkey
7token_programPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

SetCustodyConfig#

Discriminator 8561828fd7e524b0 · data SetCustodyConfig · accounts SetCustodyConfigInstructionAccounts.

FieldType
paramsSetCustodyConfigParams

Required accounts: 3; extras go to remaining.

Fields of SetCustodyConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1perpetualsPubkey
2custodyPubkey
3…remainingVec<AccountMeta>

SetMaxGlobalSizes#

Discriminator 5902d218a7e30dd6 · data SetMaxGlobalSizes · accounts SetMaxGlobalSizesInstructionAccounts.

Required accounts: 3; extras go to remaining.

Fields of SetMaxGlobalSizesInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1custodyPubkey
2poolPubkey
3…remainingVec<AccountMeta>

SetPerpetualsConfig#

Discriminator 504815bf1d792d6f · data SetPerpetualsConfig · accounts SetPerpetualsConfigInstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of SetPerpetualsConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1perpetualsPubkey
2…remainingVec<AccountMeta>

SetPoolConfig#

Discriminator d857417d716eb978 · data SetPoolConfig · accounts SetPoolConfigInstructionAccounts.

FieldType
paramsSetPoolConfigParams

Required accounts: 3; extras go to remaining.

Fields of SetPoolConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1perpetualsPubkey
2poolPubkey
3…remainingVec<AccountMeta>

SetTestTime#

Discriminator f2e7b1fb7e919f68 · data SetTestTime · accounts SetTestTimeInstructionAccounts.

FieldType
paramsSetTestTimeParams

Required accounts: 2; extras go to remaining.

Fields of SetTestTimeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1perpetualsPubkey
2…remainingVec<AccountMeta>

SetTokenLedger#

Discriminator e455b9704e4f4d02 · data SetTokenLedger · accounts SetTokenLedgerInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of SetTokenLedgerInstructionAccounts, in account order:

#FieldType
0token_ledgerPubkey
1token_accountPubkey
2token_programPubkey
3…remainingVec<AccountMeta>

Swap2#

Discriminator 414b3f4ceb5b5b88 · data Swap2 · accounts Swap2InstructionAccounts.

FieldType
paramsSwap2Params

Required accounts: 17; extras go to remaining.

Fields of Swap2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1funding_accountPubkey
2receiving_accountPubkey
3transfer_authorityPubkey
4perpetualsPubkey
5poolPubkey
6receiving_custodyPubkey
7receiving_custody_doves_price_accountPubkey
8receiving_custody_pythnet_price_accountPubkey
9receiving_custody_token_accountPubkey
10dispensing_custodyPubkey
11dispensing_custody_doves_price_accountPubkey
12dispensing_custody_pythnet_price_accountPubkey
13dispensing_custody_token_accountPubkey
14token_programPubkey
15event_authorityPubkey
16programPubkey
17…remainingVec<AccountMeta>

SwapWithTokenLedger#

Discriminator 8b8deec529d3ac13 · data SwapWithTokenLedger · accounts SwapWithTokenLedgerInstructionAccounts.

Required accounts: 17; extras go to remaining.

Fields of SwapWithTokenLedgerInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1funding_accountPubkey
2receiving_accountPubkey
3transfer_authorityPubkey
4perpetualsPubkey
5poolPubkey
6receiving_custodyPubkey
7receiving_custody_doves_price_accountPubkey
8receiving_custody_token_accountPubkey
9dispensing_custodyPubkey
10dispensing_custody_doves_price_accountPubkey
11dispensing_custody_token_accountPubkey
12token_ledgerPubkey
13token_programPubkey
14instructionPubkey
15event_authorityPubkey
16programPubkey
17…remainingVec<AccountMeta>

TestInit#

Discriminator 30335c7a51137029 · data TestInit · accounts TestInitInstructionAccounts.

FieldType
paramsTestInitParams

Required accounts: 6; extras go to remaining.

Fields of TestInitInstructionAccounts, in account order:

#FieldType
0upgrade_authorityPubkey
1adminPubkey
2transfer_authorityPubkey
3perpetualsPubkey
4system_programPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

TransferAdmin#

Discriminator 2af2426ae40a6f9c · data TransferAdmin · accounts TransferAdminInstructionAccounts.

FieldType
paramsTransferAdminParams

Required accounts: 3; extras go to remaining.

Fields of TransferAdminInstructionAccounts, in account order:

#FieldType
0adminPubkey
1new_adminPubkey
2perpetualsPubkey
3…remainingVec<AccountMeta>

Unstake#

Discriminator 5a5f6b2acd7c32e1 · data Unstake · accounts UnstakeInstructionAccounts.

No data fields.

Required accounts: 9; extras go to remaining.

Fields of UnstakeInstructionAccounts, in account order:

#FieldType
0operatorPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4transfer_authorityPubkey
5stake_accountPubkey
6stake_infoPubkey
7clockPubkey
8stake_programPubkey
9…remainingVec<AccountMeta>

UpdateDecreasePositionRequest2#

Discriminator 90c8f9ff6cd9f974 · data UpdateDecreasePositionRequest2 · accounts UpdateDecreasePositionRequest2InstructionAccounts.

Required accounts: 8; extras go to remaining.

Fields of UpdateDecreasePositionRequest2InstructionAccounts, in account order:

#FieldType
0ownerPubkey
1perpetualsPubkey
2poolPubkey
3positionPubkey
4position_requestPubkey
5custodyPubkey
6custody_doves_price_accountPubkey
7custody_pythnet_price_accountPubkey
8…remainingVec<AccountMeta>

WithdrawCollateralForBorrows#

Discriminator 75a03c52ede92eb6 · data WithdrawCollateralForBorrows · accounts WithdrawCollateralForBorrowsInstructionAccounts.

FieldType
paramsWithdrawParams

Required accounts: 12; extras go to remaining.

Fields of WithdrawCollateralForBorrowsInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4transfer_authorityPubkey
5borrow_positionPubkey
6collateral_token_accountPubkey
7user_token_accountPubkey
8lp_token_mintPubkey
9token_programPubkey
10event_authorityPubkey
11programPubkey
12…remainingVec<AccountMeta>

WithdrawFees2#

Discriminator fc808f91e1dd9fcf · data WithdrawFees2 · accounts WithdrawFees2InstructionAccounts.

FieldType
paramsWithdrawFees2Params

Required accounts: 10; extras go to remaining.

Fields of WithdrawFees2InstructionAccounts, in account order:

#FieldType
0keeperPubkey
1transfer_authorityPubkey
2perpetualsPubkey
3poolPubkey
4custodyPubkey
5custody_token_accountPubkey
6custody_doves_price_accountPubkey
7custody_pythnet_price_accountPubkey
8receiving_token_accountPubkey
9token_programPubkey
10…remainingVec<AccountMeta>

WithdrawStake#

Discriminator 9908168a69b05742 · data WithdrawStake · accounts WithdrawStakeInstructionAccounts.

No data fields.

Required accounts: 13; extras go to remaining.

Fields of WithdrawStakeInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1perpetualsPubkey
2poolPubkey
3custodyPubkey
4custody_token_accountPubkey
5transfer_authorityPubkey
6stake_accountPubkey
7stake_infoPubkey
8clockPubkey
9stake_historyPubkey
10stake_programPubkey
11system_programPubkey
12token_programPubkey
13…remainingVec<AccountMeta>

CpiEvent#

Anchor self-CPI that carries one of the program's 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:

#FieldType
0programPubkey
1event_authorityPubkey
2…remainingVec<AccountMeta>

Accounts#

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

BorrowPosition#

Discriminator f38c148b20f37237 · accounts::borrow_position::BorrowPosition.

FieldType
ownerPubkey
poolPubkey
custodyPubkey
open_timei64
update_timei64
borrow_sizeu128
cumulative_compounded_interest_snapshotu128
locked_collateralu64
bumpu8
last_borrowedi64

Custody#

Discriminator 01b830515d833f91 · accounts::custody::Custody.

FieldType
poolPubkey
mintPubkey
token_accountPubkey
decimalsu8
is_stablebool
oracleOracleParams
pricingPricingParams
permissionsPermissions
target_ratio_bpsu64
assetsAssets
funding_rate_stateFundingRateState
bumpu8
token_account_bumpu8
increase_position_bpsu64
decrease_position_bpsu64
max_position_size_usdu64
doves_oraclePubkey
jump_rate_stateJumpRateState
doves_ag_oraclePubkey
price_impact_bufferPriceImpactBuffer
borrow_lend_parametersBorrowLendParams
borrows_funding_rate_stateFundingRateState
debtu128
borrow_lend_interests_accuredu128
borrow_limit_in_token_amountu64
min_interest_fee_bpsu64
min_interest_fee_grace_period_secondsu64
total_staked_amount_lamportsu64
max_total_staked_amount_lamportsu64
external_swap_fee_multiplier_bpsu64
disable_close_position_requestbool
withdrawal_limit_token_amountu64
withdrawal_token_amount_accumulatedu64
withdrawal_limit_last_reset_ati64
withdrawal_limit_interval_secondsu64

Perpetuals#

Discriminator 1ca762bf68526cc4 · accounts::perpetuals::Perpetuals.

FieldType
permissionsPermissions
poolsVec<Pubkey>
adminPubkey
transfer_authority_bumpu8
perpetuals_bumpu8
inception_timei64

Pool#

Discriminator f19a6d0411b16dbc · accounts::pool::Pool.

FieldType
nameString
custodiesVec<Pubkey>
aum_usdu128
limitLimit
feesFees
pool_aprPoolApr
max_request_execution_seci64
bumpu8
lp_token_bumpu8
inception_timei64
parameter_update_oracleSecp256k1Pubkey
aum_usd_updated_ati64
max_trigger_price_diff_bpsu64
disable_close_position_requestbool
max_lp_token_price_change_bpsu64
aum_usd_refreshed_at_slotu64

Position#

Discriminator aabc8fe47a40f7d0 · accounts::position::Position.

FieldType
ownerPubkey
poolPubkey
custodyPubkey
collateral_custodyPubkey
open_timei64
update_timei64
sideSide
priceu64
size_usdu64
collateral_usdu64
realised_pnl_usdi64
cumulative_interest_snapshotu128
locked_amountu64
bumpu8

PositionRequest#

Discriminator 0c26fac72e9a20d8 · accounts::position_request::PositionRequest.

FieldType
ownerPubkey
poolPubkey
custodyPubkey
positionPubkey
mintPubkey
open_timei64
update_timei64
size_usd_deltau64
collateral_deltau64
request_changeRequestChange
request_typeRequestType
sideSide
price_slippageOption<u64>
jupiter_minimum_outOption<u64>
pre_swap_amountOption<u64>
trigger_priceOption<u64>
trigger_above_thresholdOption<bool>
entire_positionOption<bool>
executedbool
counteru64
bumpu8
referralOption<Pubkey>

StakeInfo#

Discriminator 423e44466cb3b7eb · accounts::stake_info::StakeInfo.

FieldType
poolPubkey
stake_accountPubkey
current_staked_amount_lamportsu64
total_staking_rewards_lamportsu64
last_updated_ati64
deactivatingbool
stake_account_indexu64
bumpu8

TokenLedger#

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

FieldType
token_accountPubkey
amountu64

Events#

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

CreatePositionRequestEvent#

Discriminator 02ee5e3569d32eba · events::create_position_request_event::CreatePositionRequestEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_sideu8
position_mintPubkey
position_custodyPubkey
position_collateral_mintPubkey
position_collateral_custodyPubkey
position_request_keyPubkey
position_request_mintPubkey
size_usd_deltau64
collateral_deltau64
price_slippageOption<u64>
jupiter_minimum_outOption<u64>
pre_swap_amountOption<u64>
request_changeu8
open_timei64
referralOption<Pubkey>

InstantCreateTpslEvent#

Discriminator f236065f188d67c6 · events::instant_create_tpsl_event::InstantCreateTpslEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_sideu8
position_mintPubkey
position_custodyPubkey
position_collateral_custodyPubkey
position_request_keyPubkey
position_request_mintPubkey
size_usd_deltau64
collateral_deltau64
entire_positionbool
open_timei64

InstantUpdateTpslEvent#

Discriminator b1162f2578f61165 · events::instant_update_tpsl_event::InstantUpdateTpslEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_sideu8
position_mintPubkey
position_custodyPubkey
position_collateral_custodyPubkey
position_request_keyPubkey
position_request_mintPubkey
size_usd_deltau64
collateral_deltau64
entire_positionbool
update_timei64

ClosePositionRequestEvent#

Discriminator 15225c9ee01db4f3 · events::close_position_request_event::ClosePositionRequestEventEvent.

FieldType
entire_positionOption<bool>
executedbool
request_changeu8
request_typeu8
sideu8
position_request_keyPubkey
ownerPubkey
mintPubkey
amountu64
open_timei64

IncreasePositionEvent#

Discriminator f5715534d6bb9984 · events::increase_position_event::IncreasePositionEventEvent.

FieldType
position_keyPubkey
position_sideu8
position_custodyPubkey
position_collateral_custodyPubkey
position_size_usdu64
position_mintPubkey
position_request_keyPubkey
position_request_mintPubkey
position_request_changeu8
position_request_typeu8
position_request_collateral_deltau64
ownerPubkey
poolPubkey
size_usd_deltau64
collateral_usd_deltau64
collateral_token_deltau64
priceu64
price_slippageOption<u64>
fee_tokenu64
fee_usdu64
open_timei64
referralOption<Pubkey>
position_fee_usdu64
funding_fee_usdu64
price_impact_fee_usdu64

IncreasePositionPreSwapEvent#

Discriminator ed6b098b164b04d5 · events::increase_position_pre_swap_event::IncreasePositionPreSwapEventEvent.

FieldType
position_request_keyPubkey
transfer_amountu64
collateral_custody_pre_swap_amountu64

DecreasePositionEvent#

Discriminator 409c2b4a6d83107f · events::decrease_position_event::DecreasePositionEventEvent.

FieldType
position_keyPubkey
position_sideu8
position_custodyPubkey
position_collateral_custodyPubkey
position_size_usdu64
position_mintPubkey
position_request_keyPubkey
position_request_mintPubkey
position_request_changeu8
position_request_typeu8
has_profitbool
pnl_deltau64
ownerPubkey
poolPubkey
size_usd_deltau64
transfer_amount_usdu64
transfer_tokenOption<u64>
priceu64
price_slippageOption<u64>
fee_usdu64
open_timei64
referralOption<Pubkey>
position_fee_usdu64
funding_fee_usdu64
price_impact_fee_usdu64
original_position_collateral_usdu64
position_collateral_usdu64
position_open_timei64
position_priceu64

DecreasePositionPostSwapEvent#

Discriminator 17d210e962f55952 · events::decrease_position_post_swap_event::DecreasePositionPostSwapEventEvent.

FieldType
position_request_keyPubkey
swap_amountu64
jupiter_minimum_outOption<u64>

LiquidateFullPositionEvent#

Discriminator 806547a880485654 · events::liquidate_full_position_event::LiquidateFullPositionEventEvent.

FieldType
position_keyPubkey
position_sideu8
position_custodyPubkey
position_collateral_custodyPubkey
position_collateral_mintPubkey
position_mintPubkey
position_size_usdu64
has_profitbool
pnl_deltau64
ownerPubkey
poolPubkey
transfer_amount_usdu64
transfer_tokenu64
priceu64
fee_usdu64
liquidation_fee_usdu64
open_timei64
position_fee_usdu64
funding_fee_usdu64
price_impact_fee_usdu64
original_position_collateral_usdu64
position_collateral_usdu64
position_open_timei64
position_priceu64

PoolSwapEvent#

Discriminator 286bd41adf8827dc · events::pool_swap_event::PoolSwapEventEvent.

FieldType
receiving_custody_keyPubkey
dispensing_custody_keyPubkey
pool_keyPubkey
amount_inu64
amount_outu64
swap_usd_amountu64
amount_out_after_feesu64
fee_bpsu64
owner_keyPubkey
receiving_account_keyPubkey

PoolSwapExactOutEvent#

Discriminator 79760b0bc6428e73 · events::pool_swap_exact_out_event::PoolSwapExactOutEventEvent.

FieldType
receiving_custody_keyPubkey
dispensing_custody_keyPubkey
pool_keyPubkey
amount_inu64
amount_in_after_feesu64
amount_outu64
swap_usd_amountu64
fee_bpsu64
owner_keyPubkey
receiving_account_keyPubkey

AddLiquidityEvent#

Discriminator 1bb299ba2fc48c2d · events::add_liquidity_event::AddLiquidityEventEvent.

FieldType
custody_keyPubkey
pool_keyPubkey
token_amount_inu64
pre_pool_amount_usdu128
token_amount_usdu64
fee_bpsu64
token_amount_after_feeu64
mint_amount_usdu64
lp_amountu64
post_pool_amount_usdu128

RemoveLiquidityEvent#

Discriminator 8dc7b67b9f5ed766 · events::remove_liquidity_event::RemoveLiquidityEventEvent.

FieldType
custody_keyPubkey
pool_keyPubkey
lp_amount_inu64
remove_amount_usdu64
fee_bpsu64
remove_token_amountu64
token_amount_after_feeu64
post_pool_amount_usdu128

InstantCreateLimitOrderEvent#

Discriminator 0aa3557381e050c0 · events::instant_create_limit_order_event::InstantCreateLimitOrderEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_sideu8
position_mintPubkey
position_custodyPubkey
position_collateral_mintPubkey
position_collateral_custodyPubkey
position_request_keyPubkey
position_request_mintPubkey
size_usd_deltau64
collateral_deltau64
open_timei64

InstantIncreasePositionEvent#

Discriminator cdec3904d16a5745 · events::instant_increase_position_event::InstantIncreasePositionEventEvent.

FieldType
position_keyPubkey
position_sideu8
position_custodyPubkey
position_collateral_custodyPubkey
position_size_usdu64
position_mintPubkey
ownerPubkey
poolPubkey
size_usd_deltau64
collateral_usd_deltau64
collateral_token_deltau64
priceu64
price_slippageu64
fee_tokenu64
fee_usdu64
open_timei64
referralOption<Pubkey>
position_fee_usdu64
funding_fee_usdu64
price_impact_fee_usdu64

InstantDecreasePositionEvent#

Discriminator abad6a19efbe3a3b · events::instant_decrease_position_event::InstantDecreasePositionEventEvent.

FieldType
position_keyPubkey
position_sideu8
position_custodyPubkey
position_collateral_custodyPubkey
position_size_usdu64
position_mintPubkey
desired_mintPubkey
has_profitbool
pnl_deltau64
ownerPubkey
poolPubkey
size_usd_deltau64
transfer_amount_usdu64
transfer_tokenu64
priceu64
price_slippageu64
fee_usdu64
open_timei64
referralOption<Pubkey>
position_fee_usdu64
funding_fee_usdu64
original_position_collateral_usdu64
position_collateral_usdu64
price_impact_fee_usdu64
position_open_timei64
position_priceu64
position_requestOption<Pubkey>

DepositCollateralEvent#

Discriminator a90e66949b8912eb · events::deposit_collateral_event::DepositCollateralEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_mintPubkey
position_custodyPubkey
deposit_amountu64
user_token_accountPubkey
timei64

WithdrawCollateralEvent#

Discriminator 91262e57be95fdbf · events::withdraw_collateral_event::WithdrawCollateralEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_mintPubkey
position_custodyPubkey
withdraw_amountu64
user_token_accountPubkey
custodyPubkey
previous_collateral_amountu64
collateral_amountu64
collateral_amount_usdu64
margin_usdu64
timei64

BorrowFromCustodyEvent#

Discriminator 17798344a8460e4c · events::borrow_from_custody_event::BorrowFromCustodyEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_mintPubkey
position_custodyPubkey
size_custody_tokenu64
collateral_amountu64
collateral_amount_usdu64
margin_usdu64
update_timei64

RepayToCustodyEvent#

Discriminator e83674afba18f9dd · events::repay_to_custody_event::RepayToCustodyEventEvent.

FieldType
ownerPubkey
poolPubkey
position_keyPubkey
position_mintPubkey
position_custodyPubkey
size_custody_tokenu64
update_timei64
interestu128

LiquidateBorrowPositionEvent#

Discriminator 0b80fc3b31c038aa · events::liquidate_borrow_position_event::LiquidateBorrowPositionEventEvent.

FieldType
position_keyPubkey
position_custodyPubkey
position_size_usdu64
ownerPubkey
poolPubkey
collateral_locked_in_usdu64
collateral_locked_in_lpu64
remaining_collateral_in_lpu64
custody_token_priceu64
total_borrows_in_usdu64
liquidation_fee_usdu64
liquidation_timei64

RedeemStakeEvent#

Discriminator 00f1548d8baada6e · events::redeem_stake_event::RedeemStakeEventEvent.

FieldType
custodyPubkey
stake_accountPubkey
stake_infoPubkey
stake_rewardsu64
custody_total_staked_amountu64
current_staked_amountu64
total_staking_rewardsu64
redeem_timei64

WithdrawStakeEvent#

Discriminator 2f55efd6cf1d9758 · events::withdraw_stake_event::WithdrawStakeEventEvent.

FieldType
custodyPubkey
stake_accountPubkey
stake_infoPubkey
stake_rewardsu64
custody_total_staked_amountu64
total_staking_rewardsu64
withdraw_amountu64
withdraw_timei64

DelegateStakeEvent#

Discriminator 55874bdea8859fd4 · events::delegate_stake_event::DelegateStakeEventEvent.

FieldType
custodyPubkey
stake_accountPubkey
stake_infoPubkey
custody_total_staked_amountu64
stake_amountu64
validator_vote_accountPubkey
delegate_timei64

WithdrawFeesEvent#

Discriminator ec768a5a8badb159 · events::withdraw_fees_event::WithdrawFeesEventEvent.

FieldType
poolPubkey
custodyPubkey
custody_mintPubkey
receiving_token_accountPubkey
total_trade_swap_feesu64
pool_trade_swap_feesu64
protocol_trade_swap_feesu64
total_borrow_lending_feesu64
pool_borrow_lending_feesu64
protocol_borrow_lending_feesu64
pool_total_fees_usdu64
apr_bps_beforeu64
apr_bps_afteru64
apr_bps_updated_ati64
pool_realized_fee_usd_beforeu64
pool_realized_fee_usd_afteru64
curtimei64

Types#

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

AddCustodyParams#

Struct types::AddCustodyParams.

FieldType
is_stablebool
oracleOracleParams
pricingPricingParams
permissionsPermissions
hourly_funding_dbpsu64
target_ratio_bpsu64
increase_position_bpsu64
decrease_position_bpsu64
doves_oraclePubkey
max_position_size_usdu64
jump_rateJumpRateState
price_impact_fee_factoru64
price_impact_exponentf32
delta_imbalance_threshold_decimalu64
max_fee_bpsu64
doves_ag_oraclePubkey

AddLiquidity2Params#

Struct types::AddLiquidity2Params.

FieldType
token_amount_inu64
min_lp_amount_outu64
token_amount_pre_swapOption<u64>

AddLiquidityEvent#

Struct types::AddLiquidityEvent. Same fields as the AddLiquidityEvent event.

AddPoolParams#

Struct types::AddPoolParams.

FieldType
nameString
limitLimit
feesFees
max_request_execution_seci64

AmountAndFee#

Struct types::AmountAndFee.

FieldType
amountu64
feeu64
fee_bpsu64

Assets#

Struct types::Assets.

FieldType
fees_reservesu64
ownedu64
lockedu64
guaranteed_usdu64
global_short_sizesu64
global_short_average_pricesu64

BorrowFromCustodyEvent#

Struct types::BorrowFromCustodyEvent. Same fields as the BorrowFromCustodyEvent event.

BorrowFromCustodyParams#

Struct types::BorrowFromCustodyParams.

FieldType
amountu64

BorrowLendParams#

Struct types::BorrowLendParams.

FieldType
borrows_limit_in_bpsu64
maintainance_margin_bpsu64
protocol_fee_bpsu64
liquidation_marginu64
liquidation_fee_bpsu64

CloseBorrowPositionParams#

Struct types::CloseBorrowPositionParams.

No fields.

ClosePositionRequestEvent#

Struct types::ClosePositionRequestEvent. Same fields as the ClosePositionRequestEvent event.

CreateAndDelegateStakeAccountParams#

Struct types::CreateAndDelegateStakeAccountParams.

FieldType
stake_account_indexu64
stake_amount_lamportsu64

CreateDecreasePositionMarketRequestParams#

Struct types::CreateDecreasePositionMarketRequestParams.

FieldType
collateral_usd_deltau64
size_usd_deltau64
price_slippageu64
jupiter_minimum_outOption<u64>
entire_positionOption<bool>
counteru64

CreateDecreasePositionRequest2Params#

Struct types::CreateDecreasePositionRequest2Params.

FieldType
collateral_usd_deltau64
size_usd_deltau64
request_typeRequestType
price_slippageOption<u64>
jupiter_minimum_outOption<u64>
trigger_priceOption<u64>
trigger_above_thresholdOption<bool>
entire_positionOption<bool>
counteru64

CreateIncreasePositionMarketRequestParams#

Struct types::CreateIncreasePositionMarketRequestParams.

FieldType
size_usd_deltau64
collateral_token_deltau64
sideSide
price_slippageu64
jupiter_minimum_outOption<u64>
counteru64

CreatePositionRequestEvent#

Struct types::CreatePositionRequestEvent. Same fields as the CreatePositionRequestEvent event.

CreateTokenMetadataParams#

Struct types::CreateTokenMetadataParams.

FieldType
nameString
symbolString
uriString

DecreasePosition4Params#

Struct types::DecreasePosition4Params.

No fields.

DecreasePositionEvent#

Struct types::DecreasePositionEvent. Same fields as the DecreasePositionEvent event.

DecreasePositionPostSwapEvent#

Struct types::DecreasePositionPostSwapEvent. Same fields as the DecreasePositionPostSwapEvent event.

DecreasePositionWithInternalSwapParams#

Struct types::DecreasePositionWithInternalSwapParams.

No fields.

DecreasePositionWithTpslAndInternalSwapParams#

Struct types::DecreasePositionWithTpslAndInternalSwapParams.

No fields.

DecreasePositionWithTpslParams#

Struct types::DecreasePositionWithTpslParams.

No fields.

DelegateStakeEvent#

Struct types::DelegateStakeEvent. Same fields as the DelegateStakeEvent event.

DepositCollateralEvent#

Struct types::DepositCollateralEvent. Same fields as the DepositCollateralEvent event.

DepositParams#

Struct types::DepositParams.

FieldType
amountu64

Fees#

Struct types::Fees.

FieldType
swap_multiplieru64
stable_swap_multiplieru64
add_remove_liquidity_bpsu64
swap_bpsu64
tax_bpsu64
stable_swap_bpsu64
stable_swap_tax_bpsu64
liquidation_reward_bpsu64
protocol_share_bpsu64

FundingRateState#

Struct types::FundingRateState.

FieldType
cumulative_interest_rateu128
last_updatei64
hourly_funding_dbpsu64

GetAddLiquidityAmountAndFee2Params#

Struct types::GetAddLiquidityAmountAndFee2Params.

FieldType
token_amount_inu64

GetAssetsUnderManagement2Params#

Struct types::GetAssetsUnderManagement2Params.

GetRemoveLiquidityAmountAndFee2Params#

Struct types::GetRemoveLiquidityAmountAndFee2Params.

FieldType
lp_amount_inu64

IncreasePosition4Params#

Struct types::IncreasePosition4Params.

No fields.

IncreasePositionEvent#

Struct types::IncreasePositionEvent. Same fields as the IncreasePositionEvent event.

IncreasePositionPreSwapEvent#

Struct types::IncreasePositionPreSwapEvent. Same fields as the IncreasePositionPreSwapEvent event.

IncreasePositionPreSwapParams#

Struct types::IncreasePositionPreSwapParams.

No fields.

IncreasePositionWithInternalSwapParams#

Struct types::IncreasePositionWithInternalSwapParams.

No fields.

InitParams#

Struct types::InitParams.

FieldType
allow_swapbool
allow_add_liquiditybool
allow_remove_liquiditybool
allow_increase_positionbool
allow_decrease_positionbool
allow_collateral_withdrawalbool
allow_liquidate_positionbool

InstantCreateLimitOrderEvent#

Struct types::InstantCreateLimitOrderEvent. Same fields as the InstantCreateLimitOrderEvent event.

InstantCreateLimitOrderParams#

Struct types::InstantCreateLimitOrderParams.

FieldType
size_usd_deltau64
collateral_token_deltau64
sideSide
trigger_priceu64
trigger_above_thresholdbool
counteru64
request_timei64

InstantCreateTpslEvent#

Struct types::InstantCreateTpslEvent. Same fields as the InstantCreateTpslEvent event.

InstantCreateTpslParams#

Struct types::InstantCreateTpslParams.

FieldType
collateral_usd_deltau64
size_usd_deltau64
trigger_priceu64
trigger_above_thresholdbool
entire_positionbool
counteru64
request_timei64

InstantDecreasePosition2Params#

Struct types::InstantDecreasePosition2Params.

FieldType
collateral_usd_deltau64
size_usd_deltau64
price_slippageu64
entire_positionOption<bool>
request_timei64
counteru64

InstantDecreasePositionEvent#

Struct types::InstantDecreasePositionEvent. Same fields as the InstantDecreasePositionEvent event.

InstantDecreasePositionParams#

Struct types::InstantDecreasePositionParams.

FieldType
collateral_usd_deltau64
size_usd_deltau64
price_slippageu64
entire_positionOption<bool>
request_timei64

InstantIncreasePositionEvent#

Struct types::InstantIncreasePositionEvent. Same fields as the InstantIncreasePositionEvent event.

InstantIncreasePositionParams#

Struct types::InstantIncreasePositionParams.

FieldType
size_usd_deltau64
collateral_token_deltaOption<u64>
sideSide
price_slippageu64
request_timei64

InstantIncreasePositionPreSwapParams#

Struct types::InstantIncreasePositionPreSwapParams.

FieldType
amount_inu64
min_amount_outu64

InstantUpdateLimitOrderParams#

Struct types::InstantUpdateLimitOrderParams.

FieldType
size_usd_deltau64
trigger_priceu64
request_timei64

InstantUpdateTpslEvent#

Struct types::InstantUpdateTpslEvent. Same fields as the InstantUpdateTpslEvent event.

InstantUpdateTpslParams#

Struct types::InstantUpdateTpslParams.

FieldType
size_usd_deltau64
trigger_priceu64
request_timei64

JumpRateState#

Struct types::JumpRateState.

FieldType
min_rate_bpsu64
max_rate_bpsu64
target_rate_bpsu64
target_utilization_rateu64

Limit#

Struct types::Limit.

FieldType
max_aum_usdu128
token_weightage_buffer_bpsu128
bufferu64

LiquidateBorrowPositionEvent#

Struct types::LiquidateBorrowPositionEvent. Same fields as the LiquidateBorrowPositionEvent event.

LiquidateBorrowPositionParams#

Struct types::LiquidateBorrowPositionParams.

No fields.

LiquidateFullPosition4Params#

Struct types::LiquidateFullPosition4Params.

No fields.

LiquidateFullPositionEvent#

Struct types::LiquidateFullPositionEvent. Same fields as the LiquidateFullPositionEvent event.

OperatorSetCustodyConfigParams#

Struct types::OperatorSetCustodyConfigParams.

FieldType
pricingPricingParams
hourly_funding_dbpsu64
target_ratio_bpsu64
increase_position_bpsu64
decrease_position_bpsu64
max_position_size_usdu64
jump_rateJumpRateState
price_impact_fee_factoru64
price_impact_exponentf32
delta_imbalance_threshold_decimalu64
max_fee_bpsu64
borrow_lend_parametersBorrowLendParams
borrow_hourly_funding_dbpsu64
borrow_limit_in_token_amountu64
min_interest_fee_bpsu64
min_interest_fee_grace_period_secondsu64
max_total_staked_amount_lamportsu64
external_swap_fee_multiplier_bpsu64
disable_close_position_requestbool
withdrawal_limit_token_amountu64
withdrawal_limit_interval_secondsu64

OperatorSetPoolConfigParams#

Struct types::OperatorSetPoolConfigParams.

FieldType
feesFees
limitLimit
max_request_execution_seci64
max_trigger_price_diff_bpsu64
disable_close_position_requestbool
max_lp_token_price_change_bpsu64

OracleParams#

Struct types::OracleParams.

FieldType
oracle_accountPubkey
oracle_typeOracleType
bufferu64
max_price_age_secu32

OraclePrice#

Struct types::OraclePrice.

FieldType
priceu64
exponenti32

OracleType#

Enum types::OracleType.

Variant
None
Test
Pyth

PartialLiquidateBorrowPositionParams#

Struct types::PartialLiquidateBorrowPositionParams.

No fields.

Permissions#

Struct types::Permissions.

FieldType
allow_swapbool
allow_add_liquiditybool
allow_remove_liquiditybool
allow_increase_positionbool
allow_decrease_positionbool
allow_collateral_withdrawalbool
allow_liquidate_positionbool

PoolApr#

Struct types::PoolApr.

FieldType
last_updatedi64
fee_apr_bpsu64
realized_fee_usdu64

PoolSwapEvent#

Struct types::PoolSwapEvent. Same fields as the PoolSwapEvent event.

PoolSwapExactOutEvent#

Struct types::PoolSwapExactOutEvent. Same fields as the PoolSwapExactOutEvent event.

Price#

Struct types::Price.

FieldType
priceu64
expoi32
publish_timei64

PriceCalcMode#

Enum types::PriceCalcMode.

Variant
Min
Max
Ignore

PriceImpactBuffer#

Struct types::PriceImpactBuffer.

FieldType
open_interest[i64; 60]
last_updatedi64
fee_factoru64
exponentf32
delta_imbalance_threshold_decimalu64
max_fee_bpsu64

PriceImpactMechanism#

Enum types::PriceImpactMechanism.

Variant
TradeSize
DeltaImbalance

PriceStaleTolerance#

Enum types::PriceStaleTolerance.

Variant
Strict
Loose

PricingParams#

Struct types::PricingParams.

FieldType
trade_impact_fee_scalaru64
bufferu64
swap_spreadu64
max_leverageu64
max_global_long_sizesu64
max_global_short_sizesu64

RedeemStakeEvent#

Struct types::RedeemStakeEvent. Same fields as the RedeemStakeEvent event.

RefreshAssetsUnderManagementParams#

Struct types::RefreshAssetsUnderManagementParams.

No fields.

RemoveLiquidity2Params#

Struct types::RemoveLiquidity2Params.

FieldType
lp_amount_inu64
min_amount_outu64

RemoveLiquidityEvent#

Struct types::RemoveLiquidityEvent. Same fields as the RemoveLiquidityEvent event.

RepayToCustodyEvent#

Struct types::RepayToCustodyEvent. Same fields as the RepayToCustodyEvent event.

RepayToCustodyParams#

Struct types::RepayToCustodyParams.

FieldType
amountu64

RequestChange#

Enum types::RequestChange.

Variant
None
Increase
Decrease

RequestType#

Enum types::RequestType.

Variant
Market
Trigger

Secp256k1Pubkey#

Struct types::Secp256k1Pubkey.

FieldType
prefixu8
key[u8; 32]

SetCustodyConfigParams#

Struct types::SetCustodyConfigParams.

FieldType
oracleOracleParams
pricingPricingParams
permissionsPermissions
hourly_funding_dbpsu64
target_ratio_bpsu64
increase_position_bpsu64
decrease_position_bpsu64
doves_oraclePubkey
max_position_size_usdu64
jump_rateJumpRateState
price_impact_fee_factoru64
price_impact_exponentf32
delta_imbalance_threshold_decimalu64
max_fee_bpsu64
doves_ag_oraclePubkey
borrow_lend_parametersBorrowLendParams
borrow_hourly_funding_dbpsu64
borrow_limit_in_token_amountu64
min_interest_fee_bpsu64
min_interest_fee_grace_period_secondsu64
max_total_staked_amount_lamportsu64
external_swap_fee_multiplier_bpsu64
disable_close_position_requestbool
withdrawal_limit_interval_secondsu64
withdrawal_limit_token_amountu64

SetMaxGlobalSizesParams#

Struct types::SetMaxGlobalSizesParams.

FieldType
max_global_long_sizeu64
max_global_short_sizeu64
recovery_idu8
signature[u8; 64]
reference_id[u8; 16]
timestampu64

SetPerpetualsConfigParams#

Struct types::SetPerpetualsConfigParams.

FieldType
permissionsPermissions

SetPoolConfigParams#

Struct types::SetPoolConfigParams.

FieldType
feesFees
limitLimit
max_request_execution_seci64
parameter_update_oracleSecp256k1Pubkey
max_trigger_price_diff_bpsu64
disable_close_position_requestbool
max_lp_token_price_change_bpsu64

SetTestTimeParams#

Struct types::SetTestTimeParams.

FieldType
timei64

Side#

Enum types::Side.

Variant
None
Long
Short

Swap2Params#

Struct types::Swap2Params.

FieldType
amount_inu64
min_amount_outu64

SwapWithTokenLedgerParams#

Struct types::SwapWithTokenLedgerParams.

FieldType
min_amount_outu64

TestInitParams#

Struct types::TestInitParams.

FieldType
allow_swapbool
allow_add_liquiditybool
allow_remove_liquiditybool
allow_increase_positionbool
allow_decrease_positionbool
allow_collateral_withdrawalbool
allow_liquidate_positionbool

TradePoolType#

Enum types::TradePoolType.

Variant
Increase
Decrease

TransferAdminParams#

Struct types::TransferAdminParams.

No fields.

UpdateDecreasePositionRequest2Params#

Struct types::UpdateDecreasePositionRequest2Params.

FieldType
size_usd_deltau64
trigger_priceu64

WithdrawCollateralEvent#

Struct types::WithdrawCollateralEvent. Same fields as the WithdrawCollateralEvent event.

WithdrawFees2Params#

Struct types::WithdrawFees2Params.

No fields.

WithdrawFeesEvent#

Struct types::WithdrawFeesEvent. Same fields as the WithdrawFeesEvent event.

WithdrawParams#

Struct types::WithdrawParams.

FieldType
amountu64

WithdrawStakeEvent#

Struct types::WithdrawStakeEvent. Same fields as the WithdrawStakeEvent event.

Generated from the crate’s source at Carbon v2.0.0, so it always matches the published code. Spotted a problem? Report it; edits to this page itself are overwritten on the next release.

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.