Drift v2 decoder

Decode Drift v2 instructions, accounts and events in Rust with carbon-drift-v2-decoder 2.0.0. Program ID dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH.

On this page

carbon-drift-v2-decoder decodes the instructions, accounts and events of the Drift v2 program (dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH): 249 instructions, 27 account types, 26 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-drift-v2-decoder 2.0.0
Installcargo add carbon-drift-v2-decoder@2.0.0
Program IDdRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH (carbon_drift_v2_decoder::PROGRAM_ID)
CategoryPerpetuals & derivatives
Decodercarbon_drift_v2_decoder::DriftV2Decoder
Instruction enuminstructions::DriftV2Instruction
Account enumaccounts::DriftV2Account
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-drift-v2-decoder/2.0.0
Sourcedecoders/drift-v2-decoder

Other perpetuals and derivatives decoders: Jupiter Perpetuals, 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 Drift v2 transactions from the public RPC and prints every decoded PlaceAndTakePerpOrder instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-drift-v2-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_drift_v2_decoder::{instructions::DriftV2Instruction, DriftV2Decoder, 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(DriftV2Decoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

Each PlaceAndTakePerpOrder instruction prints one line with the transaction signature and the decoded PlaceAndTakePerpOrder 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 DriftV2Instruction::CpiEvent { data: CpiEvent::NewUserRecord(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 PerpMarket 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_drift_v2_decoder::{accounts::DriftV2Account, DriftV2Decoder, 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(DriftV2Decoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

Each update to a PerpMarket 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 DriftV2Instruction. Each is DriftV2Instruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_drift_v2_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 dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH.
  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.

AddAmmConstituentMappingData#

Discriminator a4ec822876b32eeb · data AddAmmConstituentMappingData · accounts AddAmmConstituentMappingDataInstructionAccounts.

FieldType
amm_constituent_mapping_dataVec<AddAmmConstituentMappingDatum>

Required accounts: 6; extras go to remaining.

Fields of AddAmmConstituentMappingDataInstructionAccounts, in account order:

#FieldType
0adminPubkey
1lp_poolPubkey
2amm_constituent_mappingPubkey
3constituent_target_basePubkey
4statePubkey
5system_programPubkey
6…remainingVec<AccountMeta>

AddInsuranceFundStake#

Discriminator fb90730bde2f3eec · data AddInsuranceFundStake · accounts AddInsuranceFundStakeInstructionAccounts.

FieldType
market_indexu16
amountu64

Required accounts: 10; extras go to remaining.

Fields of AddInsuranceFundStakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2insurance_fund_stakePubkey
3user_statsPubkey
4authorityPubkey
5spot_market_vaultPubkey
6insurance_fund_vaultPubkey
7drift_signerPubkey
8user_token_accountPubkey
9token_programPubkey
10…remainingVec<AccountMeta>

AddMarketToAmmCache#

Discriminator 7095c3de7c0757ed · data AddMarketToAmmCache · accounts AddMarketToAmmCacheInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of AddMarketToAmmCacheInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2amm_cachePubkey
3perp_marketPubkey
4rentPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

AdminDeposit#

Discriminator d24241b666d6b01e · data AdminDeposit · accounts AdminDepositInstructionAccounts.

FieldType
market_indexu16
amountu64

Required accounts: 6; extras go to remaining.

Fields of AdminDepositInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2adminPubkey
3spot_market_vaultPubkey
4admin_token_accountPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

AdminUpdateUserStatsPausedOperations#

Discriminator b7683f96f0c7030a · data AdminUpdateUserStatsPausedOperations · accounts AdminUpdateUserStatsPausedOperationsInstructionAccounts.

FieldType
paused_operationsu8

Required accounts: 3; extras go to remaining.

Fields of AdminUpdateUserStatsPausedOperationsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2user_statsPubkey
3…remainingVec<AccountMeta>

AdminWithdrawFromInsuranceFundVault#

Discriminator e4d0bff6a93abdd5 · data AdminWithdrawFromInsuranceFundVault · accounts AdminWithdrawFromInsuranceFundVaultInstructionAccounts.

FieldType
market_indexu16
amountu64

Required accounts: 7; extras go to remaining.

Fields of AdminWithdrawFromInsuranceFundVaultInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2spot_marketPubkey
3insurance_fund_vaultPubkey
4recipient_token_accountPubkey
5token_programPubkey
6drift_signerPubkey
7…remainingVec<AccountMeta>

BeginInsuranceFundSwap#

Discriminator b0458fcd2084a300 · data BeginInsuranceFundSwap · accounts BeginInsuranceFundSwapInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16
amount_inu64

Required accounts: 10; extras go to remaining.

Fields of BeginInsuranceFundSwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2out_insurance_fund_vaultPubkey
3in_insurance_fund_vaultPubkey
4out_token_accountPubkey
5in_token_accountPubkey
6if_rebalance_configPubkey
7token_programPubkey
8drift_signerPubkey
9instructionsPubkey
10…remainingVec<AccountMeta>

BeginLpSwap#

Discriminator 402c18c7307d435b · data BeginLpSwap · accounts BeginLpSwapInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16
amount_inu64

Required accounts: 11; extras go to remaining.

Fields of BeginLpSwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2signer_out_token_accountPubkey
3signer_in_token_accountPubkey
4constituent_out_token_accountPubkey
5constituent_in_token_accountPubkey
6out_constituentPubkey
7in_constituentPubkey
8lp_poolPubkey
9instructionsPubkey
10token_programPubkey
11…remainingVec<AccountMeta>

BeginSwap#

Discriminator ae6de401f269e869 · data BeginSwap · accounts BeginSwapInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16
amount_inu64

Required accounts: 11; extras go to remaining.

Fields of BeginSwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4out_spot_market_vaultPubkey
5in_spot_market_vaultPubkey
6out_token_accountPubkey
7in_token_accountPubkey
8token_programPubkey
9drift_signerPubkey
10instructionsPubkey
11…remainingVec<AccountMeta>

CancelOrder#

Discriminator 5f81edf00831df84 · data CancelOrder · accounts CancelOrderInstructionAccounts.

FieldType
order_idOption<u32>

Required accounts: 3; extras go to remaining.

Fields of CancelOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

CancelOrderByUserId#

Discriminator 6bd3fa8512253964 · data CancelOrderByUserId · accounts CancelOrderByUserIdInstructionAccounts.

FieldType
user_order_idu8

Required accounts: 3; extras go to remaining.

Fields of CancelOrderByUserIdInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

CancelOrders#

Discriminator eee15f9ee36708c2 · data CancelOrders · accounts CancelOrdersInstructionAccounts.

FieldType
market_typeOption<MarketType>
market_indexOption<u16>
directionOption<PositionDirection>

Required accounts: 3; extras go to remaining.

Fields of CancelOrdersInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

CancelOrdersByIds#

Discriminator 861390a55ef0d25e · data CancelOrdersByIds · accounts CancelOrdersByIdsInstructionAccounts.

FieldType
order_idsVec<u32>

Required accounts: 3; extras go to remaining.

Fields of CancelOrdersByIdsInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

CancelRequestRemoveInsuranceFundStake#

Discriminator 61eb4e3ed42af17f · data CancelRequestRemoveInsuranceFundStake · accounts CancelRequestRemoveInsuranceFundStakeInstructionAccounts.

FieldType
market_indexu16

Required accounts: 5; extras go to remaining.

Fields of CancelRequestRemoveInsuranceFundStakeInstructionAccounts, in account order:

#FieldType
0spot_marketPubkey
1insurance_fund_stakePubkey
2user_statsPubkey
3authorityPubkey
4insurance_fund_vaultPubkey
5…remainingVec<AccountMeta>

ChangeApprovedBuilder#

Discriminator b386d32dc305bdad · data ChangeApprovedBuilder · accounts ChangeApprovedBuilderInstructionAccounts.

FieldType
builderPubkey
max_fee_bpsu16
addbool

Required accounts: 4; extras go to remaining.

Fields of ChangeApprovedBuilderInstructionAccounts, in account order:

#FieldType
0escrowPubkey
1authorityPubkey
2payerPubkey
3system_programPubkey
4…remainingVec<AccountMeta>

ChangeSignedMsgWsDelegateStatus#

Discriminator fccafcdbb31b548a · data ChangeSignedMsgWsDelegateStatus · accounts ChangeSignedMsgWsDelegateStatusInstructionAccounts.

FieldType
delegatePubkey
addbool

Required accounts: 3; extras go to remaining.

Fields of ChangeSignedMsgWsDelegateStatusInstructionAccounts, in account order:

#FieldType
0signed_msg_ws_delegatesPubkey
1authorityPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

DeleteAmmCache#

Discriminator d882d7cee9e8bf58 · data DeleteAmmCache · accounts DeleteAmmCacheInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of DeleteAmmCacheInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2amm_cachePubkey
3…remainingVec<AccountMeta>

DeleteInitializedPerpMarket#

Discriminator 5b9a18576a3bbe42 · data DeleteInitializedPerpMarket · accounts DeleteInitializedPerpMarketInstructionAccounts.

FieldType
market_indexu16

Required accounts: 3; extras go to remaining.

Fields of DeleteInitializedPerpMarketInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

DeleteInitializedSpotMarket#

Discriminator 1f8c43bfbd1465dd · data DeleteInitializedSpotMarket · accounts DeleteInitializedSpotMarketInstructionAccounts.

FieldType
market_indexu16

Required accounts: 7; extras go to remaining.

Fields of DeleteInitializedSpotMarketInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3spot_market_vaultPubkey
4insurance_fund_vaultPubkey
5drift_signerPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

DeleteOpenbookV2FulfillmentConfig#

Discriminator 12c68a8e8a304fbb · data DeleteOpenbookV2FulfillmentConfig · accounts DeleteOpenbookV2FulfillmentConfigInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of DeleteOpenbookV2FulfillmentConfigInstructionAccounts, in account order:

#FieldType
0statePubkey
1openbook_v2_fulfillment_configPubkey
2adminPubkey
3…remainingVec<AccountMeta>

DeletePrelaunchOracle#

Discriminator 3ba964314511adfd · data DeletePrelaunchOracle · accounts DeletePrelaunchOracleInstructionAccounts.

FieldType
perp_market_indexu16

Required accounts: 4; extras go to remaining.

Fields of DeletePrelaunchOracleInstructionAccounts, in account order:

#FieldType
0adminPubkey
1prelaunch_oraclePubkey
2perp_marketPubkey
3statePubkey
4…remainingVec<AccountMeta>

DeleteSerumFulfillmentConfig#

Discriminator 1e8f5830f9679aff · data DeleteSerumFulfillmentConfig · accounts DeleteSerumFulfillmentConfigInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of DeleteSerumFulfillmentConfigInstructionAccounts, in account order:

#FieldType
0statePubkey
1serum_fulfillment_configPubkey
2adminPubkey
3…remainingVec<AccountMeta>

DeleteSignedMsgUserOrders#

Discriminator ddf780fdd4fe2e99 · data DeleteSignedMsgUserOrders · accounts DeleteSignedMsgUserOrdersInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of DeleteSignedMsgUserOrdersInstructionAccounts, in account order:

#FieldType
0signed_msg_user_ordersPubkey
1statePubkey
2authorityPubkey
3…remainingVec<AccountMeta>

DeleteUser#

Discriminator ba5511f9dbe762fb · data DeleteUser · accounts DeleteUserInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of DeleteUserInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_statsPubkey
2statePubkey
3authorityPubkey
4…remainingVec<AccountMeta>

Deposit#

Discriminator f223c68952e1f2b6 · data Deposit · accounts DepositInstructionAccounts.

FieldType
market_indexu16
amountu64
reduce_onlybool

Required accounts: 7; extras go to remaining.

Fields of DepositInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4spot_market_vaultPubkey
5user_token_accountPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

DepositIntoInsuranceFundStake#

Discriminator 0416e2c97c2c52e6 · data DepositIntoInsuranceFundStake · accounts DepositIntoInsuranceFundStakeInstructionAccounts.

FieldType
market_indexu16
amountu64

Required accounts: 10; extras go to remaining.

Fields of DepositIntoInsuranceFundStakeInstructionAccounts, in account order:

#FieldType
0signerPubkey
1statePubkey
2spot_marketPubkey
3insurance_fund_stakePubkey
4user_statsPubkey
5spot_market_vaultPubkey
6insurance_fund_vaultPubkey
7user_token_accountPubkey
8token_programPubkey
9drift_signerPubkey
10…remainingVec<AccountMeta>

DepositIntoIsolatedPerpPosition#

Discriminator 6530ff997f79aa1a · data DepositIntoIsolatedPerpPosition · accounts DepositIntoIsolatedPerpPositionInstructionAccounts.

FieldType
spot_market_indexu16
perp_market_indexu16
amountu64

Required accounts: 7; extras go to remaining.

Fields of DepositIntoIsolatedPerpPositionInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4spot_market_vaultPubkey
5user_token_accountPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

DepositIntoPerpMarketFeePool#

Discriminator 223a39446150f406 · data DepositIntoPerpMarketFeePool · accounts DepositIntoPerpMarketFeePoolInstructionAccounts.

FieldType
amountu64

Required accounts: 8; extras go to remaining.

Fields of DepositIntoPerpMarketFeePoolInstructionAccounts, in account order:

#FieldType
0statePubkey
1perp_marketPubkey
2adminPubkey
3source_vaultPubkey
4drift_signerPubkey
5quote_spot_marketPubkey
6spot_market_vaultPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

DepositIntoSpotMarketRevenuePool#

Discriminator 5c28972a7afe8bf6 · data DepositIntoSpotMarketRevenuePool · accounts DepositIntoSpotMarketRevenuePoolInstructionAccounts.

FieldType
amountu64

Required accounts: 6; extras go to remaining.

Fields of DepositIntoSpotMarketRevenuePoolInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2authorityPubkey
3spot_market_vaultPubkey
4user_token_accountPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

DepositIntoSpotMarketVault#

Discriminator 30fc7749ffcdaef7 · data DepositIntoSpotMarketVault · accounts DepositIntoSpotMarketVaultInstructionAccounts.

FieldType
amountu64

Required accounts: 6; extras go to remaining.

Fields of DepositIntoSpotMarketVaultInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2adminPubkey
3source_vaultPubkey
4spot_market_vaultPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

DepositToProgramVault#

Discriminator ebab795039ef93dc · data DepositToProgramVault · accounts DepositToProgramVaultInstructionAccounts.

FieldType
amountu64

Required accounts: 9; extras go to remaining.

Fields of DepositToProgramVaultInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2constituentPubkey
3constituent_token_accountPubkey
4spot_marketPubkey
5spot_market_vaultPubkey
6token_programPubkey
7mintPubkey
8oraclePubkey
9…remainingVec<AccountMeta>

DisableUserHighLeverageMode#

Discriminator b79b2d00e255d545 · data DisableUserHighLeverageMode · accounts DisableUserHighLeverageModeInstructionAccounts.

FieldType
disable_maintenancebool

Required accounts: 4; extras go to remaining.

Fields of DisableUserHighLeverageModeInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2userPubkey
3high_leverage_mode_configPubkey
4…remainingVec<AccountMeta>

EnableUserHighLeverageMode#

Discriminator e718e670c9ad49b8 · data EnableUserHighLeverageMode · accounts EnableUserHighLeverageModeInstructionAccounts.

FieldType
sub_account_idu16

Required accounts: 4; extras go to remaining.

Fields of EnableUserHighLeverageModeInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3high_leverage_mode_configPubkey
4…remainingVec<AccountMeta>

EndInsuranceFundSwap#

Discriminator cee66208f99ea9a7 · data EndInsuranceFundSwap · accounts EndInsuranceFundSwapInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16

Required accounts: 10; extras go to remaining.

Fields of EndInsuranceFundSwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2out_insurance_fund_vaultPubkey
3in_insurance_fund_vaultPubkey
4out_token_accountPubkey
5in_token_accountPubkey
6if_rebalance_configPubkey
7token_programPubkey
8drift_signerPubkey
9instructionsPubkey
10…remainingVec<AccountMeta>

EndLpSwap#

Discriminator 637dd6a581affd87 · data EndLpSwap · accounts EndLpSwapInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16

Required accounts: 11; extras go to remaining.

Fields of EndLpSwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2signer_out_token_accountPubkey
3signer_in_token_accountPubkey
4constituent_out_token_accountPubkey
5constituent_in_token_accountPubkey
6out_constituentPubkey
7in_constituentPubkey
8lp_poolPubkey
9instructionsPubkey
10token_programPubkey
11…remainingVec<AccountMeta>

EndSwap#

Discriminator b1b81bc1220dd291 · data EndSwap · accounts EndSwapInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16
limit_priceOption<u64>
reduce_onlyOption<SwapReduceOnly>

Required accounts: 11; extras go to remaining.

Fields of EndSwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4out_spot_market_vaultPubkey
5in_spot_market_vaultPubkey
6out_token_accountPubkey
7in_token_accountPubkey
8token_programPubkey
9drift_signerPubkey
10instructionsPubkey
11…remainingVec<AccountMeta>

FillPerpOrder#

Discriminator 0dbcf86786d96af0 · data FillPerpOrder · accounts FillPerpOrderInstructionAccounts.

FieldType
order_idOption<u32>
maker_order_idOption<u32>

Required accounts: 6; extras go to remaining.

Fields of FillPerpOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2fillerPubkey
3filler_statsPubkey
4userPubkey
5user_statsPubkey
6…remainingVec<AccountMeta>

FillSpotOrder#

Discriminator d4ce82ad1522c728 · data FillSpotOrder · accounts FillSpotOrderInstructionAccounts.

FieldType
order_idOption<u32>
fulfillment_typeOption<SpotFulfillmentType>
maker_order_idOption<u32>

Required accounts: 6; extras go to remaining.

Fields of FillSpotOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2fillerPubkey
3filler_statsPubkey
4userPubkey
5user_statsPubkey
6…remainingVec<AccountMeta>

ForceCancelOrders#

Discriminator 40b5c43fde4840e8 · data ForceCancelOrders · accounts ForceCancelOrdersInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of ForceCancelOrdersInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2fillerPubkey
3userPubkey
4…remainingVec<AccountMeta>

ForceDeleteUser#

Discriminator 02f1c3ace318fe9e · data ForceDeleteUser · accounts ForceDeleteUserInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of ForceDeleteUserInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_statsPubkey
2statePubkey
3authorityPubkey
4keeperPubkey
5drift_signerPubkey
6…remainingVec<AccountMeta>

Initialize#

Discriminator afaf6d1f0d989bed · data Initialize · accounts InitializeInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of InitializeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2quote_asset_mintPubkey
3drift_signerPubkey
4rentPubkey
5system_programPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

InitializeAmmCache#

Discriminator 263cab9ecb3a8908 · data InitializeAmmCache · accounts InitializeAmmCacheInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of InitializeAmmCacheInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2amm_cachePubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializeConstituent#

Discriminator 0cc42dda5d590021 · data InitializeConstituent · accounts InitializeConstituentInstructionAccounts.

FieldType
spot_market_indexu16
decimalsu8
max_weight_deviationi64
swap_fee_mini64
swap_fee_maxi64
max_borrow_token_amountu64
oracle_staleness_thresholdu64
cost_to_tradei32
constituent_derivative_indexOption<i16>
constituent_derivative_depeg_thresholdu64
derivative_weightu64
volatilityu64
gamma_executionu8
gamma_inventoryu8
xiu8
new_constituent_correlationsVec<i64>

Required accounts: 12; extras go to remaining.

Fields of InitializeConstituentInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2lp_poolPubkey
3constituent_target_basePubkey
4constituent_correlationsPubkey
5constituentPubkey
6spot_marketPubkey
7spot_market_mintPubkey
8constituent_vaultPubkey
9rentPubkey
10system_programPubkey
11token_programPubkey
12…remainingVec<AccountMeta>

InitializeFuelOverflow#

Discriminator 58df84a1d0588e2a · data InitializeFuelOverflow · accounts InitializeFuelOverflowInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of InitializeFuelOverflowInstructionAccounts, in account order:

#FieldType
0fuel_overflowPubkey
1user_statsPubkey
2authorityPubkey
3payerPubkey
4rentPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

InitializeHighLeverageModeConfig#

Discriminator d5a75df6d0825af8 · data InitializeHighLeverageModeConfig · accounts InitializeHighLeverageModeConfigInstructionAccounts.

FieldType
max_usersu32

Required accounts: 5; extras go to remaining.

Fields of InitializeHighLeverageModeConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1high_leverage_mode_configPubkey
2statePubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializeIfRebalanceConfig#

Discriminator 0855b8a7b03dade2 · data InitializeIfRebalanceConfig · accounts InitializeIfRebalanceConfigInstructionAccounts.

Required accounts: 5; extras go to remaining.

Fields of InitializeIfRebalanceConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1if_rebalance_configPubkey
2statePubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializeInsuranceFundStake#

Discriminator bbb3f346f85a5c93 · data InitializeInsuranceFundStake · accounts InitializeInsuranceFundStakeInstructionAccounts.

FieldType
market_indexu16

Required accounts: 8; extras go to remaining.

Fields of InitializeInsuranceFundStakeInstructionAccounts, in account order:

#FieldType
0spot_marketPubkey
1insurance_fund_stakePubkey
2user_statsPubkey
3statePubkey
4authorityPubkey
5payerPubkey
6rentPubkey
7system_programPubkey
8…remainingVec<AccountMeta>

InitializeLpPool#

Discriminator f24001de8e2ecce3 · data InitializeLpPool · accounts InitializeLpPoolInstructionAccounts.

FieldType
lp_pool_idu8
min_mint_feei64
max_aumu128
max_settle_quote_amount_per_marketu64
whitelist_mintPubkey

Required accounts: 11; extras go to remaining.

Fields of InitializeLpPoolInstructionAccounts, in account order:

#FieldType
0adminPubkey
1lp_poolPubkey
2mintPubkey
3lp_pool_token_vaultPubkey
4amm_constituent_mappingPubkey
5constituent_target_basePubkey
6constituent_correlationsPubkey
7statePubkey
8token_programPubkey
9rentPubkey
10system_programPubkey
11…remainingVec<AccountMeta>

InitializeOpenbookV2FulfillmentConfig#

Discriminator 07dd67996b391bc5 · data InitializeOpenbookV2FulfillmentConfig · accounts InitializeOpenbookV2FulfillmentConfigInstructionAccounts.

FieldType
market_indexu16

Required accounts: 10; extras go to remaining.

Fields of InitializeOpenbookV2FulfillmentConfigInstructionAccounts, in account order:

#FieldType
0base_spot_marketPubkey
1quote_spot_marketPubkey
2statePubkey
3openbook_v2_programPubkey
4openbook_v2_marketPubkey
5drift_signerPubkey
6openbook_v2_fulfillment_configPubkey
7adminPubkey
8rentPubkey
9system_programPubkey
10…remainingVec<AccountMeta>

InitializePerpMarket#

Discriminator 8409e5767576753e · data InitializePerpMarket · accounts InitializePerpMarketInstructionAccounts.

FieldType
market_indexu16
amm_base_asset_reserveu128
amm_quote_asset_reserveu128
amm_periodicityi64
amm_peg_multiplieru128
oracle_sourceOracleSource
contract_tierContractTier
margin_ratio_initialu32
margin_ratio_maintenanceu32
liquidator_feeu32
if_liquidation_feeu32
imf_factoru32
active_statusbool
base_spreadu32
max_spreadu32
max_open_interestu128
max_revenue_withdraw_per_periodu64
quote_max_insuranceu64
order_step_sizeu64
order_tick_sizeu64
min_order_sizeu64
concentration_coef_scaleu128
curve_update_intensityu8
amm_jit_intensityu8
name[u8; 32]
lp_pool_idu8

Required accounts: 6; extras go to remaining.

Fields of InitializePerpMarketInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3oraclePubkey
4rentPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

InitializePhoenixFulfillmentConfig#

Discriminator 87846e6bb9a0a99a · data InitializePhoenixFulfillmentConfig · accounts InitializePhoenixFulfillmentConfigInstructionAccounts.

FieldType
market_indexu16

Required accounts: 10; extras go to remaining.

Fields of InitializePhoenixFulfillmentConfigInstructionAccounts, in account order:

#FieldType
0base_spot_marketPubkey
1quote_spot_marketPubkey
2statePubkey
3phoenix_programPubkey
4phoenix_marketPubkey
5drift_signerPubkey
6phoenix_fulfillment_configPubkey
7adminPubkey
8rentPubkey
9system_programPubkey
10…remainingVec<AccountMeta>

InitializePredictionMarket#

Discriminator f846c6e0e0697dc3 · data InitializePredictionMarket · accounts InitializePredictionMarketInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of InitializePredictionMarketInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

InitializePrelaunchOracle#

Discriminator a9b25419af3e1df7 · data InitializePrelaunchOracle · accounts InitializePrelaunchOracleInstructionAccounts.

FieldType
paramsPrelaunchOracleParams

Required accounts: 5; extras go to remaining.

Fields of InitializePrelaunchOracleInstructionAccounts, in account order:

#FieldType
0adminPubkey
1prelaunch_oraclePubkey
2statePubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializeProtectedMakerModeConfig#

Discriminator 4367dc435820fc08 · data InitializeProtectedMakerModeConfig · accounts InitializeProtectedMakerModeConfigInstructionAccounts.

FieldType
max_usersu32

Required accounts: 5; extras go to remaining.

Fields of InitializeProtectedMakerModeConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1protected_maker_mode_configPubkey
2statePubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializePythLazerOracle#

Discriminator 8c6b21d6ebdb6714 · data InitializePythLazerOracle · accounts InitializePythLazerOracleInstructionAccounts.

FieldType
feed_idu32

Required accounts: 5; extras go to remaining.

Fields of InitializePythLazerOracleInstructionAccounts, in account order:

#FieldType
0adminPubkey
1lazer_oraclePubkey
2statePubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializePythPullOracle#

Discriminator f98cfdf3f84af0ee · data InitializePythPullOracle · accounts InitializePythPullOracleInstructionAccounts.

FieldType
feed_id[u8; 32]

Required accounts: 5; extras go to remaining.

Fields of InitializePythPullOracleInstructionAccounts, in account order:

#FieldType
0adminPubkey
1pyth_solana_receiverPubkey
2price_feedPubkey
3system_programPubkey
4statePubkey
5…remainingVec<AccountMeta>

InitializeReferrerName#

Discriminator eb7ee70a2aa41a3d · data InitializeReferrerName · accounts InitializeReferrerNameInstructionAccounts.

FieldType
name[u8; 32]

Required accounts: 7; extras go to remaining.

Fields of InitializeReferrerNameInstructionAccounts, in account order:

#FieldType
0referrer_namePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4payerPubkey
5rentPubkey
6system_programPubkey
7…remainingVec<AccountMeta>

InitializeRevenueShare#

Discriminator 39097b835234320d · data InitializeRevenueShare · accounts InitializeRevenueShareInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of InitializeRevenueShareInstructionAccounts, in account order:

#FieldType
0revenue_sharePubkey
1authorityPubkey
2payerPubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializeRevenueShareEscrow#

Discriminator bb127b58ee68549a · data InitializeRevenueShareEscrow · accounts InitializeRevenueShareEscrowInstructionAccounts.

FieldType
num_ordersu16

Required accounts: 7; extras go to remaining.

Fields of InitializeRevenueShareEscrowInstructionAccounts, in account order:

#FieldType
0escrowPubkey
1authorityPubkey
2user_statsPubkey
3statePubkey
4payerPubkey
5rentPubkey
6system_programPubkey
7…remainingVec<AccountMeta>

InitializeSerumFulfillmentConfig#

Discriminator c1d384ac46ab075e · data InitializeSerumFulfillmentConfig · accounts InitializeSerumFulfillmentConfigInstructionAccounts.

FieldType
market_indexu16

Required accounts: 11; extras go to remaining.

Fields of InitializeSerumFulfillmentConfigInstructionAccounts, in account order:

#FieldType
0base_spot_marketPubkey
1quote_spot_marketPubkey
2statePubkey
3serum_programPubkey
4serum_marketPubkey
5serum_open_ordersPubkey
6drift_signerPubkey
7serum_fulfillment_configPubkey
8adminPubkey
9rentPubkey
10system_programPubkey
11…remainingVec<AccountMeta>

InitializeSignedMsgUserOrders#

Discriminator a4639c7e9c3963b4 · data InitializeSignedMsgUserOrders · accounts InitializeSignedMsgUserOrdersInstructionAccounts.

FieldType
num_ordersu16

Required accounts: 5; extras go to remaining.

Fields of InitializeSignedMsgUserOrdersInstructionAccounts, in account order:

#FieldType
0signed_msg_user_ordersPubkey
1authorityPubkey
2payerPubkey
3rentPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

InitializeSignedMsgWsDelegates#

Discriminator 288460dbb8c15008 · data InitializeSignedMsgWsDelegates · accounts InitializeSignedMsgWsDelegatesInstructionAccounts.

FieldType
delegatesVec<Pubkey>

Required accounts: 4; extras go to remaining.

Fields of InitializeSignedMsgWsDelegatesInstructionAccounts, in account order:

#FieldType
0signed_msg_ws_delegatesPubkey
1authorityPubkey
2rentPubkey
3system_programPubkey
4…remainingVec<AccountMeta>

InitializeSpotMarket#

Discriminator eac4802c5e0f30c9 · data InitializeSpotMarket · accounts InitializeSpotMarketInstructionAccounts.

FieldType
optimal_utilizationu32
optimal_borrow_rateu32
max_borrow_rateu32
oracle_sourceOracleSource
initial_asset_weightu32
maintenance_asset_weightu32
initial_liability_weightu32
maintenance_liability_weightu32
imf_factoru32
liquidator_feeu32
if_liquidation_feeu32
active_statusbool
asset_tierAssetTier
scale_initial_asset_weight_startu64
withdraw_guard_thresholdu64
order_tick_sizeu64
order_step_sizeu64
if_total_factoru32
name[u8; 32]

Required accounts: 11; extras go to remaining.

Fields of InitializeSpotMarketInstructionAccounts, in account order:

#FieldType
0spot_marketPubkey
1spot_market_mintPubkey
2spot_market_vaultPubkey
3insurance_fund_vaultPubkey
4drift_signerPubkey
5statePubkey
6oraclePubkey
7adminPubkey
8rentPubkey
9system_programPubkey
10token_programPubkey
11…remainingVec<AccountMeta>

InitializeUser#

Discriminator 6f11b9fa3c7a26fe · data InitializeUser · accounts InitializeUserInstructionAccounts.

FieldType
sub_account_idu16
name[u8; 32]

Required accounts: 7; extras go to remaining.

Fields of InitializeUserInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_statsPubkey
2statePubkey
3authorityPubkey
4payerPubkey
5rentPubkey
6system_programPubkey
7…remainingVec<AccountMeta>

InitializeUserStats#

Discriminator fef34862fb82a8d5 · data InitializeUserStats · accounts InitializeUserStatsInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of InitializeUserStatsInstructionAccounts, in account order:

#FieldType
0user_statsPubkey
1statePubkey
2authorityPubkey
3payerPubkey
4rentPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

LiquidateBorrowForPerpPnl#

Discriminator a911205acf94d11b · data LiquidateBorrowForPerpPnl · accounts LiquidateBorrowForPerpPnlInstructionAccounts.

FieldType
perp_market_indexu16
spot_market_indexu16
liquidator_max_liability_transferu128
limit_priceOption<u64>

Required accounts: 6; extras go to remaining.

Fields of LiquidateBorrowForPerpPnlInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6…remainingVec<AccountMeta>

LiquidatePerp#

Discriminator 4b2377f7bf128b02 · data LiquidatePerp · accounts LiquidatePerpInstructionAccounts.

FieldType
market_indexu16
liquidator_max_base_asset_amountu64
limit_priceOption<u64>

Required accounts: 6; extras go to remaining.

Fields of LiquidatePerpInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6…remainingVec<AccountMeta>

LiquidatePerpPnlForDeposit#

Discriminator ed4bc6ebe9ba4b23 · data LiquidatePerpPnlForDeposit · accounts LiquidatePerpPnlForDepositInstructionAccounts.

FieldType
perp_market_indexu16
spot_market_indexu16
liquidator_max_pnl_transferu128
limit_priceOption<u64>

Required accounts: 6; extras go to remaining.

Fields of LiquidatePerpPnlForDepositInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6…remainingVec<AccountMeta>

LiquidatePerpWithFill#

Discriminator 5f6f7c6956a9bb22 · data LiquidatePerpWithFill · accounts LiquidatePerpWithFillInstructionAccounts.

FieldType
market_indexu16

Required accounts: 6; extras go to remaining.

Fields of LiquidatePerpWithFillInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6…remainingVec<AccountMeta>

LiquidateSpot#

Discriminator 6b00802923e5fb12 · data LiquidateSpot · accounts LiquidateSpotInstructionAccounts.

FieldType
asset_market_indexu16
liability_market_indexu16
liquidator_max_liability_transferu128
limit_priceOption<u64>

Required accounts: 6; extras go to remaining.

Fields of LiquidateSpotInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6…remainingVec<AccountMeta>

LiquidateSpotWithSwapBegin#

Discriminator 0c2bb0539cfb750d · data LiquidateSpotWithSwapBegin · accounts LiquidateSpotWithSwapBeginInstructionAccounts.

FieldType
asset_market_indexu16
liability_market_indexu16
swap_amountu64

Required accounts: 13; extras go to remaining.

Fields of LiquidateSpotWithSwapBeginInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6liability_spot_market_vaultPubkey
7asset_spot_market_vaultPubkey
8liability_token_accountPubkey
9asset_token_accountPubkey
10token_programPubkey
11drift_signerPubkey
12instructionsPubkey
13…remainingVec<AccountMeta>

LiquidateSpotWithSwapEnd#

Discriminator 8e58a3a0df4b37e1 · data LiquidateSpotWithSwapEnd · accounts LiquidateSpotWithSwapEndInstructionAccounts.

FieldType
asset_market_indexu16
liability_market_indexu16

Required accounts: 13; extras go to remaining.

Fields of LiquidateSpotWithSwapEndInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6liability_spot_market_vaultPubkey
7asset_spot_market_vaultPubkey
8liability_token_accountPubkey
9asset_token_accountPubkey
10token_programPubkey
11drift_signerPubkey
12instructionsPubkey
13…remainingVec<AccountMeta>

LogUserBalances#

Discriminator a21523fb2039a1d2 · data LogUserBalances · accounts LogUserBalancesInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of LogUserBalancesInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2userPubkey
3…remainingVec<AccountMeta>

LpPoolAddLiquidity#

Discriminator 3187f6675d92dc8d · data LpPoolAddLiquidity · accounts LpPoolAddLiquidityInstructionAccounts.

FieldType
in_market_indexu16
in_amountu128
min_mint_amountu64

Required accounts: 12; extras go to remaining.

Fields of LpPoolAddLiquidityInstructionAccounts, in account order:

#FieldType
0statePubkey
1lp_poolPubkey
2authorityPubkey
3in_market_mintPubkey
4in_constituentPubkey
5user_in_token_accountPubkey
6constituent_in_token_accountPubkey
7user_lp_token_accountPubkey
8lp_mintPubkey
9constituent_target_basePubkey
10lp_pool_token_vaultPubkey
11token_programPubkey
12…remainingVec<AccountMeta>

LpPoolRemoveLiquidity#

Discriminator a424c1fcc49d8a2b · data LpPoolRemoveLiquidity · accounts LpPoolRemoveLiquidityInstructionAccounts.

FieldType
in_market_indexu16
in_amountu64
min_out_amountu128

Required accounts: 15; extras go to remaining.

Fields of LpPoolRemoveLiquidityInstructionAccounts, in account order:

#FieldType
0statePubkey
1drift_signerPubkey
2lp_poolPubkey
3authorityPubkey
4out_market_mintPubkey
5out_constituentPubkey
6user_out_token_accountPubkey
7constituent_out_token_accountPubkey
8user_lp_token_accountPubkey
9spot_market_token_accountPubkey
10lp_mintPubkey
11constituent_target_basePubkey
12lp_pool_token_vaultPubkey
13token_programPubkey
14amm_cachePubkey
15…remainingVec<AccountMeta>

LpPoolSwap#

Discriminator 24a12731e30123e2 · data LpPoolSwap · accounts LpPoolSwapInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16
in_amountu64
min_out_amountu64

Required accounts: 14; extras go to remaining.

Fields of LpPoolSwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1lp_poolPubkey
2constituent_target_basePubkey
3constituent_correlationsPubkey
4constituent_in_token_accountPubkey
5constituent_out_token_accountPubkey
6user_in_token_accountPubkey
7user_out_token_accountPubkey
8in_constituentPubkey
9out_constituentPubkey
10in_market_mintPubkey
11out_market_mintPubkey
12authorityPubkey
13token_programPubkey
14…remainingVec<AccountMeta>

ModifyOrder#

Discriminator 2f7c75ffc9c5825e · data ModifyOrder · accounts ModifyOrderInstructionAccounts.

FieldType
order_idOption<u32>
modify_order_paramsModifyOrderParams

Required accounts: 3; extras go to remaining.

Fields of ModifyOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

ModifyOrderByUserId#

Discriminator 9e4d04fdfcc2a1b3 · data ModifyOrderByUserId · accounts ModifyOrderByUserIdInstructionAccounts.

FieldType
user_order_idu8
modify_order_paramsModifyOrderParams

Required accounts: 3; extras go to remaining.

Fields of ModifyOrderByUserIdInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

MoveAmmPrice#

Discriminator eb6d0252db76069f · data MoveAmmPrice · accounts MoveAmmPriceInstructionAccounts.

FieldType
base_asset_reserveu128
quote_asset_reserveu128
sqrt_ku128

Required accounts: 3; extras go to remaining.

Fields of MoveAmmPriceInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

OpenbookV2FulfillmentConfigStatus#

Discriminator 19ad13bd04d340ee · data OpenbookV2FulfillmentConfigStatus · accounts OpenbookV2FulfillmentConfigStatusInstructionAccounts.

Required accounts: 3; extras go to remaining.

Fields of OpenbookV2FulfillmentConfigStatusInstructionAccounts, in account order:

#FieldType
0statePubkey
1openbook_v2_fulfillment_configPubkey
2adminPubkey
3…remainingVec<AccountMeta>

OverrideAmmCacheInfo#

Discriminator bdc680093191c973 · data OverrideAmmCacheInfo · accounts OverrideAmmCacheInfoInstructionAccounts.

FieldType
market_indexu16
override_paramsOverrideAmmCacheParams

Required accounts: 3; extras go to remaining.

Fields of OverrideAmmCacheInfoInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2amm_cachePubkey
3…remainingVec<AccountMeta>

PauseSpotMarketDepositWithdraw#

Discriminator b7773baa8923f256 · data PauseSpotMarketDepositWithdraw · accounts PauseSpotMarketDepositWithdrawInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of PauseSpotMarketDepositWithdrawInstructionAccounts, in account order:

#FieldType
0statePubkey
1keeperPubkey
2spot_marketPubkey
3spot_market_vaultPubkey
4…remainingVec<AccountMeta>

PhoenixFulfillmentConfigStatus#

Discriminator 601f71200ccb079a · data PhoenixFulfillmentConfigStatus · accounts PhoenixFulfillmentConfigStatusInstructionAccounts.

Required accounts: 3; extras go to remaining.

Fields of PhoenixFulfillmentConfigStatusInstructionAccounts, in account order:

#FieldType
0statePubkey
1phoenix_fulfillment_configPubkey
2adminPubkey
3…remainingVec<AccountMeta>

PlaceAndMakePerpOrder#

Discriminator 95750bed2f5f59ed · data PlaceAndMakePerpOrder · accounts PlaceAndMakePerpOrderInstructionAccounts.

FieldType
paramsOrderParams
taker_order_idu32

Required accounts: 6; extras go to remaining.

Fields of PlaceAndMakePerpOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3takerPubkey
4taker_statsPubkey
5authorityPubkey
6…remainingVec<AccountMeta>

PlaceAndMakeSignedMsgPerpOrder#

Discriminator 101a7b835e1daf62 · data PlaceAndMakeSignedMsgPerpOrder · accounts PlaceAndMakeSignedMsgPerpOrderInstructionAccounts.

FieldType
paramsOrderParams
signed_msg_order_uuid[u8; 8]

Required accounts: 7; extras go to remaining.

Fields of PlaceAndMakeSignedMsgPerpOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3takerPubkey
4taker_statsPubkey
5taker_signed_msg_user_ordersPubkey
6authorityPubkey
7…remainingVec<AccountMeta>

PlaceAndMakeSpotOrder#

Discriminator 959e5542ef09f362 · data PlaceAndMakeSpotOrder · accounts PlaceAndMakeSpotOrderInstructionAccounts.

FieldType
paramsOrderParams
taker_order_idu32
fulfillment_typeOption<SpotFulfillmentType>

Required accounts: 6; extras go to remaining.

Fields of PlaceAndMakeSpotOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3takerPubkey
4taker_statsPubkey
5authorityPubkey
6…remainingVec<AccountMeta>

PlaceAndTakePerpOrder#

Discriminator d53301bb6cdce6e0 · data PlaceAndTakePerpOrder · accounts PlaceAndTakePerpOrderInstructionAccounts.

FieldType
paramsOrderParams
success_conditionOption<u32>

Required accounts: 4; extras go to remaining.

Fields of PlaceAndTakePerpOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4…remainingVec<AccountMeta>

PlaceAndTakeSpotOrder#

Discriminator bf038a4772c6ca64 · data PlaceAndTakeSpotOrder · accounts PlaceAndTakeSpotOrderInstructionAccounts.

FieldType
paramsOrderParams
fulfillment_typeOption<SpotFulfillmentType>
maker_order_idOption<u32>

Required accounts: 4; extras go to remaining.

Fields of PlaceAndTakeSpotOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4…remainingVec<AccountMeta>

PlaceOrders#

Discriminator 3c3f327b0cc53cbe · data PlaceOrders · accounts PlaceOrdersInstructionAccounts.

FieldType
paramsVec<OrderParams>

Required accounts: 3; extras go to remaining.

Fields of PlaceOrdersInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

PlacePerpOrder#

Discriminator 45a15dca787e4cb9 · data PlacePerpOrder · accounts PlacePerpOrderInstructionAccounts.

FieldType
paramsOrderParams

Required accounts: 3; extras go to remaining.

Fields of PlacePerpOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

PlaceScaleOrders#

Discriminator 81f94637b1fafc5e · data PlaceScaleOrders · accounts PlaceScaleOrdersInstructionAccounts.

FieldType
paramsScaleOrderParams

Required accounts: 3; extras go to remaining.

Fields of PlaceScaleOrdersInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

PlaceSignedMsgTakerOrder#

Discriminator 204f658b1906620f · data PlaceSignedMsgTakerOrder · accounts PlaceSignedMsgTakerOrderInstructionAccounts.

FieldType
signed_msg_order_params_message_bytesVec<u8>
is_delegate_signerbool

Required accounts: 6; extras go to remaining.

Fields of PlaceSignedMsgTakerOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3signed_msg_user_ordersPubkey
4authorityPubkey
5ix_sysvarPubkey
6…remainingVec<AccountMeta>

PlaceSpotOrder#

Discriminator 2d4f51a0f85a5bdc · data PlaceSpotOrder · accounts PlaceSpotOrderInstructionAccounts.

FieldType
paramsOrderParams

Required accounts: 3; extras go to remaining.

Fields of PlaceSpotOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

PostMultiPythPullOracleUpdatesAtomic#

Discriminator f34fcce4e3d064f4 · data PostMultiPythPullOracleUpdatesAtomic · accounts PostMultiPythPullOracleUpdatesAtomicInstructionAccounts.

FieldType
paramsVec<u8>

Required accounts: 3; extras go to remaining.

Fields of PostMultiPythPullOracleUpdatesAtomicInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1pyth_solana_receiverPubkey
2guardian_setPubkey
3…remainingVec<AccountMeta>

PostPythLazerOracleUpdate#

Discriminator daedaaf5278fa621 · data PostPythLazerOracleUpdate · accounts PostPythLazerOracleUpdateInstructionAccounts.

FieldType
pyth_messageVec<u8>

Required accounts: 3; extras go to remaining.

Fields of PostPythLazerOracleUpdateInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1pyth_lazer_storagePubkey
2ix_sysvarPubkey
3…remainingVec<AccountMeta>

PostPythPullOracleUpdateAtomic#

Discriminator 747a899ee0c3ad77 · data PostPythPullOracleUpdateAtomic · accounts PostPythPullOracleUpdateAtomicInstructionAccounts.

FieldType
feed_id[u8; 32]
paramsVec<u8>

Required accounts: 4; extras go to remaining.

Fields of PostPythPullOracleUpdateAtomicInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1pyth_solana_receiverPubkey
2guardian_setPubkey
3price_feedPubkey
4…remainingVec<AccountMeta>

RecenterPerpMarketAmm#

Discriminator 18570a73a5be508b · data RecenterPerpMarketAmm · accounts RecenterPerpMarketAmmInstructionAccounts.

FieldType
peg_multiplieru128
sqrt_ku128

Required accounts: 3; extras go to remaining.

Fields of RecenterPerpMarketAmmInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

RecenterPerpMarketAmmCrank#

Discriminator a613400a0e33657a · data RecenterPerpMarketAmmCrank · accounts RecenterPerpMarketAmmCrankInstructionAccounts.

FieldType
depthOption<u128>

Required accounts: 5; extras go to remaining.

Fields of RecenterPerpMarketAmmCrankInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3spot_marketPubkey
4oraclePubkey
5…remainingVec<AccountMeta>

ReclaimRent#

Discriminator dac813c5e359c016 · data ReclaimRent · accounts ReclaimRentInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of ReclaimRentInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_statsPubkey
2statePubkey
3authorityPubkey
4rentPubkey
5…remainingVec<AccountMeta>

RemoveAmmConstituentMappingData#

Discriminator 14b7d3a21034e573 · data RemoveAmmConstituentMappingData · accounts RemoveAmmConstituentMappingDataInstructionAccounts.

FieldType
perp_market_indexu16
constituent_indexu16

Required accounts: 5; extras go to remaining.

Fields of RemoveAmmConstituentMappingDataInstructionAccounts, in account order:

#FieldType
0adminPubkey
1lp_poolPubkey
2amm_constituent_mappingPubkey
3system_programPubkey
4statePubkey
5…remainingVec<AccountMeta>

RemoveInsuranceFundStake#

Discriminator 80a68e09febb8fae · data RemoveInsuranceFundStake · accounts RemoveInsuranceFundStakeInstructionAccounts.

FieldType
market_indexu16

Required accounts: 9; extras go to remaining.

Fields of RemoveInsuranceFundStakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2insurance_fund_stakePubkey
3user_statsPubkey
4authorityPubkey
5insurance_fund_vaultPubkey
6drift_signerPubkey
7user_token_accountPubkey
8token_programPubkey
9…remainingVec<AccountMeta>

RepegAmmCurve#

Discriminator 03246659b48078d5 · data RepegAmmCurve · accounts RepegAmmCurveInstructionAccounts.

FieldType
new_peg_candidateu128

Required accounts: 4; extras go to remaining.

Fields of RepegAmmCurveInstructionAccounts, in account order:

#FieldType
0statePubkey
1perp_marketPubkey
2oraclePubkey
3adminPubkey
4…remainingVec<AccountMeta>

RequestRemoveInsuranceFundStake#

Discriminator 8e46cc5c496ab434 · data RequestRemoveInsuranceFundStake · accounts RequestRemoveInsuranceFundStakeInstructionAccounts.

FieldType
market_indexu16
amountu64

Required accounts: 5; extras go to remaining.

Fields of RequestRemoveInsuranceFundStakeInstructionAccounts, in account order:

#FieldType
0spot_marketPubkey
1insurance_fund_stakePubkey
2user_statsPubkey
3authorityPubkey
4insurance_fund_vaultPubkey
5…remainingVec<AccountMeta>

ResetFuelSeason#

Discriminator c77ac0ff20633fc8 · data ResetFuelSeason · accounts ResetFuelSeasonInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of ResetFuelSeasonInstructionAccounts, in account order:

#FieldType
0user_statsPubkey
1authorityPubkey
2statePubkey
3adminPubkey
4…remainingVec<AccountMeta>

ResetPerpMarketAmmOracleTwap#

Discriminator 7f0a37a47be22f18 · data ResetPerpMarketAmmOracleTwap · accounts ResetPerpMarketAmmOracleTwapInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of ResetPerpMarketAmmOracleTwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1perp_marketPubkey
2oraclePubkey
3adminPubkey
4…remainingVec<AccountMeta>

ResizeRevenueShareEscrowOrders#

Discriminator 207cf7e197d5e126 · data ResizeRevenueShareEscrowOrders · accounts ResizeRevenueShareEscrowOrdersInstructionAccounts.

FieldType
num_ordersu16

Required accounts: 4; extras go to remaining.

Fields of ResizeRevenueShareEscrowOrdersInstructionAccounts, in account order:

#FieldType
0escrowPubkey
1authorityPubkey
2payerPubkey
3system_programPubkey
4…remainingVec<AccountMeta>

ResizeSignedMsgUserOrders#

Discriminator 890a579612734fa8 · data ResizeSignedMsgUserOrders · accounts ResizeSignedMsgUserOrdersInstructionAccounts.

FieldType
num_ordersu16

Required accounts: 5; extras go to remaining.

Fields of ResizeSignedMsgUserOrdersInstructionAccounts, in account order:

#FieldType
0signed_msg_user_ordersPubkey
1authorityPubkey
2userPubkey
3payerPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

ResolvePerpBankruptcy#

Discriminator e010b0d6a2d5b7de · data ResolvePerpBankruptcy · accounts ResolvePerpBankruptcyInstructionAccounts.

FieldType
quote_spot_market_indexu16
market_indexu16

Required accounts: 10; extras go to remaining.

Fields of ResolvePerpBankruptcyInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6spot_market_vaultPubkey
7insurance_fund_vaultPubkey
8drift_signerPubkey
9token_programPubkey
10…remainingVec<AccountMeta>

ResolvePerpPnlDeficit#

Discriminator a8cc44969f7e5f94 · data ResolvePerpPnlDeficit · accounts ResolvePerpPnlDeficitInstructionAccounts.

FieldType
spot_market_indexu16
perp_market_indexu16

Required accounts: 6; extras go to remaining.

Fields of ResolvePerpPnlDeficitInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2spot_market_vaultPubkey
3insurance_fund_vaultPubkey
4drift_signerPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

ResolveSpotBankruptcy#

Discriminator 7cc2f0fec6d5347a · data ResolveSpotBankruptcy · accounts ResolveSpotBankruptcyInstructionAccounts.

FieldType
market_indexu16

Required accounts: 10; extras go to remaining.

Fields of ResolveSpotBankruptcyInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2liquidatorPubkey
3liquidator_statsPubkey
4userPubkey
5user_statsPubkey
6spot_market_vaultPubkey
7insurance_fund_vaultPubkey
8drift_signerPubkey
9token_programPubkey
10…remainingVec<AccountMeta>

RevertFill#

Discriminator eceeb045ef0ab5c1 · data RevertFill · accounts RevertFillInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of RevertFillInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2fillerPubkey
3filler_statsPubkey
4…remainingVec<AccountMeta>

SettleExpiredMarket#

Discriminator 78590b197a4d48c1 · data SettleExpiredMarket · accounts SettleExpiredMarketInstructionAccounts.

FieldType
market_indexu16

Required accounts: 3; extras go to remaining.

Fields of SettleExpiredMarketInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

SettleExpiredMarketPoolsToRevenuePool#

Discriminator 3713eea9e35ac8b8 · data SettleExpiredMarketPoolsToRevenuePool · accounts SettleExpiredMarketPoolsToRevenuePoolInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of SettleExpiredMarketPoolsToRevenuePoolInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2spot_marketPubkey
3perp_marketPubkey
4…remainingVec<AccountMeta>

SettleFundingPayment#

Discriminator de5aca5e1c2d73b7 · data SettleFundingPayment · accounts SettleFundingPaymentInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of SettleFundingPaymentInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2…remainingVec<AccountMeta>

SettleMultiplePnls#

Discriminator 7f4275392832987f · data SettleMultiplePnls · accounts SettleMultiplePnlsInstructionAccounts.

FieldType
market_indexesVec<u16>
modeSettlePnlMode

Required accounts: 4; extras go to remaining.

Fields of SettleMultiplePnlsInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3spot_market_vaultPubkey
4…remainingVec<AccountMeta>

SettlePerpToLpPool#

Discriminator 05622ebc0a3b02f9 · data SettlePerpToLpPool · accounts SettlePerpToLpPoolInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of SettlePerpToLpPoolInstructionAccounts, in account order:

#FieldType
0statePubkey
1lp_poolPubkey
2keeperPubkey
3amm_cachePubkey
4quote_marketPubkey
5constituentPubkey
6constituent_quote_token_accountPubkey
7quote_token_vaultPubkey
8token_programPubkey
9drift_signerPubkey
10…remainingVec<AccountMeta>

SettlePnl#

Discriminator 2b3dea2d0f5f9899 · data SettlePnl · accounts SettlePnlInstructionAccounts.

FieldType
market_indexu16

Required accounts: 4; extras go to remaining.

Fields of SettlePnlInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3spot_market_vaultPubkey
4…remainingVec<AccountMeta>

SettleRevenueToInsuranceFund#

Discriminator c8785d884526c79f · data SettleRevenueToInsuranceFund · accounts SettleRevenueToInsuranceFundInstructionAccounts.

FieldType
spot_market_indexu16

Required accounts: 6; extras go to remaining.

Fields of SettleRevenueToInsuranceFundInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2spot_market_vaultPubkey
3drift_signerPubkey
4insurance_fund_vaultPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

SetUserStatusToBeingLiquidated#

Discriminator 6a85a0cec1abc0c2 · data SetUserStatusToBeingLiquidated · accounts SetUserStatusToBeingLiquidatedInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of SetUserStatusToBeingLiquidatedInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3…remainingVec<AccountMeta>

SweepFuel#

Discriminator af6b1338a5f12b45 · data SweepFuel · accounts SweepFuelInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of SweepFuelInstructionAccounts, in account order:

#FieldType
0fuel_overflowPubkey
1user_statsPubkey
2authorityPubkey
3signerPubkey
4…remainingVec<AccountMeta>

TransferDeposit#

Discriminator 141493df293fcc6f · data TransferDeposit · accounts TransferDepositInstructionAccounts.

FieldType
market_indexu16
amountu64

Required accounts: 6; extras go to remaining.

Fields of TransferDepositInstructionAccounts, in account order:

#FieldType
0from_userPubkey
1to_userPubkey
2user_statsPubkey
3authorityPubkey
4statePubkey
5spot_market_vaultPubkey
6…remainingVec<AccountMeta>

TransferIsolatedPerpPositionDeposit#

Discriminator c983f2e455e246ed · data TransferIsolatedPerpPositionDeposit · accounts TransferIsolatedPerpPositionDepositInstructionAccounts.

FieldType
spot_market_indexu16
perp_market_indexu16
amounti64

Required accounts: 5; extras go to remaining.

Fields of TransferIsolatedPerpPositionDepositInstructionAccounts, in account order:

#FieldType
0userPubkey
1user_statsPubkey
2authorityPubkey
3statePubkey
4spot_market_vaultPubkey
5…remainingVec<AccountMeta>

TransferPerpPosition#

Discriminator 17acbca886d2036c · data TransferPerpPosition · accounts TransferPerpPositionInstructionAccounts.

FieldType
market_indexu16
amountOption<i64>

Required accounts: 5; extras go to remaining.

Fields of TransferPerpPositionInstructionAccounts, in account order:

#FieldType
0from_userPubkey
1to_userPubkey
2user_statsPubkey
3authorityPubkey
4statePubkey
5…remainingVec<AccountMeta>

TransferPools#

Discriminator c5679a196b5a3c5e · data TransferPools · accounts TransferPoolsInstructionAccounts.

FieldType
deposit_from_market_indexu16
deposit_to_market_indexu16
borrow_from_market_indexu16
borrow_to_market_indexu16
deposit_amountOption<u64>
borrow_amountOption<u64>

Required accounts: 10; extras go to remaining.

Fields of TransferPoolsInstructionAccounts, in account order:

#FieldType
0from_userPubkey
1to_userPubkey
2user_statsPubkey
3authorityPubkey
4statePubkey
5deposit_from_spot_market_vaultPubkey
6deposit_to_spot_market_vaultPubkey
7borrow_from_spot_market_vaultPubkey
8borrow_to_spot_market_vaultPubkey
9drift_signerPubkey
10…remainingVec<AccountMeta>

TransferProtocolIfSharesToRevenuePool#

Discriminator ec88939992cd681d · data TransferProtocolIfSharesToRevenuePool · accounts TransferProtocolIfSharesToRevenuePoolInstructionAccounts.

FieldType
market_indexu16
amountu64

Required accounts: 7; extras go to remaining.

Fields of TransferProtocolIfSharesToRevenuePoolInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2insurance_fund_vaultPubkey
3spot_market_vaultPubkey
4if_rebalance_configPubkey
5token_programPubkey
6drift_signerPubkey
7…remainingVec<AccountMeta>

TriggerOrder#

Discriminator 3f7033e9e82ff0c7 · data TriggerOrder · accounts TriggerOrderInstructionAccounts.

FieldType
order_idu32

Required accounts: 4; extras go to remaining.

Fields of TriggerOrderInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2fillerPubkey
3userPubkey
4…remainingVec<AccountMeta>

UpdateAdmin#

Discriminator a1b028d53cb8b3e4 · data UpdateAdmin · accounts UpdateAdminInstructionAccounts.

FieldType
adminPubkey

Required accounts: 2; extras go to remaining.

Fields of UpdateAdminInstructionAccounts, in account order:

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

UpdateAmmCache#

Discriminator 58043f5e53e0ff82 · data UpdateAmmCache · accounts UpdateAmmCacheInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of UpdateAmmCacheInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1statePubkey
2amm_cachePubkey
3quote_marketPubkey
4…remainingVec<AccountMeta>

UpdateAmmConstituentMappingData#

Discriminator 544621a7856b3b18 · data UpdateAmmConstituentMappingData · accounts UpdateAmmConstituentMappingDataInstructionAccounts.

FieldType
amm_constituent_mapping_dataVec<AddAmmConstituentMappingDatum>

Required accounts: 5; extras go to remaining.

Fields of UpdateAmmConstituentMappingDataInstructionAccounts, in account order:

#FieldType
0adminPubkey
1lp_poolPubkey
2amm_constituent_mappingPubkey
3system_programPubkey
4statePubkey
5…remainingVec<AccountMeta>

UpdateAmmJitIntensity#

Discriminator b5bf356da6f9378e · data UpdateAmmJitIntensity · accounts UpdateAmmJitIntensityInstructionAccounts.

FieldType
amm_jit_intensityu8

Required accounts: 3; extras go to remaining.

Fields of UpdateAmmJitIntensityInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdateAmms#

Discriminator c96ad9fd04afe461 · data UpdateAmms · accounts UpdateAmmsInstructionAccounts.

FieldType
market_indexesVec<u16>

Required accounts: 2; extras go to remaining.

Fields of UpdateAmmsInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateConstituentCorrelationData#

Discriminator 4f0e1349dd6a3e6d · data UpdateConstituentCorrelationData · accounts UpdateConstituentCorrelationDataInstructionAccounts.

FieldType
index1u16
index2u16
correlationi64

Required accounts: 4; extras go to remaining.

Fields of UpdateConstituentCorrelationDataInstructionAccounts, in account order:

#FieldType
0adminPubkey
1lp_poolPubkey
2constituent_correlationsPubkey
3statePubkey
4…remainingVec<AccountMeta>

UpdateConstituentOracleInfo#

Discriminator c675e7fa93217fa1 · data UpdateConstituentOracleInfo · accounts UpdateConstituentOracleInfoInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of UpdateConstituentOracleInfoInstructionAccounts, in account order:

#FieldType
0statePubkey
1keeperPubkey
2constituentPubkey
3spot_marketPubkey
4oraclePubkey
5…remainingVec<AccountMeta>

UpdateConstituentParams#

Discriminator ee827a1f0c68c07a · data UpdateConstituentParams · accounts UpdateConstituentParamsInstructionAccounts.

FieldType
constituent_paramsConstituentParams

Required accounts: 5; extras go to remaining.

Fields of UpdateConstituentParamsInstructionAccounts, in account order:

#FieldType
0lp_poolPubkey
1constituent_target_basePubkey
2adminPubkey
3statePubkey
4constituentPubkey
5…remainingVec<AccountMeta>

UpdateConstituentPausedOperations#

Discriminator b97a99bf83b184d0 · data UpdateConstituentPausedOperations · accounts UpdateConstituentPausedOperationsInstructionAccounts.

FieldType
paused_operationsu8

Required accounts: 3; extras go to remaining.

Fields of UpdateConstituentPausedOperationsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2constituentPubkey
3…remainingVec<AccountMeta>

UpdateConstituentStatus#

Discriminator 4c9fd3efb6d6060f · data UpdateConstituentStatus · accounts UpdateConstituentStatusInstructionAccounts.

FieldType
new_statusu8

Required accounts: 3; extras go to remaining.

Fields of UpdateConstituentStatusInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2constituentPubkey
3…remainingVec<AccountMeta>

UpdateDelegateUserGovTokenInsuranceStake#

Discriminator f11dd7e48e7416a0 · data UpdateDelegateUserGovTokenInsuranceStake · accounts UpdateDelegateUserGovTokenInsuranceStakeInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of UpdateDelegateUserGovTokenInsuranceStakeInstructionAccounts, in account order:

#FieldType
0spot_marketPubkey
1insurance_fund_stakePubkey
2user_statsPubkey
3adminPubkey
4insurance_fund_vaultPubkey
5statePubkey
6…remainingVec<AccountMeta>

UpdateDiscountMint#

Discriminator 20fc7ad3421f2ff1 · data UpdateDiscountMint · accounts UpdateDiscountMintInstructionAccounts.

FieldType
discount_mintPubkey

Required accounts: 2; extras go to remaining.

Fields of UpdateDiscountMintInstructionAccounts, in account order:

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

UpdateExchangeStatus#

Discriminator 53a0fcfa817431df · data UpdateExchangeStatus · accounts UpdateExchangeStatusInstructionAccounts.

FieldType
exchange_statusu8

Required accounts: 2; extras go to remaining.

Fields of UpdateExchangeStatusInstructionAccounts, in account order:

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

UpdateFeatureBitFlagsBuilderCodes#

Discriminator 0180b133ad2d0b66 · data UpdateFeatureBitFlagsBuilderCodes · accounts UpdateFeatureBitFlagsBuilderCodesInstructionAccounts.

FieldType
enablebool

Required accounts: 2; extras go to remaining.

Fields of UpdateFeatureBitFlagsBuilderCodesInstructionAccounts, in account order:

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

UpdateFeatureBitFlagsMedianTriggerPrice#

Discriminator 40b9dd2d57930c13 · data UpdateFeatureBitFlagsMedianTriggerPrice · accounts UpdateFeatureBitFlagsMedianTriggerPriceInstructionAccounts.

FieldType
enablebool

Required accounts: 2; extras go to remaining.

Fields of UpdateFeatureBitFlagsMedianTriggerPriceInstructionAccounts, in account order:

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

UpdateFeatureBitFlagsMintRedeemLpPool#

Discriminator 1a0b8e7ace9f092d · data UpdateFeatureBitFlagsMintRedeemLpPool · accounts UpdateFeatureBitFlagsMintRedeemLpPoolInstructionAccounts.

FieldType
enablebool

Required accounts: 2; extras go to remaining.

Fields of UpdateFeatureBitFlagsMintRedeemLpPoolInstructionAccounts, in account order:

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

UpdateFeatureBitFlagsMmOracle#

Discriminator da8621bae73b8295 · data UpdateFeatureBitFlagsMmOracle · accounts UpdateFeatureBitFlagsMmOracleInstructionAccounts.

FieldType
enablebool

Required accounts: 2; extras go to remaining.

Fields of UpdateFeatureBitFlagsMmOracleInstructionAccounts, in account order:

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

UpdateFeatureBitFlagsSettleLpPool#

Discriminator ba1c4ee69b53f21a · data UpdateFeatureBitFlagsSettleLpPool · accounts UpdateFeatureBitFlagsSettleLpPoolInstructionAccounts.

FieldType
enablebool

Required accounts: 2; extras go to remaining.

Fields of UpdateFeatureBitFlagsSettleLpPoolInstructionAccounts, in account order:

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

UpdateFeatureBitFlagsSwapLpPool#

Discriminator 5310960c6603163a · data UpdateFeatureBitFlagsSwapLpPool · accounts UpdateFeatureBitFlagsSwapLpPoolInstructionAccounts.

FieldType
enablebool

Required accounts: 2; extras go to remaining.

Fields of UpdateFeatureBitFlagsSwapLpPoolInstructionAccounts, in account order:

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

UpdateFundingRate#

Discriminator c9b274d4a69048ee · data UpdateFundingRate · accounts UpdateFundingRateInstructionAccounts.

FieldType
market_indexu16

Required accounts: 3; extras go to remaining.

Fields of UpdateFundingRateInstructionAccounts, in account order:

#FieldType
0statePubkey
1perp_marketPubkey
2oraclePubkey
3…remainingVec<AccountMeta>

UpdateHighLeverageModeConfig#

Discriminator 407ad45d8dd9ca37 · data UpdateHighLeverageModeConfig · accounts UpdateHighLeverageModeConfigInstructionAccounts.

FieldType
max_usersu32
reduce_onlybool
current_usersOption<u32>

Required accounts: 3; extras go to remaining.

Fields of UpdateHighLeverageModeConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1high_leverage_mode_configPubkey
2statePubkey
3…remainingVec<AccountMeta>

UpdateIfRebalanceConfig#

Discriminator 8ef5f942f9b51653 · data UpdateIfRebalanceConfig · accounts UpdateIfRebalanceConfigInstructionAccounts.

Required accounts: 3; extras go to remaining.

Fields of UpdateIfRebalanceConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1if_rebalance_configPubkey
2statePubkey
3…remainingVec<AccountMeta>

UpdateInitialAmmCacheInfo#

Discriminator 9dd26d43d4aa0c6b · data UpdateInitialAmmCacheInfo · accounts UpdateInitialAmmCacheInfoInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of UpdateInitialAmmCacheInfoInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2amm_cachePubkey
3…remainingVec<AccountMeta>

UpdateInitialPctToLiquidate#

Discriminator d285e180c2320d6d · data UpdateInitialPctToLiquidate · accounts UpdateInitialPctToLiquidateInstructionAccounts.

FieldType
initial_pct_to_liquidateu16

Required accounts: 2; extras go to remaining.

Fields of UpdateInitialPctToLiquidateInstructionAccounts, in account order:

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

UpdateInsuranceFundUnstakingPeriod#

Discriminator 2c452be2ccdfca34 · data UpdateInsuranceFundUnstakingPeriod · accounts UpdateInsuranceFundUnstakingPeriodInstructionAccounts.

FieldType
insurance_fund_unstaking_periodi64

Required accounts: 3; extras go to remaining.

Fields of UpdateInsuranceFundUnstakingPeriodInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateK#

Discriminator 4862098b81e5ac38 · data UpdateK · accounts UpdateKInstructionAccounts.

FieldType
sqrt_ku128

Required accounts: 4; extras go to remaining.

Fields of UpdateKInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3oraclePubkey
4…remainingVec<AccountMeta>

UpdateLiquidationDuration#

Discriminator 1c9a14f966c04947 · data UpdateLiquidationDuration · accounts UpdateLiquidationDurationInstructionAccounts.

FieldType
liquidation_durationu8

Required accounts: 2; extras go to remaining.

Fields of UpdateLiquidationDurationInstructionAccounts, in account order:

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

UpdateLiquidationMarginBufferRatio#

Discriminator 84e0f3a09a5261d7 · data UpdateLiquidationMarginBufferRatio · accounts UpdateLiquidationMarginBufferRatioInstructionAccounts.

FieldType
liquidation_margin_buffer_ratiou32

Required accounts: 2; extras go to remaining.

Fields of UpdateLiquidationMarginBufferRatioInstructionAccounts, in account order:

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

UpdateLpConstituentTargetBase#

Discriminator 9d4132cf3beca16e · data UpdateLpConstituentTargetBase · accounts UpdateLpConstituentTargetBaseInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of UpdateLpConstituentTargetBaseInstructionAccounts, in account order:

#FieldType
0statePubkey
1keeperPubkey
2amm_constituent_mappingPubkey
3constituent_target_basePubkey
4amm_cachePubkey
5lp_poolPubkey
6…remainingVec<AccountMeta>

UpdateLpPoolAum#

Discriminator 587189cef6f7ab8e · data UpdateLpPoolAum · accounts UpdateLpPoolAumInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of UpdateLpPoolAumInstructionAccounts, in account order:

#FieldType
0statePubkey
1keeperPubkey
2lp_poolPubkey
3constituent_target_basePubkey
4amm_cachePubkey
5…remainingVec<AccountMeta>

UpdateLpPoolParams#

Discriminator d95c02ff1ba7b251 · data UpdateLpPoolParams · accounts UpdateLpPoolParamsInstructionAccounts.

FieldType
lp_pool_paramsLpPoolParams

Required accounts: 3; extras go to remaining.

Fields of UpdateLpPoolParamsInstructionAccounts, in account order:

#FieldType
0lp_poolPubkey
1adminPubkey
2statePubkey
3…remainingVec<AccountMeta>

UpdateOracleGuardRails#

Discriminator 83700a3b203628a4 · data UpdateOracleGuardRails · accounts UpdateOracleGuardRailsInstructionAccounts.

FieldType
oracle_guard_railsOracleGuardRails

Required accounts: 2; extras go to remaining.

Fields of UpdateOracleGuardRailsInstructionAccounts, in account order:

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

UpdatePerpAuctionDuration#

Discriminator 7e6e34ae1eced75a · data UpdatePerpAuctionDuration · accounts UpdatePerpAuctionDurationInstructionAccounts.

FieldType
min_perp_auction_durationu8

Required accounts: 2; extras go to remaining.

Fields of UpdatePerpAuctionDurationInstructionAccounts, in account order:

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

UpdatePerpBidAskTwap#

Discriminator f717ff41d45addc2 · data UpdatePerpBidAskTwap · accounts UpdatePerpBidAskTwapInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of UpdatePerpBidAskTwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1perp_marketPubkey
2oraclePubkey
3keeper_statsPubkey
4authorityPubkey
5…remainingVec<AccountMeta>

UpdatePerpFeeStructure#

Discriminator 17b26fcb49168c4b · data UpdatePerpFeeStructure · accounts UpdatePerpFeeStructureInstructionAccounts.

FieldType
fee_structureFeeStructure

Required accounts: 2; extras go to remaining.

Fields of UpdatePerpFeeStructureInstructionAccounts, in account order:

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

UpdatePerpMarketAmmOracleTwap#

Discriminator f14a727bce9918ca · data UpdatePerpMarketAmmOracleTwap · accounts UpdatePerpMarketAmmOracleTwapInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of UpdatePerpMarketAmmOracleTwapInstructionAccounts, in account order:

#FieldType
0statePubkey
1perp_marketPubkey
2oraclePubkey
3adminPubkey
4…remainingVec<AccountMeta>

UpdatePerpMarketAmmSpreadAdjustment#

Discriminator 9bc3952bdc52adcd · data UpdatePerpMarketAmmSpreadAdjustment · accounts UpdatePerpMarketAmmSpreadAdjustmentInstructionAccounts.

FieldType
amm_spread_adjustmenti8
amm_inventory_spread_adjustmenti8
reference_price_offseti32

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketAmmSpreadAdjustmentInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketAmmSummaryStats#

Discriminator 7a65f9eed109f1f5 · data UpdatePerpMarketAmmSummaryStats · accounts UpdatePerpMarketAmmSummaryStatsInstructionAccounts.

Required accounts: 5; extras go to remaining.

Fields of UpdatePerpMarketAmmSummaryStatsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3spot_marketPubkey
4oraclePubkey
5…remainingVec<AccountMeta>

UpdatePerpMarketBaseSpread#

Discriminator 475f54a8099dc641 · data UpdatePerpMarketBaseSpread · accounts UpdatePerpMarketBaseSpreadInstructionAccounts.

FieldType
base_spreadu32

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketBaseSpreadInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketConcentrationCoef#

Discriminator 184ee87ea9b0e610 · data UpdatePerpMarketConcentrationCoef · accounts UpdatePerpMarketConcentrationCoefInstructionAccounts.

FieldType
concentration_scaleu128

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketConcentrationCoefInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketConfig#

Discriminator 865a062250a05ef5 · data UpdatePerpMarketConfig · accounts UpdatePerpMarketConfigInstructionAccounts.

FieldType
market_configu8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketContractTier#

Discriminator ec800f5fcbd64475 · data UpdatePerpMarketContractTier · accounts UpdatePerpMarketContractTierInstructionAccounts.

FieldType
contract_tierContractTier

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketContractTierInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketCurveUpdateIntensity#

Discriminator 3283069ce2e7bd48 · data UpdatePerpMarketCurveUpdateIntensity · accounts UpdatePerpMarketCurveUpdateIntensityInstructionAccounts.

FieldType
curve_update_intensityu8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketCurveUpdateIntensityInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketExpiry#

Discriminator 2cdde397838c166e · data UpdatePerpMarketExpiry · accounts UpdatePerpMarketExpiryInstructionAccounts.

FieldType
expiry_tsi64

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketExpiryInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketFeeAdjustment#

Discriminator c2ae57662b942070 · data UpdatePerpMarketFeeAdjustment · accounts UpdatePerpMarketFeeAdjustmentInstructionAccounts.

FieldType
fee_adjustmenti16

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketFeeAdjustmentInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketFundingPeriod#

Discriminator aba1455b818ba11c · data UpdatePerpMarketFundingPeriod · accounts UpdatePerpMarketFundingPeriodInstructionAccounts.

FieldType
funding_periodi64

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketFundingPeriodInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketHighLeverageMarginRatio#

Discriminator 5870563118744a9d · data UpdatePerpMarketHighLeverageMarginRatio · accounts UpdatePerpMarketHighLeverageMarginRatioInstructionAccounts.

FieldType
margin_ratio_initialu16
margin_ratio_maintenanceu16

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketHighLeverageMarginRatioInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketImfFactor#

Discriminator cfc23884234347f4 · data UpdatePerpMarketImfFactor · accounts UpdatePerpMarketImfFactorInstructionAccounts.

FieldType
imf_factoru32
unrealized_pnl_imf_factoru32

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketImfFactorInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketLiquidationFee#

Discriminator 5a89099129089475 · data UpdatePerpMarketLiquidationFee · accounts UpdatePerpMarketLiquidationFeeInstructionAccounts.

FieldType
liquidator_feeu32
if_liquidation_feeu32

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketLiquidationFeeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketLpPoolFeeTransferScalar#

Discriminator 5ee4ed6d64b90451 · data UpdatePerpMarketLpPoolFeeTransferScalar · accounts UpdatePerpMarketLpPoolFeeTransferScalarInstructionAccounts.

FieldType
optional_lp_fee_transfer_scalarOption<u8>
optional_lp_net_pnl_transfer_scalarOption<u8>

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketLpPoolFeeTransferScalarInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketLpPoolId#

Discriminator 77d09a58a55c15bc · data UpdatePerpMarketLpPoolId · accounts UpdatePerpMarketLpPoolIdInstructionAccounts.

FieldType
lp_pool_idu8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketLpPoolIdInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketLpPoolPausedOperations#

Discriminator b55e5d9233592087 · data UpdatePerpMarketLpPoolPausedOperations · accounts UpdatePerpMarketLpPoolPausedOperationsInstructionAccounts.

FieldType
lp_paused_operationsu8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketLpPoolPausedOperationsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketLpPoolStatus#

Discriminator 4306fc3d365859e9 · data UpdatePerpMarketLpPoolStatus · accounts UpdatePerpMarketLpPoolStatusInstructionAccounts.

FieldType
lp_statusu8

Required accounts: 4; extras go to remaining.

Fields of UpdatePerpMarketLpPoolStatusInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3amm_cachePubkey
4…remainingVec<AccountMeta>

UpdatePerpMarketMarginRatio#

Discriminator 82ad6b2d77691a71 · data UpdatePerpMarketMarginRatio · accounts UpdatePerpMarketMarginRatioInstructionAccounts.

FieldType
margin_ratio_initialu32
margin_ratio_maintenanceu32

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketMarginRatioInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketMaxFillReserveFraction#

Discriminator 13ac729a2a87a185 · data UpdatePerpMarketMaxFillReserveFraction · accounts UpdatePerpMarketMaxFillReserveFractionInstructionAccounts.

FieldType
max_fill_reserve_fractionu16

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketMaxFillReserveFractionInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketMaxImbalances#

Discriminator 0fce49853c085659 · data UpdatePerpMarketMaxImbalances · accounts UpdatePerpMarketMaxImbalancesInstructionAccounts.

FieldType
unrealized_max_imbalanceu64
max_revenue_withdraw_per_periodu64
quote_max_insuranceu64

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketMaxImbalancesInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketMaxOpenInterest#

Discriminator c24f95e0f666ba8c · data UpdatePerpMarketMaxOpenInterest · accounts UpdatePerpMarketMaxOpenInterestInstructionAccounts.

FieldType
max_open_interestu128

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketMaxOpenInterestInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketMaxSlippageRatio#

Discriminator eb2528c4469236c9 · data UpdatePerpMarketMaxSlippageRatio · accounts UpdatePerpMarketMaxSlippageRatioInstructionAccounts.

FieldType
max_slippage_ratiou16

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketMaxSlippageRatioInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketMaxSpread#

Discriminator 50fc7a3e28da5b64 · data UpdatePerpMarketMaxSpread · accounts UpdatePerpMarketMaxSpreadInstructionAccounts.

FieldType
max_spreadu32

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketMaxSpreadInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketMinOrderSize#

Discriminator e24a05596cdf2e8d · data UpdatePerpMarketMinOrderSize · accounts UpdatePerpMarketMinOrderSizeInstructionAccounts.

FieldType
order_sizeu64

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketMinOrderSizeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketName#

Discriminator d31f15d2406c42c9 · data UpdatePerpMarketName · accounts UpdatePerpMarketNameInstructionAccounts.

FieldType
name[u8; 32]

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketNameInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketNumberOfUsers#

Discriminator 233e90b1b43ed7c4 · data UpdatePerpMarketNumberOfUsers · accounts UpdatePerpMarketNumberOfUsersInstructionAccounts.

FieldType
number_of_usersOption<u32>
number_of_users_with_baseOption<u32>

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketNumberOfUsersInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketOracle#

Discriminator b6716fa043ae59bf · data UpdatePerpMarketOracle · accounts UpdatePerpMarketOracleInstructionAccounts.

FieldType
oraclePubkey
oracle_sourceOracleSource
skip_invariant_checkbool

Required accounts: 6; extras go to remaining.

Fields of UpdatePerpMarketOracleInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3oraclePubkey
4old_oraclePubkey
5amm_cachePubkey
6…remainingVec<AccountMeta>

UpdatePerpMarketOracleLowRiskSlotDelayOverride#

Discriminator 7c6c93e56d757b03 · data UpdatePerpMarketOracleLowRiskSlotDelayOverride · accounts UpdatePerpMarketOracleLowRiskSlotDelayOverrideInstructionAccounts.

FieldType
oracle_low_risk_slot_delay_overridei8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketOracleLowRiskSlotDelayOverrideInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketOracleSlotDelayOverride#

Discriminator a55befe33face308 · data UpdatePerpMarketOracleSlotDelayOverride · accounts UpdatePerpMarketOracleSlotDelayOverrideInstructionAccounts.

FieldType
oracle_slot_delay_overridei8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketOracleSlotDelayOverrideInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketPausedOperations#

Discriminator 351088841edc7955 · data UpdatePerpMarketPausedOperations · accounts UpdatePerpMarketPausedOperationsInstructionAccounts.

FieldType
paused_operationsu8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketPausedOperationsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketPnlPool#

Discriminator 32caf9e0a6b80d8f · data UpdatePerpMarketPnlPool · accounts UpdatePerpMarketPnlPoolInstructionAccounts.

FieldType
amountu64

Required accounts: 5; extras go to remaining.

Fields of UpdatePerpMarketPnlPoolInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2spot_marketPubkey
3spot_market_vaultPubkey
4perp_marketPubkey
5…remainingVec<AccountMeta>

UpdatePerpMarketProtectedMakerParams#

Discriminator f9d57322fdef4bad · data UpdatePerpMarketProtectedMakerParams · accounts UpdatePerpMarketProtectedMakerParamsInstructionAccounts.

FieldType
protected_maker_limit_price_divisorOption<u8>
protected_maker_dynamic_divisorOption<u8>

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketProtectedMakerParamsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketReferencePriceOffsetDeadbandPct#

Discriminator d649a60bda4c6ea3 · data UpdatePerpMarketReferencePriceOffsetDeadbandPct · accounts UpdatePerpMarketReferencePriceOffsetDeadbandPctInstructionAccounts.

FieldType
reference_price_offset_deadband_pctu8

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketReferencePriceOffsetDeadbandPctInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketStatus#

Discriminator 47c9af7affcfc4cf · data UpdatePerpMarketStatus · accounts UpdatePerpMarketStatusInstructionAccounts.

FieldType
statusMarketStatus

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketStatusInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketStepSizeAndTickSize#

Discriminator e7ff6119928bae04 · data UpdatePerpMarketStepSizeAndTickSize · accounts UpdatePerpMarketStepSizeAndTickSizeInstructionAccounts.

FieldType
step_sizeu64
tick_sizeu64

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketStepSizeAndTickSizeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePerpMarketUnrealizedAssetWeight#

Discriminator 8784cda56d96a66a · data UpdatePerpMarketUnrealizedAssetWeight · accounts UpdatePerpMarketUnrealizedAssetWeightInstructionAccounts.

FieldType
unrealized_initial_asset_weightu32
unrealized_maintenance_asset_weightu32

Required accounts: 3; extras go to remaining.

Fields of UpdatePerpMarketUnrealizedAssetWeightInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…remainingVec<AccountMeta>

UpdatePrelaunchOracle#

Discriminator dc841b1be9dc3ddb · data UpdatePrelaunchOracle · accounts UpdatePrelaunchOracleInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of UpdatePrelaunchOracleInstructionAccounts, in account order:

#FieldType
0statePubkey
1perp_marketPubkey
2oraclePubkey
3…remainingVec<AccountMeta>

UpdatePrelaunchOracleParams#

Discriminator 62cd93f3124b53cf · data UpdatePrelaunchOracleParams · accounts UpdatePrelaunchOracleParamsInstructionAccounts.

FieldType
paramsPrelaunchOracleParams

Required accounts: 4; extras go to remaining.

Fields of UpdatePrelaunchOracleParamsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1prelaunch_oraclePubkey
2perp_marketPubkey
3statePubkey
4…remainingVec<AccountMeta>

UpdateProtectedMakerModeConfig#

Discriminator 56a6ebfd43cadf11 · data UpdateProtectedMakerModeConfig · accounts UpdateProtectedMakerModeConfigInstructionAccounts.

FieldType
max_usersu32
reduce_onlybool
current_usersOption<u32>

Required accounts: 3; extras go to remaining.

Fields of UpdateProtectedMakerModeConfigInstructionAccounts, in account order:

#FieldType
0adminPubkey
1protected_maker_mode_configPubkey
2statePubkey
3…remainingVec<AccountMeta>

UpdatePythPullOracle#

Discriminator e6bfbd5e6c3b4ac5 · data UpdatePythPullOracle · accounts UpdatePythPullOracleInstructionAccounts.

FieldType
feed_id[u8; 32]
paramsVec<u8>

Required accounts: 4; extras go to remaining.

Fields of UpdatePythPullOracleInstructionAccounts, in account order:

#FieldType
0keeperPubkey
1pyth_solana_receiverPubkey
2encoded_vaaPubkey
3price_feedPubkey
4…remainingVec<AccountMeta>

UpdateSerumFulfillmentConfigStatus#

Discriminator ab6df0fb5f019559 · data UpdateSerumFulfillmentConfigStatus · accounts UpdateSerumFulfillmentConfigStatusInstructionAccounts.

Required accounts: 3; extras go to remaining.

Fields of UpdateSerumFulfillmentConfigStatusInstructionAccounts, in account order:

#FieldType
0statePubkey
1serum_fulfillment_configPubkey
2adminPubkey
3…remainingVec<AccountMeta>

UpdateSpotAuctionDuration#

Discriminator b6b2cb48bb8f9d6b · data UpdateSpotAuctionDuration · accounts UpdateSpotAuctionDurationInstructionAccounts.

FieldType
default_spot_auction_durationu8

Required accounts: 2; extras go to remaining.

Fields of UpdateSpotAuctionDurationInstructionAccounts, in account order:

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

UpdateSpotFeeStructure#

Discriminator 61d8698371f68e8d · data UpdateSpotFeeStructure · accounts UpdateSpotFeeStructureInstructionAccounts.

FieldType
fee_structureFeeStructure

Required accounts: 2; extras go to remaining.

Fields of UpdateSpotFeeStructureInstructionAccounts, in account order:

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

UpdateSpotMarketAssetTier#

Discriminator fdd1e70ef2d0f382 · data UpdateSpotMarketAssetTier · accounts UpdateSpotMarketAssetTierInstructionAccounts.

FieldType
asset_tierAssetTier

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketAssetTierInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketBorrowRate#

Discriminator 47efec99d23efe4c · data UpdateSpotMarketBorrowRate · accounts UpdateSpotMarketBorrowRateInstructionAccounts.

FieldType
optimal_utilizationu32
optimal_borrow_rateu32
max_borrow_rateu32
min_borrow_rateOption<u8>

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketBorrowRateInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketCumulativeInterest#

Discriminator 27a68bf39ea59be1 · data UpdateSpotMarketCumulativeInterest · accounts UpdateSpotMarketCumulativeInterestInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of UpdateSpotMarketCumulativeInterestInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2oraclePubkey
3spot_market_vaultPubkey
4…remainingVec<AccountMeta>

UpdateSpotMarketExpiry#

Discriminator d00bd39fe2180bf7 · data UpdateSpotMarketExpiry · accounts UpdateSpotMarketExpiryInstructionAccounts.

FieldType
expiry_tsi64

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketExpiryInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketFeeAdjustment#

Discriminator 94b6037e9d72dc63 · data UpdateSpotMarketFeeAdjustment · accounts UpdateSpotMarketFeeAdjustmentInstructionAccounts.

FieldType
fee_adjustmenti16

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketFeeAdjustmentInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketIfFactor#

Discriminator 931ee02212e66904 · data UpdateSpotMarketIfFactor · accounts UpdateSpotMarketIfFactorInstructionAccounts.

FieldType
spot_market_indexu16
user_if_factoru32
total_if_factoru32

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketIfFactorInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketIfPausedOperations#

Discriminator 65d74f4a3b294f0c · data UpdateSpotMarketIfPausedOperations · accounts UpdateSpotMarketIfPausedOperationsInstructionAccounts.

FieldType
paused_operationsu8

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketIfPausedOperationsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketLiquidationFee#

Discriminator 0b0dff35388868b1 · data UpdateSpotMarketLiquidationFee · accounts UpdateSpotMarketLiquidationFeeInstructionAccounts.

FieldType
liquidator_feeu32
if_liquidation_feeu32

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketLiquidationFeeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketMarginWeights#

Discriminator 6d2157c3ff240651 · data UpdateSpotMarketMarginWeights · accounts UpdateSpotMarketMarginWeightsInstructionAccounts.

FieldType
initial_asset_weightu32
maintenance_asset_weightu32
initial_liability_weightu32
maintenance_liability_weightu32
imf_factoru32

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketMarginWeightsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketMaxTokenBorrows#

Discriminator 3966ccd4fd5f0dc7 · data UpdateSpotMarketMaxTokenBorrows · accounts UpdateSpotMarketMaxTokenBorrowsInstructionAccounts.

FieldType
max_token_borrows_fractionu16

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketMaxTokenBorrowsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketMaxTokenDeposits#

Discriminator 38bf4f121a7950d0 · data UpdateSpotMarketMaxTokenDeposits · accounts UpdateSpotMarketMaxTokenDepositsInstructionAccounts.

FieldType
max_token_depositsu64

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketMaxTokenDepositsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketMinOrderSize#

Discriminator 5d800b771a14b532 · data UpdateSpotMarketMinOrderSize · accounts UpdateSpotMarketMinOrderSizeInstructionAccounts.

FieldType
order_sizeu64

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketMinOrderSizeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketName#

Discriminator 11d00101a2d3bce0 · data UpdateSpotMarketName · accounts UpdateSpotMarketNameInstructionAccounts.

FieldType
name[u8; 32]

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketNameInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketOracle#

Discriminator 72b86625f6bab463 · data UpdateSpotMarketOracle · accounts UpdateSpotMarketOracleInstructionAccounts.

FieldType
oraclePubkey
oracle_sourceOracleSource
skip_invariant_checkbool

Required accounts: 5; extras go to remaining.

Fields of UpdateSpotMarketOracleInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3oraclePubkey
4old_oraclePubkey
5…remainingVec<AccountMeta>

UpdateSpotMarketOrdersEnabled#

Discriminator be4fce0f1ae5e52b · data UpdateSpotMarketOrdersEnabled · accounts UpdateSpotMarketOrdersEnabledInstructionAccounts.

FieldType
orders_enabledbool

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketOrdersEnabledInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketPausedOperations#

Discriminator 643d9951b40c06f8 · data UpdateSpotMarketPausedOperations · accounts UpdateSpotMarketPausedOperationsInstructionAccounts.

FieldType
paused_operationsu8

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketPausedOperationsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketPoolId#

Discriminator 16d5c5a08bc15195 · data UpdateSpotMarketPoolId · accounts UpdateSpotMarketPoolIdInstructionAccounts.

FieldType
pool_idu8

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketPoolIdInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketRevenueSettlePeriod#

Discriminator 515c7e29fae19cdb · data UpdateSpotMarketRevenueSettlePeriod · accounts UpdateSpotMarketRevenueSettlePeriodInstructionAccounts.

FieldType
revenue_settle_periodi64

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketRevenueSettlePeriodInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketScaleInitialAssetWeightStart#

Discriminator d9cccc76cc82e193 · data UpdateSpotMarketScaleInitialAssetWeightStart · accounts UpdateSpotMarketScaleInitialAssetWeightStartInstructionAccounts.

FieldType
scale_initial_asset_weight_startu64

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketScaleInitialAssetWeightStartInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketStatus#

Discriminator 4e5e10bcc16ee71f · data UpdateSpotMarketStatus · accounts UpdateSpotMarketStatusInstructionAccounts.

FieldType
statusMarketStatus

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketStatusInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateSpotMarketStepSizeAndTickSize#

Discriminator ee998950ce3bfa3d · data UpdateSpotMarketStepSizeAndTickSize · accounts UpdateSpotMarketStepSizeAndTickSizeInstructionAccounts.

FieldType
step_sizeu64
tick_sizeu64

Required accounts: 3; extras go to remaining.

Fields of UpdateSpotMarketStepSizeAndTickSizeInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

UpdateStateMaxInitializeUserFee#

Discriminator ede119edc12d4d61 · data UpdateStateMaxInitializeUserFee · accounts UpdateStateMaxInitializeUserFeeInstructionAccounts.

FieldType
max_initialize_user_feeu16

Required accounts: 2; extras go to remaining.

Fields of UpdateStateMaxInitializeUserFeeInstructionAccounts, in account order:

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

UpdateStateMaxNumberOfSubAccounts#

Discriminator 9b7bd602dda6cc55 · data UpdateStateMaxNumberOfSubAccounts · accounts UpdateStateMaxNumberOfSubAccountsInstructionAccounts.

FieldType
max_number_of_sub_accountsu16

Required accounts: 2; extras go to remaining.

Fields of UpdateStateMaxNumberOfSubAccountsInstructionAccounts, in account order:

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

UpdateStateSettlementDuration#

Discriminator 6144c7eb83503dad · data UpdateStateSettlementDuration · accounts UpdateStateSettlementDurationInstructionAccounts.

FieldType
settlement_durationu16

Required accounts: 2; extras go to remaining.

Fields of UpdateStateSettlementDurationInstructionAccounts, in account order:

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

UpdateUserCustomMarginRatio#

Discriminator 15dd8cbb20810b7b · data UpdateUserCustomMarginRatio · accounts UpdateUserCustomMarginRatioInstructionAccounts.

FieldType
sub_account_idu16
margin_ratiou32

Required accounts: 2; extras go to remaining.

Fields of UpdateUserCustomMarginRatioInstructionAccounts, in account order:

#FieldType
0userPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateUserDelegate#

Discriminator 8bcd8d8d71245ebb · data UpdateUserDelegate · accounts UpdateUserDelegateInstructionAccounts.

FieldType
sub_account_idu16
delegatePubkey

Required accounts: 2; extras go to remaining.

Fields of UpdateUserDelegateInstructionAccounts, in account order:

#FieldType
0userPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateUserGovTokenInsuranceStake#

Discriminator 8f63ebbb149fb854 · data UpdateUserGovTokenInsuranceStake · accounts UpdateUserGovTokenInsuranceStakeInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of UpdateUserGovTokenInsuranceStakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2insurance_fund_stakePubkey
3user_statsPubkey
4signerPubkey
5insurance_fund_vaultPubkey
6…remainingVec<AccountMeta>

UpdateUserIdle#

Discriminator fd85431667a11464 · data UpdateUserIdle · accounts UpdateUserIdleInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of UpdateUserIdleInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2fillerPubkey
3userPubkey
4…remainingVec<AccountMeta>

UpdateUserMarginTradingEnabled#

Discriminator c25cccdff6bc1fcb · data UpdateUserMarginTradingEnabled · accounts UpdateUserMarginTradingEnabledInstructionAccounts.

FieldType
sub_account_idu16
margin_trading_enabledbool

Required accounts: 2; extras go to remaining.

Fields of UpdateUserMarginTradingEnabledInstructionAccounts, in account order:

#FieldType
0userPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateUserName#

Discriminator 8719b938a5352288 · data UpdateUserName · accounts UpdateUserNameInstructionAccounts.

FieldType
sub_account_idu16
name[u8; 32]

Required accounts: 2; extras go to remaining.

Fields of UpdateUserNameInstructionAccounts, in account order:

#FieldType
0userPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateUserPerpPositionCustomMarginRatio#

Discriminator 79899d9b59ba9171 · data UpdateUserPerpPositionCustomMarginRatio · accounts UpdateUserPerpPositionCustomMarginRatioInstructionAccounts.

FieldType
sub_account_idu16
perp_market_indexu16
margin_ratiou16

Required accounts: 2; extras go to remaining.

Fields of UpdateUserPerpPositionCustomMarginRatioInstructionAccounts, in account order:

#FieldType
0userPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateUserPoolId#

Discriminator db56496a38da806d · data UpdateUserPoolId · accounts UpdateUserPoolIdInstructionAccounts.

FieldType
sub_account_idu16
pool_idu8

Required accounts: 2; extras go to remaining.

Fields of UpdateUserPoolIdInstructionAccounts, in account order:

#FieldType
0userPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateUserProtectedMakerOrders#

Discriminator 72277bc6bb195adb · data UpdateUserProtectedMakerOrders · accounts UpdateUserProtectedMakerOrdersInstructionAccounts.

FieldType
sub_account_idu16
protected_maker_ordersbool

Required accounts: 4; extras go to remaining.

Fields of UpdateUserProtectedMakerOrdersInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2authorityPubkey
3protected_maker_mode_configPubkey
4…remainingVec<AccountMeta>

UpdateUserQuoteAssetInsuranceStake#

Discriminator fb659c07023f1e17 · data UpdateUserQuoteAssetInsuranceStake · accounts UpdateUserQuoteAssetInsuranceStakeInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of UpdateUserQuoteAssetInsuranceStakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1spot_marketPubkey
2insurance_fund_stakePubkey
3user_statsPubkey
4signerPubkey
5insurance_fund_vaultPubkey
6…remainingVec<AccountMeta>

UpdateUserReduceOnly#

Discriminator c7472a439013566d · data UpdateUserReduceOnly · accounts UpdateUserReduceOnlyInstructionAccounts.

FieldType
sub_account_idu16
reduce_onlybool

Required accounts: 2; extras go to remaining.

Fields of UpdateUserReduceOnlyInstructionAccounts, in account order:

#FieldType
0userPubkey
1authorityPubkey
2…remainingVec<AccountMeta>

UpdateUserStatsReferrerStatus#

Discriminator ae9a482abf9491cd · data UpdateUserStatsReferrerStatus · accounts UpdateUserStatsReferrerStatusInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of UpdateUserStatsReferrerStatusInstructionAccounts, in account order:

#FieldType
0statePubkey
1authorityPubkey
2user_statsPubkey
3…remainingVec<AccountMeta>

UpdateWithdrawGuardThreshold#

Discriminator 3812273d9bd32c85 · data UpdateWithdrawGuardThreshold · accounts UpdateWithdrawGuardThresholdInstructionAccounts.

FieldType
withdraw_guard_thresholdu64

Required accounts: 3; extras go to remaining.

Fields of UpdateWithdrawGuardThresholdInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2spot_marketPubkey
3…remainingVec<AccountMeta>

ViewLpPoolAddLiquidityFees#

Discriminator 5042e2a1468e7754 · data ViewLpPoolAddLiquidityFees · accounts ViewLpPoolAddLiquidityFeesInstructionAccounts.

FieldType
in_market_indexu16
in_amountu128

Required accounts: 7; extras go to remaining.

Fields of ViewLpPoolAddLiquidityFeesInstructionAccounts, in account order:

#FieldType
0statePubkey
1lp_poolPubkey
2authorityPubkey
3in_market_mintPubkey
4in_constituentPubkey
5lp_mintPubkey
6constituent_target_basePubkey
7…remainingVec<AccountMeta>

ViewLpPoolRemoveLiquidityFees#

Discriminator 2f0c09660ce2c559 · data ViewLpPoolRemoveLiquidityFees · accounts ViewLpPoolRemoveLiquidityFeesInstructionAccounts.

FieldType
in_market_indexu16
in_amountu64

Required accounts: 7; extras go to remaining.

Fields of ViewLpPoolRemoveLiquidityFeesInstructionAccounts, in account order:

#FieldType
0statePubkey
1lp_poolPubkey
2authorityPubkey
3out_market_mintPubkey
4out_constituentPubkey
5lp_mintPubkey
6constituent_target_basePubkey
7…remainingVec<AccountMeta>

ViewLpPoolSwapFees#

Discriminator 7ebd6dbdaa9c032e · data ViewLpPoolSwapFees · accounts ViewLpPoolSwapFeesInstructionAccounts.

FieldType
in_market_indexu16
out_market_indexu16
in_amountu64
in_target_weighti64
out_target_weighti64

Required accounts: 11; extras go to remaining.

Fields of ViewLpPoolSwapFeesInstructionAccounts, in account order:

#FieldType
0drift_signerPubkey
1statePubkey
2lp_poolPubkey
3constituent_target_basePubkey
4constituent_correlationsPubkey
5constituent_in_token_accountPubkey
6constituent_out_token_accountPubkey
7in_constituentPubkey
8out_constituentPubkey
9authorityPubkey
10token_programPubkey
11…remainingVec<AccountMeta>

Withdraw#

Discriminator b712469c946da122 · data Withdraw · accounts WithdrawInstructionAccounts.

FieldType
market_indexu16
amountu64
reduce_onlybool

Required accounts: 8; extras go to remaining.

Fields of WithdrawInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4spot_market_vaultPubkey
5drift_signerPubkey
6user_token_accountPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

WithdrawFromIsolatedPerpPosition#

Discriminator 255cb2958c4c9f87 · data WithdrawFromIsolatedPerpPosition · accounts WithdrawFromIsolatedPerpPositionInstructionAccounts.

FieldType
spot_market_indexu16
perp_market_indexu16
amountu64

Required accounts: 8; extras go to remaining.

Fields of WithdrawFromIsolatedPerpPositionInstructionAccounts, in account order:

#FieldType
0statePubkey
1userPubkey
2user_statsPubkey
3authorityPubkey
4spot_market_vaultPubkey
5drift_signerPubkey
6user_token_accountPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

WithdrawFromProgramVault#

Discriminator 7828b795e812e097 · data WithdrawFromProgramVault · accounts WithdrawFromProgramVaultInstructionAccounts.

FieldType
amountu64

Required accounts: 10; extras go to remaining.

Fields of WithdrawFromProgramVaultInstructionAccounts, in account order:

#FieldType
0statePubkey
1adminPubkey
2drift_signerPubkey
3constituentPubkey
4constituent_token_accountPubkey
5spot_marketPubkey
6spot_market_vaultPubkey
7token_programPubkey
8mintPubkey
9oraclePubkey
10…remainingVec<AccountMeta>

ZeroMmOracleFields#

Discriminator c0e227cccf7894fa · data ZeroMmOracleFields · accounts ZeroMmOracleFieldsInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of ZeroMmOracleFieldsInstructionAccounts, in account order:

#FieldType
0adminPubkey
1statePubkey
2perp_marketPubkey
3…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 DriftV2Account. Each wraps a boxed struct from carbon_drift_v2_decoder::accounts::<module>. decode_account only considers accounts owned by PROGRAM_ID and returns the first variant that matches.

AmmCache#

Discriminator d572a1381416023b · accounts::amm_cache::AmmCache.

FieldType
bumpu8
padding[u8; 3]
cacheVec<CacheInfo>

AmmConstituentMapping#

Discriminator fe5905ad4236d6f7 · accounts::amm_constituent_mapping::AmmConstituentMapping.

FieldType
lp_poolPubkey
bumpu8
padding[u8; 3]
weightsVec<AmmConstituentDatum>

Constituent#

Discriminator 003d2423b14cd8cd · accounts::constituent::Constituent.

FieldTypeDescription
pubkeyPubkeyaddress of the constituent
mintPubkey
lp_poolPubkey
vaultPubkey
total_swap_feesi128total fees received by the constituent. Positive = fees received, Negative = fees paid
spot_balanceConstituentSpotBalancespot borrow-lend balance for constituent
last_spot_balance_token_amounti64
cumulative_spot_interest_accrued_token_amounti64
max_weight_deviationi64max deviation from target_weight allowed for the constituent precision: PERCENTAGE_PRECISION
swap_fee_mini64min fee charged on swaps to/from this constituent precision: PERCENTAGE_PRECISION
swap_fee_maxi64max fee charged on swaps to/from this constituent precision: PERCENTAGE_PRECISION
max_borrow_token_amountu64Max Borrow amount: precision: token precision
vault_token_balanceu64ata token balance in token precision
last_oracle_pricei64
last_oracle_slotu64
oracle_staleness_thresholdu64Delay allowed for valid AUM calculation
flash_loan_initial_token_amountu64
next_swap_idu64Every swap to/from this constituent has a monotonically increasing id. This is the next id to use
derivative_weightu64percentable of derivatve weight to go to this specific derivative PERCENTAGE_PRECISION. Zero if no derivative weight
volatilityu64
constituent_derivative_depeg_thresholdu64
constituent_derivative_indexi16The constituent_index of the parent constituent. -1 if it is a parent index Example: if in a pool with SOL (parent) and dSOL (derivative), SOL.constituent_index = 1, SOL.constituent_derivative_index = -1, dSOL.constituent_index = 2, dSOL.constituent_derivative_index = 1
spot_market_indexu16
constituent_indexu16
decimalsu8
bumpu8
vault_bumpu8
gamma_inventoryu8
gamma_executionu8
xiu8
statusu8
paused_operationsu8
padding[u8; 162]

ConstituentCorrelations#

Discriminator 7ccb732112a243d8 · accounts::constituent_correlations::ConstituentCorrelations.

FieldType
lp_poolPubkey
bumpu8
padding[u8; 3]
correlationsVec<i64>

ConstituentTargetBase#

Discriminator ff8e86477d42c663 · accounts::constituent_target_base::ConstituentTargetBase.

FieldType
lp_poolPubkey
bumpu8
padding[u8; 3]
targetsVec<TargetsDatum>

FuelOverflow#

Discriminator b640e7b1e28e453a · accounts::fuel_overflow::FuelOverflow.

FieldTypeDescription
authorityPubkeyThe authority of this overflow account
fuel_insuranceu128
fuel_depositsu128
fuel_borrowsu128
fuel_positionsu128
fuel_takeru128
fuel_makeru128
last_fuel_sweep_tsu32
last_reset_tsu32
padding[u128; 6]

HighLeverageModeConfig#

Discriminator 03c45abdc140e4ea · accounts::high_leverage_mode_config::HighLeverageModeConfig.

FieldType
max_usersu32
current_usersu32
reduce_onlyu8
padding1[u8; 3]
current_maintenance_usersu32
padding2[u8; 24]

IfRebalanceConfig#

Discriminator d65428fb6b90adef · accounts::if_rebalance_config::IfRebalanceConfig.

FieldTypeDescription
pubkeyPubkey
total_in_amountu64total amount to be sold
current_in_amountu64amount already sold
current_out_amountu64amount already bought
current_out_amount_transferredu64amount already transferred to revenue pool
current_in_amount_since_last_transferu64amount already bought in epoch
epoch_start_tsi64start time of epoch
epoch_in_amountu64amount already bought in epoch
epoch_max_in_amountu64max amount to swap in epoch
epoch_durationi64duration of epoch
out_market_indexu16market index to sell
in_market_indexu16market index to buy
max_slippage_bpsu16
swap_modeu8
statusu8
padding2[u8; 32]

InsuranceFundStake#

Discriminator 6eca0e2a5f495a5f · accounts::insurance_fund_stake::InsuranceFundStake.

FieldType
authorityPubkey
if_sharesu128
last_withdraw_request_sharesu128
if_baseu128
last_valid_tsi64
last_withdraw_request_valueu64
last_withdraw_request_tsi64
cost_basisi64
market_indexu16
padding[u8; 14]

LPPool#

Discriminator e4988de0a1aa0b59 · accounts::l_p_pool::LPPool.

FieldTypeDescription
pubkeyPubkeyaddress of the vault.
mintPubkey
whitelist_mintPubkey
constituent_target_basePubkey
constituent_correlationsPubkey
max_aumu128The current number of VaultConstituents in the vault, each constituent is pda(LPPool.address, constituent_index) which constituent is the quote, receives revenue pool distributions. (maybe this should just be implied idx 0) pub quote_constituent_index: u16, QUOTE_PRECISION: Max AUM, Prohibit minting new DLP beyond this
last_aumu128QUOTE_PRECISION: AUM of the vault in USD, updated lazily
cumulative_quote_sent_to_perp_marketsu128QUOTE PRECISION: Cumulative quotes from settles
cumulative_quote_received_from_perp_marketsu128
total_mint_redeem_fees_paidi128QUOTE_PRECISION: Total fees paid for minting and redeeming LP tokens
last_aum_slotu64timestamp of last AUM slot
max_settle_quote_amountu64
_paddingu64timestamp of last vAMM revenue rebalance
mint_redeem_idu64Every mint/redeem has a monotonically increasing id. This is the next id to use
settle_idu64
min_mint_feei64PERCENTAGE_PRECISION
token_supplyu64
volatilityu64
constituentsu16
quote_consituent_indexu16
bumpu8
gamma_executionu8
xiu8
target_oracle_delay_fee_bps_per10_slotsu8
target_position_delay_fee_bps_per10_slotsu8
lp_pool_idu8
padding[u8; 174]

OpenbookV2FulfillmentConfig#

Discriminator 032b3a6a8384c7ab · accounts::openbook_v2_fulfillment_config::OpenbookV2FulfillmentConfig.

FieldType
pubkeyPubkey
openbook_v2_program_idPubkey
openbook_v2_marketPubkey
openbook_v2_market_authorityPubkey
openbook_v2_event_heapPubkey
openbook_v2_bidsPubkey
openbook_v2_asksPubkey
openbook_v2_base_vaultPubkey
openbook_v2_quote_vaultPubkey
market_indexu16
fulfillment_typeSpotFulfillmentType
statusSpotFulfillmentConfigStatus
padding[u8; 4]

PerpMarket#

Discriminator 0adf0c2c6bf537f7 · accounts::perp_market::PerpMarket.

FieldTypeDescription
pubkeyPubkeyThe perp market's address. It is a pda of the market index
ammAMMThe automated market maker
pnl_poolPoolBalanceThe market's pnl pool. When users settle negative pnl, the balance increases. When users settle positive pnl, the balance decreases. Can not go negative.
name[u8; 32]Encoded display name for the perp market e.g. SOL-PERP
insurance_claimInsuranceClaimThe perp market's claim on the insurance fund
unrealized_pnl_max_imbalanceu64The max pnl imbalance before positive pnl asset weight is discounted pnl imbalance is the difference between long and short pnl. When it's greater than 0, the amm has negative pnl and the initial asset weight for positive pnl is discounted precision = QUOTE_PRECISION
expiry_tsi64The ts when the market will be expired. Only set if market is in reduce only mode
expiry_pricei64The price at which positions will be settled. Only set if market is expired precision = PRICE_PRECISION
next_fill_record_idu64Every trade has a fill record id. This is the next id to be used
next_funding_rate_record_idu64Every funding rate update has a record id. This is the next id to be used
next_curve_record_idu64Every amm k updated has a record id. This is the next id to be used
imf_factoru32The initial margin fraction factor. Used to increase margin ratio for large positions precision: MARGIN_PRECISION
unrealized_pnl_imf_factoru32The imf factor for unrealized pnl. Used to discount asset weight for large positive pnl precision: MARGIN_PRECISION
liquidator_feeu32The fee the liquidator is paid for taking over perp position precision: LIQUIDATOR_FEE_PRECISION
if_liquidation_feeu32The fee the insurance fund receives from liquidation precision: LIQUIDATOR_FEE_PRECISION
margin_ratio_initialu32The margin ratio which determines how much collateral is required to open a position e.g. margin ratio of .1 means a user must have $100 of total collateral to open a $1000 position precision: MARGIN_PRECISION
margin_ratio_maintenanceu32The margin ratio which determines when a user will be liquidated e.g. margin ratio of .05 means a user must have $50 of total collateral to maintain a $1000 position else they will be liquidated precision: MARGIN_PRECISION
unrealized_pnl_initial_asset_weightu32The initial asset weight for positive pnl. Negative pnl always has an asset weight of 1 precision: SPOT_WEIGHT_PRECISION
unrealized_pnl_maintenance_asset_weightu32The maintenance asset weight for positive pnl. Negative pnl always has an asset weight of 1 precision: SPOT_WEIGHT_PRECISION
number_of_users_with_baseu32number of users in a position (base)
number_of_usersu32number of users in a position (pnl) or pnl (quote)
market_indexu16
statusMarketStatusWhether a market is active, reduce only, expired, etc Affects whether users can open/close positions
contract_typeContractTypeCurrently only Perpetual markets are supported
contract_tierContractTierThe contract tier determines how much insurance a market can receive, with more speculative markets receiving less insurance It also influences the order perp markets can be liquidated, with less speculative markets being liquidated first
paused_operationsu8
quote_spot_market_indexu16The spot market that pnl is settled in
fee_adjustmenti16Between -100 and 100, represents what % to increase/decrease the fee by E.g. if this is -50 and the fee is 5bps, the new fee will be 2.5bps if this is 50 and the fee is 5bps, the new fee will be 7.5bps
fuel_boost_positionu8fuel multiplier for perp funding precision: 10
fuel_boost_takeru8fuel multiplier for perp taker precision: 10
fuel_boost_makeru8fuel multiplier for perp maker precision: 10
pool_idu8
high_leverage_margin_ratio_initialu16
high_leverage_margin_ratio_maintenanceu16
protected_maker_limit_price_divisoru8
protected_maker_dynamic_divisoru8
lp_fee_transfer_scalaru8
lp_statusu8
lp_paused_operationsu8
lp_exchange_fee_excluscion_scalaru8
last_fill_priceu64
lp_pool_idu8
market_configu8
padding[u8; 22]

PhoenixV1FulfillmentConfig#

Discriminator e92d3e2823813048 · accounts::phoenix_v1_fulfillment_config::PhoenixV1FulfillmentConfig.

FieldType
pubkeyPubkey
phoenix_program_idPubkey
phoenix_log_authorityPubkey
phoenix_marketPubkey
phoenix_base_vaultPubkey
phoenix_quote_vaultPubkey
market_indexu16
fulfillment_typeSpotFulfillmentType
statusSpotFulfillmentConfigStatus
padding[u8; 4]

PrelaunchOracle#

Discriminator 5c0e8bea48f4441a · accounts::prelaunch_oracle::PrelaunchOracle.

FieldType
pricei64
max_pricei64
confidenceu64
last_update_slotu64
amm_last_update_slotu64
perp_market_indexu16
padding[u8; 70]

ProtectedMakerModeConfig#

Discriminator 2f565a09e0ff0a45 · accounts::protected_maker_mode_config::ProtectedMakerModeConfig.

FieldType
max_usersu32
current_usersu32
reduce_onlyu8
padding[u8; 31]

ProtocolIfSharesTransferConfig#

Discriminator bc01d56217941e01 · accounts::protocol_if_shares_transfer_config::ProtocolIfSharesTransferConfig.

FieldType
whitelisted_signers[Pubkey; 4]
max_transfer_per_epochu128
current_epoch_transferu128
next_epoch_tsi64
padding[u128; 8]

PythLazerOracle#

Discriminator 9f07a1f922517985 · accounts::pyth_lazer_oracle::PythLazerOracle.

FieldType
pricei64
publish_timeu64
posted_slotu64
exponenti32
padding[u8; 4]
confu64

ReferrerName#

Discriminator 6985aa6e342a1cb6 · accounts::referrer_name::ReferrerName.

FieldType
authorityPubkey
userPubkey
user_statsPubkey
name[u8; 32]

RevenueShare#

Discriminator 3728e4078b34b46e · accounts::revenue_share::RevenueShare.

FieldTypeDescription
authorityPubkeythe owner of this account, a builder or referrer
total_referrer_rewardsu64
total_builder_rewardsu64
padding[u8; 18]

RevenueShareEscrow#

Discriminator 62a7032e4ab1adfc · accounts::revenue_share_escrow::RevenueShareEscrow.

FieldTypeDescription
authorityPubkeythe owner of this account, a user
referrerPubkey
referrer_boost_expire_tsu32
referrer_reward_offseti8
referee_fee_numerator_offseti8
referrer_boost_numeratori8
reserved_fixed[u8; 17]
padding0u32
ordersVec<RevenueShareOrder>
padding1u32
approved_buildersVec<BuilderInfo>

SerumV3FulfillmentConfig#

Discriminator 41a0c570efa867b9 · accounts::serum_v3_fulfillment_config::SerumV3FulfillmentConfig.

FieldType
pubkeyPubkey
serum_program_idPubkey
serum_marketPubkey
serum_request_queuePubkey
serum_event_queuePubkey
serum_bidsPubkey
serum_asksPubkey
serum_base_vaultPubkey
serum_quote_vaultPubkey
serum_open_ordersPubkey
serum_signer_nonceu64
market_indexu16
fulfillment_typeSpotFulfillmentType
statusSpotFulfillmentConfigStatus
padding[u8; 4]

SignedMsgUserOrders#

From the program's IDL:

  • This struct is a duplicate of SignedMsgUserOrdersZeroCopy
  • It is used to give anchor an struct to generate the idl for clients
  • The struct SignedMsgUserOrdersZeroCopy is used to load the data in efficiently

Discriminator 460632f8de018f31 · accounts::signed_msg_user_orders::SignedMsgUserOrders.

FieldType
authority_pubkeyPubkey
paddingu32
signed_msg_order_dataVec<SignedMsgOrderId>

SignedMsgWsDelegates#

From the program's IDL:

  • Used to store authenticated delegates for swift-like ws connections

Discriminator be736f2cd8fc6c55 · accounts::signed_msg_ws_delegates::SignedMsgWsDelegates.

FieldType
delegatesVec<Pubkey>

SpotMarket#

Discriminator 64b1086ba8414127 · accounts::spot_market::SpotMarket.

FieldTypeDescription
pubkeyPubkeyThe address of the spot market. It is a pda of the market index
oraclePubkeyThe oracle used to price the markets deposits/borrows
mintPubkeyThe token mint of the market
vaultPubkeyThe vault used to store the market's deposits The amount in the vault should be equal to or greater than deposits - borrows
name[u8; 32]The encoded display name for the market e.g. SOL
historical_oracle_dataHistoricalOracleData
historical_index_dataHistoricalIndexData
revenue_poolPoolBalanceRevenue the protocol has collected in this markets token e.g. for SOL-PERP, funds can be settled in usdc and will flow into the USDC revenue pool
spot_fee_poolPoolBalanceThe fees collected from swaps between this market and the quote market Is settled to the quote markets revenue pool
insurance_fundInsuranceFundDetails on the insurance fund covering bankruptcies in this markets token Covers bankruptcies for borrows with this markets token and perps settling in this markets token
total_spot_feeu128The total spot fees collected for this market precision: QUOTE_PRECISION
deposit_balanceu128The sum of the scaled balances for deposits across users and pool balances To convert to the deposit token amount, multiply by the cumulative deposit interest precision: SPOT_BALANCE_PRECISION
borrow_balanceu128The sum of the scaled balances for borrows across users and pool balances To convert to the borrow token amount, multiply by the cumulative borrow interest precision: SPOT_BALANCE_PRECISION
cumulative_deposit_interestu128The cumulative interest earned by depositors Used to calculate the deposit token amount from the deposit balance precision: SPOT_CUMULATIVE_INTEREST_PRECISION
cumulative_borrow_interestu128The cumulative interest earned by borrowers Used to calculate the borrow token amount from the borrow balance precision: SPOT_CUMULATIVE_INTEREST_PRECISION
total_social_lossu128The total socialized loss from borrows, in the mint's token precision: token mint precision
total_quote_social_lossu128The total socialized loss from borrows, in the quote market's token preicision: QUOTE_PRECISION
withdraw_guard_thresholdu64no withdraw limits/guards when deposits below this threshold precision: token mint precision
max_token_depositsu64The max amount of token deposits in this market 0 if there is no limit precision: token mint precision
deposit_token_twapu6424hr average of deposit token amount precision: token mint precision
borrow_token_twapu6424hr average of borrow token amount precision: token mint precision
utilization_twapu6424hr average of utilization which is borrow amount over token amount precision: SPOT_UTILIZATION_PRECISION
last_interest_tsu64Last time the cumulative deposit and borrow interest was updated
last_twap_tsu64Last time the deposit/borrow/utilization averages were updated
expiry_tsi64The time the market is set to expire. Only set if market is in reduce only mode
order_step_sizeu64Spot orders must be a multiple of the step size precision: token mint precision
order_tick_sizeu64Spot orders must be a multiple of the tick size precision: PRICE_PRECISION
min_order_sizeu64The minimum order size precision: token mint precision
max_position_sizeu64The maximum spot position size if the limit is 0, there is no limit precision: token mint precision
next_fill_record_idu64Every spot trade has a fill record id. This is the next id to use
next_deposit_record_idu64Every deposit has a deposit record id. This is the next id to use
initial_asset_weightu32The initial asset weight used to calculate a deposits contribution to a users initial total collateral e.g. if the asset weight is .8, $100 of deposits contributes $80 to the users initial total collateral precision: SPOT_WEIGHT_PRECISION
maintenance_asset_weightu32The maintenance asset weight used to calculate a deposits contribution to a users maintenance total collateral e.g. if the asset weight is .9, $100 of deposits contributes $90 to the users maintenance total collateral precision: SPOT_WEIGHT_PRECISION
initial_liability_weightu32The initial liability weight used to calculate a borrows contribution to a users initial margin requirement e.g. if the liability weight is .9, $100 of borrows contributes $90 to the users initial margin requirement precision: SPOT_WEIGHT_PRECISION
maintenance_liability_weightu32The maintenance liability weight used to calculate a borrows contribution to a users maintenance margin requirement e.g. if the liability weight is .8, $100 of borrows contributes $80 to the users maintenance margin requirement precision: SPOT_WEIGHT_PRECISION
imf_factoru32The initial margin fraction factor. Used to increase liability weight/decrease asset weight for large positions precision: MARGIN_PRECISION
liquidator_feeu32The fee the liquidator is paid for taking over borrow/deposit precision: LIQUIDATOR_FEE_PRECISION
if_liquidation_feeu32The fee the insurance fund receives from liquidation precision: LIQUIDATOR_FEE_PRECISION
optimal_utilizationu32The optimal utilization rate for this market. Used to determine the markets borrow rate precision: SPOT_UTILIZATION_PRECISION
optimal_borrow_rateu32The borrow rate for this market when the market has optimal utilization precision: SPOT_RATE_PRECISION
max_borrow_rateu32The borrow rate for this market when the market has 1000 utilization precision: SPOT_RATE_PRECISION
decimalsu32The market's token mint's decimals. To from decimals to a precision, 10^decimals
market_indexu16
orders_enabledboolWhether or not spot trading is enabled
oracle_sourceOracleSource
statusMarketStatus
asset_tierAssetTierThe asset tier affects how a deposit can be used as collateral and the priority for a borrow being liquidated
paused_operationsu8
if_paused_operationsu8
fee_adjustmenti16
max_token_borrows_fractionu16What fraction of max_token_deposits disabled when 0, 1 => 1/10000 => .01% of max_token_deposits precision: X/10000
flash_loan_amountu64For swaps, the amount of token loaned out in the begin_swap ix precision: token mint precision
flash_loan_initial_token_amountu64For swaps, the amount in the users token account in the begin_swap ix Used to calculate how much of the token left the system in end_swap ix precision: token mint precision
total_swap_feeu64The total fees received from swaps precision: token mint precision
scale_initial_asset_weight_startu64When to begin scaling down the initial asset weight disabled when 0 precision: QUOTE_PRECISION
min_borrow_rateu8The min borrow rate for this market when the market regardless of utilization 1 => 1/200 => .5% precision: X/200
fuel_boost_depositsu8fuel multiplier for spot deposits precision: 10
fuel_boost_borrowsu8fuel multiplier for spot borrows precision: 10
fuel_boost_takeru8fuel multiplier for spot taker precision: 10
fuel_boost_makeru8fuel multiplier for spot maker precision: 10
fuel_boost_insuranceu8fuel multiplier for spot insurance stake precision: 10
token_program_flagu8
pool_idu8
padding[u8; 40]

State#

Discriminator d8926b5e684bb6b1 · accounts::state::State.

FieldType
adminPubkey
whitelist_mintPubkey
discount_mintPubkey
signerPubkey
srm_vaultPubkey
perp_fee_structureFeeStructure
spot_fee_structureFeeStructure
oracle_guard_railsOracleGuardRails
number_of_authoritiesu64
number_of_sub_accountsu64
lp_cooldown_timeu64
liquidation_margin_buffer_ratiou32
settlement_durationu16
number_of_marketsu16
number_of_spot_marketsu16
signer_nonceu8
min_perp_auction_durationu8
default_market_order_time_in_forceu8
default_spot_auction_durationu8
exchange_statusu8
liquidation_durationu8
initial_pct_to_liquidateu16
max_number_of_sub_accountsu16
max_initialize_user_feeu16
feature_bit_flagsu8
lp_pool_feature_bit_flagsu8
padding[u8; 8]

User#

Discriminator 9f755fe3ef973aec · accounts::user::User.

FieldTypeDescription
authorityPubkeyThe owner/authority of the account
delegatePubkeyAn addresses that can control the account on the authority's behalf. Has limited power, cant withdraw
name[u8; 32]Encoded display name e.g. "toly"
spot_positions[SpotPosition; 8]The user's spot positions
perp_positions[PerpPosition; 8]The user's perp positions
orders[Order; 32]The user's orders
last_add_perp_lp_shares_tsi64The last time the user added perp lp positions
total_depositsu64The total values of deposits the user has made precision: QUOTE_PRECISION
total_withdrawsu64The total values of withdrawals the user has made precision: QUOTE_PRECISION
total_social_lossu64The total socialized loss the users has incurred upon the protocol precision: QUOTE_PRECISION
settled_perp_pnli64Fees (taker fees, maker rebate, referrer reward, filler reward) and pnl for perps precision: QUOTE_PRECISION
cumulative_spot_feesi64Fees (taker fees, maker rebate, filler reward) for spot precision: QUOTE_PRECISION
cumulative_perp_fundingi64Cumulative funding paid/received for perps precision: QUOTE_PRECISION
liquidation_margin_freedu64The amount of margin freed during liquidation. Used to force the liquidation to occur over a period of time Defaults to zero when not being liquidated precision: QUOTE_PRECISION
last_active_slotu64The last slot a user was active. Used to determine if a user is idle
next_order_idu32Every user order has an order id. This is the next order id to be used
max_margin_ratiou32Custom max initial margin ratio for the user
next_liquidation_idu16The next liquidation id to be used for user
sub_account_idu16The sub account id for this user
statusu8Whether the user is active, being liquidated or bankrupt
is_margin_trading_enabledboolWhether the user has enabled margin trading
idleboolUser is idle if they haven't interacted with the protocol in 1 week and they have no orders, perp positions or borrows Off-chain keeper bots can ignore users that are idle
open_ordersu8number of open orders
has_open_orderboolWhether or not user has open order
open_auctionsu8number of open orders with auction
has_open_auctionboolWhether or not user has open order with auction
margin_modeMarginMode
pool_idu8
padding1[u8; 3]
last_fuel_bonus_update_tsu32
padding[u8; 12]

UserStats#

Discriminator b0df881b7a4f20e3 · accounts::user_stats::UserStats.

FieldTypeDescription
authorityPubkeyThe authority for all of a users sub accounts
referrerPubkeyThe address that referred this user
feesUserFeesStats on the fees paid by the user
next_epoch_tsi64The timestamp of the next epoch Epoch is used to limit referrer rewards earned in single epoch
maker_volume30du64Rolling 30day maker volume for user precision: QUOTE_PRECISION
taker_volume30du64Rolling 30day taker volume for user precision: QUOTE_PRECISION
filler_volume30du64Rolling 30day filler volume for user precision: QUOTE_PRECISION
last_maker_volume30d_tsi64last time the maker volume was updated
last_taker_volume30d_tsi64last time the taker volume was updated
last_filler_volume30d_tsi64last time the filler volume was updated
if_staked_quote_asset_amountu64The amount of tokens staked in the quote spot markets if
number_of_sub_accountsu16The current number of sub accounts
number_of_sub_accounts_createdu16The number of sub accounts created. Can be greater than the number of sub accounts if user has deleted sub accounts
referrer_statusu8Flags for referrer status: First bit (LSB): 1 if user is a referrer, 0 otherwise Second bit: 1 if user was referred, 0 otherwise
disable_update_perp_bid_ask_twapu8
paused_operationsu8
fuel_overflow_statusu8whether the user has a FuelOverflow account
fuel_insuranceu32accumulated fuel for token amounts of insurance
fuel_depositsu32accumulated fuel for notional of deposits
fuel_borrowsu32accumulate fuel bonus for notional of borrows
fuel_positionsu32accumulated fuel for perp open interest
fuel_takeru32accumulate fuel bonus for taker volume
fuel_makeru32accumulate fuel bonus for maker volume
if_staked_gov_token_amountu64The amount of tokens staked in the governance spot markets if
last_fuel_if_bonus_update_tsu32last unix ts user stats data was used to update if fuel (u32 to save space)
padding[u8; 12]

Events#

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

NewUserRecord#

Discriminator ecba71db2a3395f9 · events::new_user_record::NewUserRecordEvent.

FieldType
tsi64
user_authorityPubkey
userPubkey
sub_account_idu16
name[u8; 32]
referrerPubkey

DepositRecord#

Discriminator b4f1dacf66872c86 · events::deposit_record::DepositRecordEvent.

FieldType
tsi64
user_authorityPubkey
userPubkey
directionDepositDirection
deposit_record_idu64
amountu64
market_indexu16
oracle_pricei64
market_deposit_balanceu128
market_withdraw_balanceu128
market_cumulative_deposit_interestu128
market_cumulative_borrow_interestu128
total_deposits_afteru64
total_withdraws_afteru64
explanationDepositExplanation
transfer_userOption<Pubkey>
signerOption<Pubkey>
user_token_amount_afteri128

SpotInterestRecord#

Discriminator b7bacbbae1bb5f82 · events::spot_interest_record::SpotInterestRecordEvent.

FieldType
tsi64
market_indexu16
deposit_balanceu128
cumulative_deposit_interestu128
borrow_balanceu128
cumulative_borrow_interestu128
optimal_utilizationu32
optimal_borrow_rateu32
max_borrow_rateu32

FundingPaymentRecord#

Discriminator 083b601489c9385f · events::funding_payment_record::FundingPaymentRecordEvent.

FieldType
tsi64
user_authorityPubkey
userPubkey
market_indexu16
funding_paymenti64
base_asset_amounti64
user_last_cumulative_fundingi64
amm_cumulative_funding_longi128
amm_cumulative_funding_shorti128

FundingRateRecord#

Discriminator 4403ff1a855b93fe · events::funding_rate_record::FundingRateRecordEvent.

FieldType
tsi64
record_idu64
market_indexu16
funding_ratei64
funding_rate_longi128
funding_rate_shorti128
cumulative_funding_rate_longi128
cumulative_funding_rate_shorti128
oracle_price_twapi64
mark_price_twapu64
period_revenuei64
base_asset_amount_with_ammi128
base_asset_amount_with_unsettled_lpi128

CurveRecord#

Discriminator 65ee28e4462e3d75 · events::curve_record::CurveRecordEvent.

FieldType
tsi64
record_idu64
peg_multiplier_beforeu128
base_asset_reserve_beforeu128
quote_asset_reserve_beforeu128
sqrt_k_beforeu128
peg_multiplier_afteru128
base_asset_reserve_afteru128
quote_asset_reserve_afteru128
sqrt_k_afteru128
base_asset_amount_longu128
base_asset_amount_shortu128
base_asset_amount_with_ammi128
total_feei128
total_fee_minus_distributionsi128
adjustment_costi128
oracle_pricei64
fill_recordu128
number_of_usersu32
market_indexu16

SignedMsgOrderRecord#

Discriminator d3c519128e56711b · events::signed_msg_order_record::SignedMsgOrderRecordEvent.

FieldType
userPubkey
hashString
matching_order_paramsOrderParams
user_order_idu32
signed_msg_order_max_slotu64
signed_msg_order_uuid[u8; 8]
tsi64

OrderRecord#

Discriminator 681340385915025a · events::order_record::OrderRecordEvent.

FieldType
tsi64
userPubkey
orderOrder

OrderActionRecord#

Discriminator e0344347c2ed6d01 · events::order_action_record::OrderActionRecordEvent.

FieldType
tsi64
actionOrderAction
action_explanationOrderActionExplanation
market_indexu16
market_typeMarketType
fillerOption<Pubkey>
filler_rewardOption<u64>
fill_record_idOption<u64>
base_asset_amount_filledOption<u64>
quote_asset_amount_filledOption<u64>
taker_feeOption<u64>
maker_feeOption<i64>
referrer_rewardOption<u32>
quote_asset_amount_surplusOption<i64>
spot_fulfillment_method_feeOption<u64>
takerOption<Pubkey>
taker_order_idOption<u32>
taker_order_directionOption<PositionDirection>
taker_order_base_asset_amountOption<u64>
taker_order_cumulative_base_asset_amount_filledOption<u64>
taker_order_cumulative_quote_asset_amount_filledOption<u64>
makerOption<Pubkey>
maker_order_idOption<u32>
maker_order_directionOption<PositionDirection>
maker_order_base_asset_amountOption<u64>
maker_order_cumulative_base_asset_amount_filledOption<u64>
maker_order_cumulative_quote_asset_amount_filledOption<u64>
oracle_pricei64
bit_flagsu8
taker_existing_quote_entry_amountOption<u64>
taker_existing_base_asset_amountOption<u64>
maker_existing_quote_entry_amountOption<u64>
maker_existing_base_asset_amountOption<u64>
trigger_priceOption<u64>
builder_idxOption<u8>
builder_feeOption<u64>

LPRecord#

Discriminator 65163626b20d8e6f · events::l_p_record::LPRecordEvent.

FieldType
tsi64
userPubkey
actionLPAction
n_sharesu64
market_indexu16
delta_base_asset_amounti64
delta_quote_asset_amounti64
pnli64

LiquidationRecord#

Discriminator 7f11006cb60de735 · events::liquidation_record::LiquidationRecordEvent.

FieldType
tsi64
liquidation_typeLiquidationType
userPubkey
liquidatorPubkey
margin_requirementu128
total_collaterali128
margin_freedu64
liquidation_idu16
bankruptbool
canceled_order_idsVec<u32>
liquidate_perpLiquidatePerpRecord
liquidate_spotLiquidateSpotRecord
liquidate_borrow_for_perp_pnlLiquidateBorrowForPerpPnlRecord
liquidate_perp_pnl_for_depositLiquidatePerpPnlForDepositRecord
perp_bankruptcyPerpBankruptcyRecord
spot_bankruptcySpotBankruptcyRecord
bit_flagsu8

SettlePnlRecord#

Discriminator 3944691a77c6d559 · events::settle_pnl_record::SettlePnlRecordEvent.

FieldType
tsi64
userPubkey
market_indexu16
pnli128
base_asset_amounti64
quote_asset_amount_afteri64
quote_entry_amounti64
settle_pricei64
explanationSettlePnlExplanation

InsuranceFundRecord#

Discriminator 38ded7eb4ec56392 · events::insurance_fund_record::InsuranceFundRecordEvent.

FieldType
tsi64
spot_market_indexu16
perp_market_indexu16
user_if_factoru32
total_if_factoru32
vault_amount_beforeu64
insurance_vault_amount_beforeu64
total_if_shares_beforeu128
total_if_shares_afteru128
amounti64

InsuranceFundStakeRecord#

Discriminator 44429c07d894fa72 · events::insurance_fund_stake_record::InsuranceFundStakeRecordEvent.

FieldType
tsi64
user_authorityPubkey
actionStakeAction
amountu64
market_indexu16
insurance_vault_amount_beforeu64
if_shares_beforeu128
user_if_shares_beforeu128
total_if_shares_beforeu128
if_shares_afteru128
user_if_shares_afteru128
total_if_shares_afteru128

InsuranceFundSwapRecord#

Discriminator 55be63cbed21e364 · events::insurance_fund_swap_record::InsuranceFundSwapRecordEvent.

FieldType
rebalance_configPubkey
in_if_total_shares_beforeu128
out_if_total_shares_beforeu128
in_if_user_shares_beforeu128
out_if_user_shares_beforeu128
in_if_total_shares_afteru128
out_if_total_shares_afteru128
in_if_user_shares_afteru128
out_if_user_shares_afteru128
tsi64
in_amountu64
out_amountu64
out_oracle_priceu64
out_oracle_price_twapi64
in_vault_amount_beforeu64
out_vault_amount_beforeu64
in_fund_vault_amount_afteru64
out_fund_vault_amount_afteru64
in_market_indexu16
out_market_indexu16

TransferProtocolIfSharesToRevenuePoolRecord#

Discriminator d1768ea7822ea497 · events::transfer_protocol_if_shares_to_revenue_pool_record::TransferProtocolIfSharesToRevenuePoolRecordEvent.

FieldType
tsi64
market_indexu16
amountu64
sharesu128
if_vault_amount_beforeu64
protocol_shares_beforeu128
transfer_amountu64

SwapRecord#

Discriminator a2bb7bc28a38faf1 · events::swap_record::SwapRecordEvent.

FieldType
tsi64
userPubkey
amount_outu64
amount_inu64
out_market_indexu16
in_market_indexu16
out_oracle_pricei64
in_oracle_pricei64
feeu64

SpotMarketVaultDepositRecord#

Discriminator b2d917bc7fbe2049 · events::spot_market_vault_deposit_record::SpotMarketVaultDepositRecordEvent.

FieldType
tsi64
market_indexu16
deposit_balanceu128
cumulative_deposit_interest_beforeu128
cumulative_deposit_interest_afteru128
deposit_token_amount_beforeu64
amountu64

DeleteUserRecord#

Discriminator 476fbe76070384de · events::delete_user_record::DeleteUserRecordEvent.

FieldType
tsi64
user_authorityPubkey
userPubkey
sub_account_idu16
keeperOption<Pubkey>

FuelSweepRecord#

Discriminator 295425f684f08308 · events::fuel_sweep_record::FuelSweepRecordEvent.

FieldType
tsi64
authorityPubkey
user_stats_fuel_insuranceu32
user_stats_fuel_depositsu32
user_stats_fuel_borrowsu32
user_stats_fuel_positionsu32
user_stats_fuel_takeru32
user_stats_fuel_makeru32
fuel_overflow_fuel_insuranceu128
fuel_overflow_fuel_depositsu128
fuel_overflow_fuel_borrowsu128
fuel_overflow_fuel_positionsu128
fuel_overflow_fuel_takeru128
fuel_overflow_fuel_makeru128

FuelSeasonRecord#

Discriminator 13897721e0f90657 · events::fuel_season_record::FuelSeasonRecordEvent.

FieldType
tsi64
authorityPubkey
fuel_insuranceu128
fuel_depositsu128
fuel_borrowsu128
fuel_positionsu128
fuel_takeru128
fuel_makeru128
fuel_totalu128

RevenueShareSettleRecord#

Discriminator 3da2590a18143b2d · events::revenue_share_settle_record::RevenueShareSettleRecordEvent.

FieldType
tsi64
builderOption<Pubkey>
referrerOption<Pubkey>
fee_settledu64
market_indexu16
market_typeMarketType
builder_sub_account_idu16
builder_total_referrer_rewardsu64
builder_total_builder_rewardsu64

LPSettleRecord#

Discriminator d0bf836ead300702 · events::l_p_settle_record::LPSettleRecordEvent.

FieldType
record_idu64
last_tsi64
last_slotu64
tsi64
slotu64
perp_market_indexu16
settle_to_lp_amounti64
perp_amm_pnl_deltai64
perp_amm_ex_fee_deltai64
lp_aumu128
lp_priceu128
lp_poolPubkey

LPSwapRecord#

Discriminator 9f3e82c4604fb0fe · events::l_p_swap_record::LPSwapRecordEvent.

FieldType
tsi64
slotu64
authorityPubkey
out_amountu128
in_amountu128
out_feei128
in_feei128
out_spot_market_indexu16
in_spot_market_indexu16
out_constituent_indexu16
in_constituent_indexu16
out_oracle_pricei64
in_oracle_pricei64
last_aumu128
last_aum_slotu64
in_market_current_weighti64
out_market_current_weighti64
in_market_target_weighti64
out_market_target_weighti64
in_swap_idu64
out_swap_idu64
lp_poolPubkey

LPMintRedeemRecord#

Discriminator 35b28e494e5b5b08 · events::l_p_mint_redeem_record::LPMintRedeemRecordEvent.

FieldType
tsi64
slotu64
authorityPubkey
descriptionu8
amountu128
feei128
spot_market_indexu16
constituent_indexu16
oracle_pricei64
mintPubkey
lp_amountu64
lp_feei64
lp_priceu128
mint_redeem_idu64
last_aumu128
last_aum_slotu64
in_market_current_weighti64
in_market_target_weighti64
lp_poolPubkey

LPBorrowLendDepositRecord#

Discriminator f2b50b38f33d4fd2 · events::l_p_borrow_lend_deposit_record::LPBorrowLendDepositRecordEvent.

FieldType
tsi64
slotu64
spot_market_indexu16
constituent_indexu16
directionDepositDirection
token_balancei64
last_token_balancei64
interest_accrued_token_amounti64
amount_deposit_withdrawu64
lp_poolPubkey

Types#

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

AddAmmConstituentMappingDatum#

Struct types::AddAmmConstituentMappingDatum.

FieldType
constituent_indexu16
perp_market_indexu16
weighti64

AMM#

Struct types::AMM.

FieldTypeDescription
oraclePubkeyoracle price data public key
historical_oracle_dataHistoricalOracleDatastores historically witnessed oracle data
base_asset_amount_per_lpi128accumulated base asset amount since inception per lp share precision: QUOTE_PRECISION
quote_asset_amount_per_lpi128accumulated quote asset amount since inception per lp share precision: QUOTE_PRECISION
fee_poolPoolBalancepartition of fees from perp market trading moved from pnl settlements
base_asset_reserveu128x reserves for constant product mm formula (x * y = k) precision: AMM_RESERVE_PRECISION
quote_asset_reserveu128y reserves for constant product mm formula (x * y = k) precision: AMM_RESERVE_PRECISION
concentration_coefu128determines how close the min/max base asset reserve sit vs base reserves allow for decreasing slippage without increasing liquidity and v.v. precision: PERCENTAGE_PRECISION
min_base_asset_reserveu128minimum base_asset_reserve allowed before AMM is unavailable precision: AMM_RESERVE_PRECISION
max_base_asset_reserveu128maximum base_asset_reserve allowed before AMM is unavailable precision: AMM_RESERVE_PRECISION
sqrt_ku128sqrt(k) in constant product mm formula (x * y = k). stored to avoid drift caused by integer math issues precision: AMM_RESERVE_PRECISION
peg_multiplieru128normalizing numerical factor for y, its use offers lowest slippage in cp-curve when market is balanced precision: PEG_PRECISION
terminal_quote_asset_reserveu128y when market is balanced. stored to save computation precision: AMM_RESERVE_PRECISION
base_asset_amount_longi128always non-negative. tracks number of total longs in market (regardless of counterparty) precision: BASE_PRECISION
base_asset_amount_shorti128always non-positive. tracks number of total shorts in market (regardless of counterparty) precision: BASE_PRECISION
base_asset_amount_with_ammi128tracks net position (longs-shorts) in market with AMM as counterparty precision: BASE_PRECISION
base_asset_amount_with_unsettled_lpi128tracks net position (longs-shorts) in market with LPs as counterparty precision: BASE_PRECISION
max_open_interestu128max allowed open interest, blocks trades that breach this value precision: BASE_PRECISION
quote_asset_amounti128sum of all user's perp quote_asset_amount in market precision: QUOTE_PRECISION
quote_entry_amount_longi128sum of all long user's quote_entry_amount in market precision: QUOTE_PRECISION
quote_entry_amount_shorti128sum of all short user's quote_entry_amount in market precision: QUOTE_PRECISION
quote_break_even_amount_longi128sum of all long user's quote_break_even_amount in market precision: QUOTE_PRECISION
quote_break_even_amount_shorti128sum of all short user's quote_break_even_amount in market precision: QUOTE_PRECISION
user_lp_sharesu128total user lp shares of sqrt_k (protocol owned liquidity = sqrt_k - last_funding_rate) precision: AMM_RESERVE_PRECISION
last_funding_ratei64last funding rate in this perp market (unit is quote per base) precision: FUNDING_RATE_PRECISION
last_funding_rate_longi64last funding rate for longs in this perp market (unit is quote per base) precision: FUNDING_RATE_PRECISION
last_funding_rate_shorti64last funding rate for shorts in this perp market (unit is quote per base) precision: QUOTE_PRECISION
last24h_avg_funding_ratei64estimate of last 24h of funding rate perp market (unit is quote per base) precision: QUOTE_PRECISION
total_feei128total fees collected by this perp market precision: QUOTE_PRECISION
total_mm_feei128total fees collected by the vAMM's bid/ask spread precision: QUOTE_PRECISION
total_exchange_feeu128total fees collected by exchange fee schedule precision: QUOTE_PRECISION
total_fee_minus_distributionsi128total fees minus any recognized upnl and pool withdraws precision: QUOTE_PRECISION
total_fee_withdrawnu128sum of all fees from fee pool withdrawn to revenue pool precision: QUOTE_PRECISION
total_liquidation_feeu128all fees collected by market for liquidations precision: QUOTE_PRECISION
cumulative_funding_rate_longi128accumulated funding rate for longs since inception in market
cumulative_funding_rate_shorti128accumulated funding rate for shorts since inception in market
total_social_lossu128accumulated social loss paid by users since inception in market
ask_base_asset_reserveu128transformed base_asset_reserve for users going long precision: AMM_RESERVE_PRECISION
ask_quote_asset_reserveu128transformed quote_asset_reserve for users going long precision: AMM_RESERVE_PRECISION
bid_base_asset_reserveu128transformed base_asset_reserve for users going short precision: AMM_RESERVE_PRECISION
bid_quote_asset_reserveu128transformed quote_asset_reserve for users going short precision: AMM_RESERVE_PRECISION
last_oracle_normalised_pricei64the last seen oracle price partially shrunk toward the amm reserve price precision: PRICE_PRECISION
last_oracle_reserve_price_spread_pcti64the gap between the oracle price and the reserve price = y * peg_multiplier / x
last_bid_price_twapu64average estimate of bid price over funding_period precision: PRICE_PRECISION
last_ask_price_twapu64average estimate of ask price over funding_period precision: PRICE_PRECISION
last_mark_price_twapu64average estimate of (bid+ask)/2 price over funding_period precision: PRICE_PRECISION
last_mark_price_twap5minu64average estimate of (bid+ask)/2 price over FIVE_MINUTES
last_update_slotu64the last blockchain slot the amm was updated
last_oracle_conf_pctu64the pct size of the oracle confidence interval precision: PERCENTAGE_PRECISION
net_revenue_since_last_fundingi64the total_fee_minus_distribution change since the last funding update precision: QUOTE_PRECISION
last_funding_rate_tsi64the last funding rate update unix_timestamp
funding_periodi64the peridocity of the funding rate updates
order_step_sizeu64the base step size (increment) of orders precision: BASE_PRECISION
order_tick_sizeu64the price tick size of orders precision: PRICE_PRECISION
min_order_sizeu64the minimum base size of an order precision: BASE_PRECISION
mm_oracle_slotu64the max base size a single user can have precision: BASE_PRECISION
volume24hu64estimated total of volume in market QUOTE_PRECISION
long_intensity_volumeu64the volume intensity of long fills against AMM
short_intensity_volumeu64the volume intensity of short fills against AMM
last_trade_tsi64the blockchain unix timestamp at the time of the last trade
mark_stdu64estimate of standard deviation of the fill (mark) prices precision: PRICE_PRECISION
oracle_stdu64estimate of standard deviation of the oracle price at each update precision: PRICE_PRECISION
last_mark_price_twap_tsi64the last unix_timestamp the mark twap was updated
base_spreadu32the minimum spread the AMM can quote. also used as step size for some spread logic increases.
max_spreadu32the maximum spread the AMM can quote
long_spreadu32the spread for asks vs the reserve price
short_spreadu32the spread for bids vs the reserve price
mm_oracle_pricei64MM oracle price
max_fill_reserve_fractionu16the fraction of total available liquidity a single fill on the AMM can consume
max_slippage_ratiou16the maximum slippage a single fill on the AMM can push
curve_update_intensityu8the update intensity of AMM formulaic updates (adjusting k). 0-100
amm_jit_intensityu8the jit intensity of AMM. larger intensity means larger participation in jit. 0 means no jit participation. (0, 100] is intensity for protocol-owned AMM. (100, 200] is intensity for user LP-owned AMM.
oracle_sourceOracleSourcethe oracle provider information. used to decode/scale the oracle public key
last_oracle_validbooltracks whether the oracle was considered valid at the last AMM update
target_base_asset_amount_per_lpi32the target value for base_asset_amount_per_lp, used during AMM JIT with LP split precision: BASE_PRECISION
per_lp_basei8expo for unit of per_lp, base 10 (if per_lp_base=X, then per_lp unit is 10^X)
oracle_low_risk_slot_delay_overridei8the override for the state.min_perp_auction_duration 0 is no override, -1 is disable speed bump, 1-100 is literal speed bump
amm_spread_adjustmenti8signed scale amm_spread similar to fee_adjustment logic (-100 = 0, 100 = double)
oracle_slot_delay_overridei8
mm_oracle_sequence_idu64
net_unsettled_funding_pnli64
quote_asset_amount_with_unsettled_lpi64
reference_price_offseti32
amm_inventory_spread_adjustmenti8signed scale amm_spread similar to fee_adjustment logic (-100 = 0, 100 = double)
reference_price_offset_deadband_pctu8
padding[u8; 2]
last_funding_oracle_twapi64

AmmCacheFixed#

Struct types::AmmCacheFixed.

FieldType
bumpu8
pad[u8; 3]
lenu32

AmmConstituentDatum#

Struct types::AmmConstituentDatum.

FieldTypeDescription
perp_market_indexu16
constituent_indexu16
padding[u8; 4]
last_slotu64
weighti64PERCENTAGE_PRECISION. The weight this constituent has on the perp market

AmmConstituentMappingFixed#

Struct types::AmmConstituentMappingFixed.

FieldType
lp_poolPubkey
bumpu8
pad[u8; 3]
lenu32

AssetTier#

Enum types::AssetTier.

Variant
Collateral
Protected
Cross
Isolated
Unlisted

AssetType#

Enum types::AssetType.

Variant
Base
Quote

BuilderInfo#

Struct types::BuilderInfo.

FieldType
authorityPubkey
max_fee_tenth_bpsu16
padding[u8; 6]

CacheInfo#

Struct types::CacheInfo.

FieldTypeDescription
oraclePubkey
last_fee_pool_token_amountu128
last_net_pnl_pool_token_amounti128
last_exchange_feesu128
last_settle_amm_ex_feesu128
last_settle_amm_pnli128
positioni64BASE PRECISION
slotu64
last_settle_amountu64
last_settle_slotu64
last_settle_tsi64
quote_owed_from_lp_pooli64
amm_inventory_limiti64
oracle_pricei64
oracle_slotu64
market_indexu16
oracle_sourceu8
oracle_validityu8
lp_status_for_perp_marketu8
amm_position_scalaru8
padding[u8; 34]

ConstituentCorrelationsFixed#

Struct types::ConstituentCorrelationsFixed.

FieldTypeDescription
lp_poolPubkey
bumpu8
pad[u8; 3]
lenu32total elements in the flattened data vec

ConstituentLpOperation#

Enum types::ConstituentLpOperation.

Variant
Swap
Deposit
Withdraw

ConstituentParams#

Struct types::ConstituentParams.

FieldType
max_weight_deviationOption<i64>
swap_fee_minOption<i64>
swap_fee_maxOption<i64>
max_borrow_token_amountOption<u64>
oracle_staleness_thresholdOption<u64>
cost_to_trade_bpsOption<i32>
constituent_derivative_indexOption<i16>
derivative_weightOption<u64>
volatilityOption<u64>
gamma_executionOption<u8>
gamma_inventoryOption<u8>
xiOption<u8>

ConstituentSpotBalance#

Struct types::ConstituentSpotBalance.

FieldTypeDescription
scaled_balanceu128The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow interest of corresponding market. precision: token precision
cumulative_depositsi64The cumulative deposits/borrows a user has made into a market precision: token mint precision
market_indexu16The market index of the corresponding spot market
balance_typeSpotBalanceTypeWhether the position is deposit or borrow
padding[u8; 5]

ConstituentStatus#

Enum types::ConstituentStatus.

Variant
ReduceOnly
Decommissioned

ConstituentTargetBaseFixed#

Struct types::ConstituentTargetBaseFixed.

FieldTypeDescription
lp_poolPubkey
bumpu8
pad[u8; 3]
lenu32total elements in the flattened data vec

ContractTier#

Enum types::ContractTier.

Variant
A
B
C
Speculative
HighlySpeculative
Isolated

ContractType#

Enum types::ContractType.

Variant
Perpetual
Future
Prediction

CurveRecord#

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

DeleteUserRecord#

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

DepositDirection#

Enum types::DepositDirection.

Variant
Deposit
Withdraw

DepositExplanation#

Enum types::DepositExplanation.

Variant
None
Transfer
Borrow
RepayBorrow
Reward

DepositRecord#

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

DriftAction#

Enum types::DriftAction.

Variant
UpdateFunding
SettlePnl
TriggerOrder
FillOrderMatch
FillOrderAmmLowRisk
FillOrderAmmImmediate
Liquidate
MarginCalc
UpdateTwap
UpdateAMMCurve
OracleOrderPrice
UseMMOraclePrice
UpdateAmmCache
UpdateLpPoolAum
LpPoolSwap

ExchangeStatus#

Enum types::ExchangeStatus.

Variant
DepositPaused
WithdrawPaused
AmmPaused
FillPaused
LiqPaused
FundingPaused
SettlePnlPaused
AmmImmediateFillPaused

FeatureBitFlags#

Enum types::FeatureBitFlags.

Variant
MmOracleUpdate
MedianTriggerPrice
BuilderCodes
BuilderReferral

FeeStructure#

Struct types::FeeStructure.

FieldType
fee_tiers[FeeTier; 10]
filler_reward_structureOrderFillerRewardStructure
referrer_reward_epoch_upper_boundu64
flat_filler_feeu64

FeeTier#

Struct types::FeeTier.

FieldType
fee_numeratoru32
fee_denominatoru32
maker_rebate_numeratoru32
maker_rebate_denominatoru32
referrer_reward_numeratoru32
referrer_reward_denominatoru32
referee_fee_numeratoru32
referee_fee_denominatoru32

FillMode#

Enum types::FillMode.

VariantFields
Fill
PlaceAndMake
PlaceAndTakebool, u8
Liquidation

FuelOverflowStatus#

Enum types::FuelOverflowStatus.

Variant
Exists

FuelSeasonRecord#

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

FuelSweepRecord#

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

FundingPaymentRecord#

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

FundingRateRecord#

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

HistoricalIndexData#

Struct types::HistoricalIndexData.

FieldTypeDescription
last_index_bid_priceu64precision: PRICE_PRECISION
last_index_ask_priceu64precision: PRICE_PRECISION
last_index_price_twapu64precision: PRICE_PRECISION
last_index_price_twap5minu64precision: PRICE_PRECISION
last_index_price_twap_tsi64unix_timestamp of last snapshot

HistoricalOracleData#

Struct types::HistoricalOracleData.

FieldTypeDescription
last_oracle_pricei64precision: PRICE_PRECISION
last_oracle_confu64precision: PRICE_PRECISION
last_oracle_delayi64number of slots since last update
last_oracle_price_twapi64precision: PRICE_PRECISION
last_oracle_price_twap5mini64precision: PRICE_PRECISION
last_oracle_price_twap_tsi64unix_timestamp of last snapshot

IfRebalanceConfigParams#

Struct types::IfRebalanceConfigParams.

FieldType
total_in_amountu64
epoch_max_in_amountu64
epoch_durationi64
out_market_indexu16
in_market_indexu16
max_slippage_bpsu16
swap_modeu8
statusu8

InsuranceClaim#

Struct types::InsuranceClaim.

FieldTypeDescription
revenue_withdraw_since_last_settlei64The amount of revenue last settled Positive if funds left the perp market, negative if funds were pulled into the perp market precision: QUOTE_PRECISION
max_revenue_withdraw_per_periodu64The max amount of revenue that can be withdrawn per period precision: QUOTE_PRECISION
quote_max_insuranceu64The max amount of insurance that perp market can use to resolve bankruptcy and pnl deficits precision: QUOTE_PRECISION
quote_settled_insuranceu64The amount of insurance that has been used to resolve bankruptcy and pnl deficits precision: QUOTE_PRECISION
last_revenue_withdraw_tsi64The last time revenue was settled in/out of market

InsuranceFund#

Struct types::InsuranceFund.

FieldType
vaultPubkey
total_sharesu128
user_sharesu128
shares_baseu128
unstaking_periodi64
last_revenue_settle_tsi64
revenue_settle_periodi64
total_factoru32
user_factoru32

InsuranceFundOperation#

Enum types::InsuranceFundOperation.

Variant
Init
Add
RequestRemove
Remove

InsuranceFundRecord#

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

InsuranceFundStakeRecord#

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

InsuranceFundSwapRecord#

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

LiquidateBorrowForPerpPnlRecord#

Struct types::LiquidateBorrowForPerpPnlRecord.

FieldType
perp_market_indexu16
market_oracle_pricei64
pnl_transferu128
liability_market_indexu16
liability_pricei64
liability_transferu128

LiquidatePerpPnlForDepositRecord#

Struct types::LiquidatePerpPnlForDepositRecord.

FieldType
perp_market_indexu16
market_oracle_pricei64
pnl_transferu128
asset_market_indexu16
asset_pricei64
asset_transferu128

LiquidatePerpRecord#

Struct types::LiquidatePerpRecord.

FieldTypeDescription
market_indexu16
oracle_pricei64
base_asset_amounti64
quote_asset_amounti64
lp_sharesu64precision: AMM_RESERVE_PRECISION
fill_record_idu64
user_order_idu32
liquidator_order_idu32
liquidator_feeu64precision: QUOTE_PRECISION
if_feeu64precision: QUOTE_PRECISION

LiquidateSpotRecord#

Struct types::LiquidateSpotRecord.

FieldTypeDescription
asset_market_indexu16
asset_pricei64
asset_transferu128
liability_market_indexu16
liability_pricei64
liability_transferu128precision: token mint precision
if_feeu64precision: token mint precision

LiquidationBitFlag#

Enum types::LiquidationBitFlag.

Variant
IsolatedPosition

LiquidationMultiplierType#

Enum types::LiquidationMultiplierType.

Variant
Discount
Premium

LiquidationRecord#

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

LiquidationType#

Enum types::LiquidationType.

Variant
LiquidatePerp
LiquidateSpot
LiquidateBorrowForPerpPnl
LiquidatePerpPnlForDeposit
PerpBankruptcy
SpotBankruptcy

LogMode#

Enum types::LogMode.

Variant
None
ExchangeOracle
MMOracle
SafeMMOracle
Margin

LPAction#

Enum types::LPAction.

Variant
AddLiquidity
RemoveLiquidity
SettleLiquidity
RemoveLiquidityDerisk

LPBorrowLendDepositRecord#

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

LPMintRedeemRecord#

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

LpPoolFeatureBitFlags#

Enum types::LpPoolFeatureBitFlags.

Variant
SettleLpPool
SwapLpPool
MintRedeemLpPool

LpPoolParams#

Struct types::LpPoolParams.

FieldType
max_settle_quote_amountOption<u64>
volatilityOption<u64>
gamma_executionOption<u8>
xiOption<u8>
max_aumOption<u128>
whitelist_mintOption<Pubkey>

LPRecord#

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

LPSettleRecord#

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

LpStatus#

Enum types::LpStatus.

Variant
Uncollateralized
Active
Decommissioning

LPSwapRecord#

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

MarginCalculationMode#

Enum types::MarginCalculationMode.

VariantFields
Standard
Liquidationmarket_to_track_margin_requirement: Option<MarketIdentifier>

MarginMode#

Enum types::MarginMode.

Variant
Default
HighLeverage
HighLeverageMaintenance

MarginRequirementType#

Enum types::MarginRequirementType.

Variant
Initial
Fill
Maintenance

MarginTypeConfig#

Enum types::MarginTypeConfig.

VariantFields
DefaultMarginRequirementType
IsolatedPositionOverridemarket_index: u16, margin_requirement_type: MarginRequirementType, default_isolated_margin_requirement_type: MarginRequirementType, cross_margin_requirement_type: MarginRequirementType
CrossMarginOverridemargin_requirement_type: MarginRequirementType, default_margin_requirement_type: MarginRequirementType

MarketConfigFlag#

Enum types::MarketConfigFlag.

Variant
DisableFormulaicKUpdate

MarketIdentifier#

Struct types::MarketIdentifier.

FieldType
market_typeMarketType
market_indexu16

MarketStatus#

Enum types::MarketStatus.

Variant
Initialized
Active
FundingPaused
AmmPaused
FillPaused
WithdrawPaused
ReduceOnly
Settlement
Delisted

MarketType#

Enum types::MarketType.

Variant
Spot
Perp

ModifyOrderId#

Enum types::ModifyOrderId.

VariantFields
UserOrderIdu8
OrderIdu32

ModifyOrderParams#

Struct types::ModifyOrderParams.

FieldType
directionOption<PositionDirection>
base_asset_amountOption<u64>
priceOption<u64>
reduce_onlyOption<bool>
post_onlyOption<PostOnlyParam>
bit_flagsOption<u8>
max_tsOption<i64>
trigger_priceOption<u64>
trigger_conditionOption<OrderTriggerCondition>
oracle_price_offsetOption<i32>
auction_durationOption<u8>
auction_start_priceOption<i64>
auction_end_priceOption<i64>
policyOption<u8>

ModifyOrderPolicy#

Enum types::ModifyOrderPolicy.

Variant
MustModify
ExcludePreviousFill

NewUserRecord#

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

OracleGuardRails#

Struct types::OracleGuardRails.

FieldType
price_divergencePriceDivergenceGuardRails
validityValidityGuardRails

OracleSource#

Enum types::OracleSource.

Variant
Pyth
Switchboard
QuoteAsset
Pyth1K
Pyth1M
PythStableCoin
Prelaunch
PythPull
Pyth1KPull
Pyth1MPull
PythStableCoinPull
SwitchboardOnDemand
PythLazer
PythLazer1K
PythLazer1M
PythLazerStableCoin

OracleValidity#

Enum types::OracleValidity.

VariantFields
NonPositive
TooVolatile
TooUncertain
StaleForMargin
InsufficientDataPoints
StaleForAMMimmediate: bool, low_risk: bool
Valid

Order#

Struct types::Order.

FieldTypeDescription
slotu64The slot the order was placed
priceu64The limit price for the order (can be 0 for market orders) For orders with an auction, this price isn't used until the auction is complete precision: PRICE_PRECISION
base_asset_amountu64The size of the order precision for perps: BASE_PRECISION precision for spot: token mint precision
base_asset_amount_filledu64The amount of the order filled precision for perps: BASE_PRECISION precision for spot: token mint precision
quote_asset_amount_filledu64The amount of quote filled for the order precision: QUOTE_PRECISION
trigger_priceu64At what price the order will be triggered. Only relevant for trigger orders precision: PRICE_PRECISION
auction_start_pricei64The start price for the auction. Only relevant for market/oracle orders precision: PRICE_PRECISION
auction_end_pricei64The end price for the auction. Only relevant for market/oracle orders precision: PRICE_PRECISION
max_tsi64The time when the order will expire
oracle_price_offseti32If set, the order limit price is the oracle price + this offset precision: PRICE_PRECISION
order_idu32The id for the order. Each users has their own order id space
market_indexu16The perp/spot market index
statusOrderStatusWhether the order is open or unused
order_typeOrderTypeThe type of order
market_typeMarketTypeWhether market is spot or perp
user_order_idu8User generated order id. Can make it easier to place/cancel orders
existing_position_directionPositionDirectionWhat the users position was when the order was placed
directionPositionDirectionWhether the user is going long or short. LONG = bid, SHORT = ask
reduce_onlyboolWhether the order is allowed to only reduce position size
post_onlyboolWhether the order must be a maker
immediate_or_cancelboolWhether the order must be canceled the same slot it is placed
trigger_conditionOrderTriggerConditionWhether the order is triggered above or below the trigger price. Only relevant for trigger orders
auction_durationu8How many slots the auction lasts
posted_slot_tailu8Last 8 bits of the slot the order was posted on-chain (not order slot for signed msg orders)
bit_flagsu8Bitflags for further classification 0: is_signed_message
padding[u8; 1]

OrderAction#

Enum types::OrderAction.

Variant
Place
Cancel
Fill
Trigger
Expire

OrderActionExplanation#

Enum types::OrderActionExplanation.

Variant
None
InsufficientFreeCollateral
OraclePriceBreachedLimitPrice
MarketOrderFilledToLimitPrice
OrderExpired
Liquidation
OrderFilledWithAMM
OrderFilledWithAMMJit
OrderFilledWithMatch
OrderFilledWithMatchJit
MarketExpired
RiskingIncreasingOrder
ReduceOnlyOrderIncreasedPosition
OrderFillWithSerum
NoBorrowLiquidity
OrderFillWithPhoenix
OrderFilledWithAMMJitLPSplit
OrderFilledWithLPJit
DeriskLp
OrderFilledWithOpenbookV2
TransferPerpPosition

OrderActionRecord#

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

OrderBitFlag#

Enum types::OrderBitFlag.

Variant
SignedMessage
OracleTriggerMarket
SafeTriggerOrder
NewTriggerReduceOnly
HasBuilder
IsIsolatedPosition

OrderFillerRewardStructure#

Struct types::OrderFillerRewardStructure.

FieldType
reward_numeratoru32
reward_denominatoru32
time_based_reward_lower_boundu128

OrderParams#

Struct types::OrderParams.

FieldType
order_typeOrderType
market_typeMarketType
directionPositionDirection
user_order_idu8
base_asset_amountu64
priceu64
market_indexu16
reduce_onlybool
post_onlyPostOnlyParam
bit_flagsu8
max_tsOption<i64>
trigger_priceOption<u64>
trigger_conditionOrderTriggerCondition
oracle_price_offsetOption<i32>
auction_durationOption<u8>
auction_start_priceOption<i64>
auction_end_priceOption<i64>

OrderParamsBitFlag#

Enum types::OrderParamsBitFlag.

Variant
ImmediateOrCancel
UpdateHighLeverageMode

OrderRecord#

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

OrderStatus#

Enum types::OrderStatus.

Variant
Init
Open
Filled
Canceled

OrderTriggerCondition#

Enum types::OrderTriggerCondition.

Variant
Above
Below
TriggeredAbove
TriggeredBelow

OrderType#

Enum types::OrderType.

Variant
Market
Limit
TriggerMarket
TriggerLimit
Oracle

OverrideAmmCacheParams#

Struct types::OverrideAmmCacheParams.

FieldType
quote_owed_from_lp_poolOption<i64>
last_settle_slotOption<u64>
last_fee_pool_token_amountOption<u128>
last_net_pnl_pool_token_amountOption<i128>
amm_position_scalarOption<u8>
amm_inventory_limitOption<i64>

PerpBankruptcyRecord#

Struct types::PerpBankruptcyRecord.

FieldType
market_indexu16
pnli128
if_paymentu128
clawback_userOption<Pubkey>
clawback_user_paymentOption<u128>
cumulative_funding_rate_deltai128

PerpFulfillmentMethod#

Enum types::PerpFulfillmentMethod.

VariantFields
AMMOption<u64>
MatchPubkey, u16, u64

PerpLpOperation#

Enum types::PerpLpOperation.

Variant
TrackAmmRevenue
SettleQuoteOwed

PerpOperation#

Enum types::PerpOperation.

Variant
UpdateFunding
AmmFill
Fill
SettlePnl
SettlePnlWithPosition
Liquidation
AmmImmediateFill
SettleRevPool

PerpPosition#

Struct types::PerpPosition.

FieldTypeDescription
last_cumulative_funding_ratei64The perp market's last cumulative funding rate. Used to calculate the funding payment owed to user precision: FUNDING_RATE_PRECISION
base_asset_amounti64the size of the users perp position precision: BASE_PRECISION
quote_asset_amounti64Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees Updated when the user open/closes position or settles pnl. Includes fees/funding precision: QUOTE_PRECISION
quote_break_even_amounti64The amount of quote the user would need to exit their position at to break even Updated when the user open/closes position or settles pnl. Includes fees/funding precision: QUOTE_PRECISION
quote_entry_amounti64The amount quote the user entered the position with. Equal to base asset amount * avg entry price Updated when the user open/closes position. Excludes fees/funding precision: QUOTE_PRECISION
open_bidsi64The amount of non reduce only trigger orders the user has open precision: BASE_PRECISION
open_asksi64The amount of non reduce only trigger orders the user has open precision: BASE_PRECISION
settled_pnli64The amount of pnl settled in this market since opening the position precision: QUOTE_PRECISION
lp_sharesu64The number of lp (liquidity provider) shares the user has in this perp market LP shares allow users to provide liquidity via the AMM precision: BASE_PRECISION
isolated_position_scaled_balanceu64The scaled balance of the isolated position precision: SPOT_BALANCE_PRECISION
last_quote_asset_amount_per_lpi64The last quote asset amount per lp the amm had Used to settle the users lp position precision: QUOTE_PRECISION
padding[u8; 2]
max_margin_ratiou16
market_indexu16The market index for the perp market
open_ordersu8The number of open orders
position_flagu8

PlaceAndTakeOrderSuccessCondition#

Enum types::PlaceAndTakeOrderSuccessCondition.

Variant
PartialFill
FullFill

PoolBalance#

Struct types::PoolBalance.

FieldTypeDescription
scaled_balanceu128To get the pool's token amount, you must multiply the scaled balance by the market's cumulative deposit interest precision: SPOT_BALANCE_PRECISION
market_indexu16The spot market the pool is for
padding[u8; 6]

PositionDirection#

Enum types::PositionDirection.

Variant
Long
Short

PositionFlag#

Enum types::PositionFlag.

Variant
IsolatedPosition
BeingLiquidated
Bankrupt

PositionUpdateType#

Enum types::PositionUpdateType.

Variant
Open
Increase
Reduce
Close
Flip

PostOnlyParam#

Enum types::PostOnlyParam.

Variant
None
MustPostOnly
TryPostOnly
Slide

PrelaunchOracleParams#

Struct types::PrelaunchOracleParams.

FieldType
perp_market_indexu16
priceOption<i64>
max_priceOption<i64>

PriceDivergenceGuardRails#

Struct types::PriceDivergenceGuardRails.

FieldType
mark_oracle_percent_divergenceu64
oracle_twap5min_percent_divergenceu64

ReferrerStatus#

Enum types::ReferrerStatus.

Variant
IsReferrer
IsReferred
BuilderReferral

RevenueShareEscrowFixed#

Struct types::RevenueShareEscrowFixed.

FieldType
authorityPubkey
referrerPubkey
referrer_boost_expire_tsu32
referrer_reward_offseti8
referee_fee_numerator_offseti8
referrer_boost_numeratori8
reserved_fixed[u8; 17]

RevenueShareOrder#

Struct types::RevenueShareOrder.

FieldTypeDescription
fees_accruedu64fees accrued so far for this order slot. This is not exclusively fees from this order_id and may include fees from other orders in the same market. This may be swept to the builder's SpotPosition during settle_pnl.
order_idu32the order_id of the current active order in this slot. It's only relevant while bit_flag = Open
fee_tenth_bpsu16the builder fee on this order, in tenths of a bps, e.g. 100 = 0.01%
market_indexu16
sub_account_idu16the subaccount_id of the user who created this order. It's only relevant while bit_flag = Open
builder_idxu8the index of the RevenueShareEscrow.approved_builders list, that this order's fee will settle to. Ignored if bit_flag = Referral.
bit_flagsu8bitflags that describe the state of the order. [RevenueShareOrderBitFlag::Init]: this order slot is available for use. [RevenueShareOrderBitFlag::Open]: this order slot is occupied, order_id is the sub_account_id's active order. [RevenueShareOrderBitFlag::Completed]: this order has been filled or canceled, and is waiting to be settled into. the builder's account order_id and sub_account_id are no longer relevant, it may be merged with other orders. [RevenueShareOrderBitFlag::Referral]: this order stores referral rewards waiting to be settled for this market. If it is set, no other bitflag should be set.
user_order_indexu8the index into the User's orders list when this RevenueShareOrder was created, make sure to verify that order_id matches.
market_typeMarketType
padding[u8; 10]

RevenueShareOrderBitFlag#

Enum types::RevenueShareOrderBitFlag.

Variant
Init
Open
Completed
Referral

RevenueShareSettleRecord#

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

ScaleOrderParams#

From the program's IDL:

Parameters for placing scale orders - multiple limit orders distributed across a price range

Struct types::ScaleOrderParams.

FieldTypeDescription
market_typeMarketType
directionPositionDirection
market_indexu16
total_base_asset_amountu64Total base asset amount to distribute across all orders
start_priceu64Starting price for the scale (in PRICE_PRECISION)
end_priceu64Ending price for the scale (in PRICE_PRECISION)
order_countu8Number of orders to place (min 2, max 32)
size_distributionSizeDistributionHow to distribute sizes across orders
reduce_onlyboolWhether orders should be reduce-only
post_onlyPostOnlyParamPost-only setting for all orders
bit_flagsu8Bit flags (e.g., for high leverage mode)
max_tsOption<i64>Maximum timestamp for orders to be valid

SettlementDirection#

Enum types::SettlementDirection.

Variant
ToLpPool
FromLpPool
None

SettlePnlExplanation#

Enum types::SettlePnlExplanation.

Variant
None
ExpiredPosition

SettlePnlMode#

Enum types::SettlePnlMode.

Variant
MustSettle
TrySettle

SettlePnlRecord#

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

SignatureVerificationError#

Enum types::SignatureVerificationError.

Variant
InvalidEd25519InstructionProgramId
InvalidEd25519InstructionDataLength
InvalidSignatureIndex
InvalidSignatureOffset
InvalidPublicKeyOffset
InvalidMessageOffset
InvalidMessageDataSize
InvalidInstructionIndex
MessageOffsetOverflow
InvalidMessageHex
InvalidMessageData
LoadInstructionAtFailed

SignedMsgOrderId#

Struct types::SignedMsgOrderId.

FieldType
uuid[u8; 8]
max_slotu64
order_idu32
paddingu32

SignedMsgOrderParamsDelegateMessage#

Struct types::SignedMsgOrderParamsDelegateMessage.

FieldType
signed_msg_order_paramsOrderParams
taker_pubkeyPubkey
slotu64
uuid[u8; 8]
take_profit_order_paramsOption<SignedMsgTriggerOrderParams>
stop_loss_order_paramsOption<SignedMsgTriggerOrderParams>
max_margin_ratioOption<u16>
builder_idxOption<u8>
builder_fee_tenth_bpsOption<u16>
isolated_position_depositOption<u64>

SignedMsgOrderParamsMessage#

Struct types::SignedMsgOrderParamsMessage.

FieldType
signed_msg_order_paramsOrderParams
sub_account_idu16
slotu64
uuid[u8; 8]
take_profit_order_paramsOption<SignedMsgTriggerOrderParams>
stop_loss_order_paramsOption<SignedMsgTriggerOrderParams>
max_margin_ratioOption<u16>
builder_idxOption<u8>
builder_fee_tenth_bpsOption<u16>
isolated_position_depositOption<u64>

SignedMsgOrderRecord#

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

SignedMsgTriggerOrderParams#

Struct types::SignedMsgTriggerOrderParams.

FieldType
trigger_priceu64
base_asset_amountu64

SignedMsgUserOrdersFixed#

Struct types::SignedMsgUserOrdersFixed.

FieldType
user_pubkeyPubkey
paddingu32
lenu32

SizeDistribution#

From the program's IDL:

How to distribute order sizes across scale orders

Enum types::SizeDistribution.

Variant
Flat
Ascending
Descending

SpotBalanceType#

Enum types::SpotBalanceType.

Variant
Deposit
Borrow

SpotBankruptcyRecord#

Struct types::SpotBankruptcyRecord.

FieldType
market_indexu16
borrow_amountu128
if_paymentu128
cumulative_deposit_interest_deltau128

SpotFulfillmentConfigStatus#

Enum types::SpotFulfillmentConfigStatus.

Variant
Enabled
Disabled

SpotFulfillmentMethod#

Enum types::SpotFulfillmentMethod.

VariantFields
ExternalMarket
MatchPubkey, u16

SpotFulfillmentType#

Enum types::SpotFulfillmentType.

Variant
SerumV3
Match
PhoenixV1
OpenbookV2

SpotInterestRecord#

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

SpotMarketVaultDepositRecord#

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

SpotOperation#

Enum types::SpotOperation.

Variant
UpdateCumulativeInterest
Fill
Deposit
Withdraw
Liquidation

SpotPosition#

Struct types::SpotPosition.

FieldTypeDescription
scaled_balanceu64The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow interest of corresponding market. precision: SPOT_BALANCE_PRECISION
open_bidsi64How many spot non reduce only trigger orders the user has open precision: token mint precision
open_asksi64How many spot non reduce only trigger orders the user has open precision: token mint precision
cumulative_depositsi64The cumulative deposits/borrows a user has made into a market precision: token mint precision
market_indexu16The market index of the corresponding spot market
balance_typeSpotBalanceTypeWhether the position is deposit or borrow
open_ordersu8Number of open orders
padding[u8; 4]

StakeAction#

Enum types::StakeAction.

Variant
Stake
UnstakeRequest
UnstakeCancelRequest
Unstake
UnstakeTransfer
StakeTransfer
AdminDeposit

SwapDirection#

Enum types::SwapDirection.

Variant
Add
Remove

SwapRecord#

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

SwapReduceOnly#

Enum types::SwapReduceOnly.

Variant
In
Out

TargetsDatum#

Struct types::TargetsDatum.

FieldType
cost_to_trade_bpsi32
padding[u8; 4]
target_basei64
last_oracle_slotu64
last_position_slotu64

TokenProgramFlag#

Enum types::TokenProgramFlag.

Variant
Token2022
TransferHook

TransferProtocolIfSharesToRevenuePoolRecord#

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

TwapPeriod#

Enum types::TwapPeriod.

Variant
FundingPeriod
FiveMin

UpdatePerpMarketSummaryStatsParams#

Struct types::UpdatePerpMarketSummaryStatsParams.

FieldType
quote_asset_amount_with_unsettled_lpOption<i64>
net_unsettled_funding_pnlOption<i64>
update_amm_summary_statsOption<bool>
exclude_total_liq_feeOption<bool>

UserFees#

Struct types::UserFees.

FieldTypeDescription
total_fee_paidu64Total taker fee paid precision: QUOTE_PRECISION
total_fee_rebateu64Total maker fee rebate precision: QUOTE_PRECISION
total_token_discountu64Total discount from holding token precision: QUOTE_PRECISION
total_referee_discountu64Total discount from being referred precision: QUOTE_PRECISION
total_referrer_rewardu64Total reward to referrer precision: QUOTE_PRECISION
current_epoch_referrer_rewardu64Total reward to referrer this epoch precision: QUOTE_PRECISION

UserStatsPausedOperations#

Enum types::UserStatsPausedOperations.

Variant
UpdateBidAskTwap
AmmAtomicFill
AmmAtomicRiskIncreasingFill

UserStatus#

Enum types::UserStatus.

Variant
BeingLiquidated
Bankrupt
ReduceOnly
AdvancedLp
ProtectedMakerOrders

ValidityGuardRails#

Struct types::ValidityGuardRails.

FieldType
slots_before_stale_for_ammi64
slots_before_stale_for_margini64
confidence_interval_max_sizeu64
too_volatile_ratioi64

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.