Orca Whirlpools decoder
Decode Orca Whirlpools instructions, accounts and events in Rust with the carbon-orca-whirlpool-decoder crate.
On this page
carbon-orca-whirlpool-decoder decodes the instructions, accounts and events of the Orca Whirlpools program (whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc): 66 instructions, 12 account types, 6 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.
| Crate | carbon-orca-whirlpool-decoder 2.0.0 |
| Install | cargo add carbon-orca-whirlpool-decoder@2. |
| Program ID | whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc (carbon_) |
| Category | DEX & AMM |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Event enum | instructions:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-orca-whirlpool-decoder/2.0.0 |
| Source | decoders/orca-whirlpool-decoder |
Other DEX and AMM decoders: BonkSwap, FluxBeam, Gavel, Heaven, Jupiter Limit Order, Jupiter Limit Order v2, Kamino Limit Order, Lifinity AMM v2, Meteora DAMM v2, Meteora DLMM, Meteora Pools, OpenBook v2, PancakeSwap, Phoenix v1, PumpSwap, Raydium AMM v4, Raydium CLMM, Raydium CPMM, Raydium Stable Swap, Stabble Stable Swap, Stabble Weighted Swap. To decode several in one pipeline, see dEX and AMM 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 Orca Whirlpools transactions from the public RPC and prints every decoded Swap instruction. Add the dependencies:
cargo add carbon-core@2.0.0 carbon-orca-whirlpool-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/fulluse {
carbon_core::{
error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
processor::Processor,
},
carbon_log_metrics::LogMetrics,
carbon_orca_whirlpool_decoder::{
instructions::OrcaWhirlpoolInstruction, OrcaWhirlpoolDecoder, 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(OrcaWhirlpoolDecoder, InstructionLogger)
.build()?
.run()
.await
}
struct InstructionLogger;
impl Processor<InstructionProcessorInputType<'_, OrcaWhirlpoolInstruction>> for InstructionLogger {
async fn process(
&mut self,
input: &InstructionProcessorInputType<'_, OrcaWhirlpoolInstruction>,
) -> CarbonResult<()> {
let signature = input.metadata.transaction_metadata.signature;
if let OrcaWhirlpoolInstruction::Swap { data, accounts, .. } = input.decoded_instruction {
println!("swap {signature}: {data:?} token_program={}", accounts.token_program);
}
Ok(())
}
}RUST_LOG=info cargo runEach Swap instruction prints one line with the transaction signature and the decoded Swap 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 OrcaWhirlpoolInstruction:: (import instructions::); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_.
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 Whirlpool account as it changes. Add the datasource and the Solana RPC types it takes:
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2use {
carbon_core::{
account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
processor::Processor,
},
carbon_log_metrics::LogMetrics,
carbon_orca_whirlpool_decoder::{
accounts::OrcaWhirlpoolAccount, OrcaWhirlpoolDecoder, 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(OrcaWhirlpoolDecoder, AccountLogger)
.build()?
.run()
.await
}
struct AccountLogger;
impl Processor<AccountProcessorInputType<'_, OrcaWhirlpoolAccount>> for AccountLogger {
async fn process(
&mut self,
input: &AccountProcessorInputType<'_, OrcaWhirlpoolAccount>,
) -> CarbonResult<()> {
if let OrcaWhirlpoolAccount::Whirlpool(whirlpool) = &input.decoded_account.data {
println!("whirlpool {}: {whirlpool:?}", input.metadata.pubkey);
}
Ok(())
}
}RUST_LOG=info cargo runEach update to a Whirlpool 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 OrcaWhirlpoolInstruction. Each is OrcaWhirlpoolInstruction::, where data and accounts are the types listed under the variant, exported from carbon_. 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:
- The instruction's program ID is
whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc. - The data starts with the variant's discriminator, and the rest deserializes into its data type.
- 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_ too. Accounts after the listed ones are in accounts. as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input. and ., 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.
CloseBundledPosition#
From the program's IDL:
Close a bundled position in a Whirlpool.
Authority
position_- authority that owns the token corresponding to this desired position bundle.bundle_ authority Parameters
bundle_- The bundle index that we'd like to close.index Special Errors
InvalidBundleIndex- If the provided bundle index is out of bounds.ClosePositionNotEmpty- The provided position account is not empty.
Discriminator 2924d8f51b556743 · data CloseBundledPosition · accounts CloseBundledPositionInstructionAccounts.
| Field | Type |
|---|---|
bundle_ | u16 |
Required accounts: 5; extras go to remaining.
Fields of CloseBundledPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | bundled_ | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | position_ | Pubkey |
| 4 | receiver | Pubkey |
| 5… | remaining | Vec< |
ClosePosition#
From the program's IDL:
Close a position in a Whirlpool. Burns the position token in the owner's wallet. ### Authority
- "position_authority" - The authority that owns the position token.
Special Errors
ClosePositionNotEmpty- The provided position account is not empty.
Discriminator 7b86510031446262 · data ClosePosition · accounts ClosePositionInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of ClosePositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | position_ | Pubkey |
| 1 | receiver | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | token_ | Pubkey |
| 6… | remaining | Vec< |
ClosePositionWithTokenExtensions#
From the program's IDL:
Close a position in a Whirlpool. Burns the position token in the owner's wallet. Mint and TokenAccount are based on Token-2022. And Mint accout will be also closed. ### Authority
- "position_authority" - The authority that owns the position token.
Special Errors
ClosePositionNotEmpty- The provided position account is not empty.
Discriminator 01b6873b9b1963df · data ClosePositionWithTokenExtensions · accounts ClosePositionWithTokenExtensionsInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of ClosePositionWithTokenExtensionsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | position_ | Pubkey |
| 1 | receiver | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | token2022_ | Pubkey |
| 6… | remaining | Vec< |
CollectFees#
From the program's IDL:
Collect fees accrued for this position.
Authority
position_- authority that owns the token corresponding to this desired position.authority
Discriminator a498cf631eba13b6 · data CollectFees · accounts CollectFeesInstructionAccounts.
No data fields.
Required accounts: 9; extras go to remaining.
Fields of CollectFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9… | remaining | Vec< |
CollectFeesV2#
From the program's IDL:
Collect fees accrued for this position.
This instruction works with both Token and Token-2022.Authority
position_- authority that owns the token corresponding to this desired position.authority
Discriminator cf755fbfe5b4e20f · data CollectFeesV2 · accounts CollectFeesV2InstructionAccounts.
| Field | Type |
|---|---|
remaining_ | Option< |
Required accounts: 13; extras go to remaining.
Fields of CollectFeesV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | memo_ | Pubkey |
| 13… | remaining | Vec< |
CollectProtocolFees#
From the program's IDL:
Collect the protocol fees accrued in this Whirlpool
Authority
collect_- assigned authority in the WhirlpoolConfig that can collect protocol feesprotocol_ fees_ authority
Discriminator 1643176296b246dc · data CollectProtocolFees · accounts CollectProtocolFeesInstructionAccounts.
No data fields.
Required accounts: 8; extras go to remaining.
Fields of CollectProtocolFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpool | Pubkey |
| 2 | collect_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8… | remaining | Vec< |
CollectProtocolFeesV2#
From the program's IDL:
Collect the protocol fees accrued in this Whirlpool
This instruction works with both Token and Token-2022.Authority
collect_- assigned authority in the WhirlpoolConfig that can collect protocol feesprotocol_ fees_ authority
Discriminator 6780de8672c816c8 · data CollectProtocolFeesV2 · accounts CollectProtocolFeesV2InstructionAccounts.
| Field | Type |
|---|---|
remaining_ | Option< |
Required accounts: 12; extras go to remaining.
Fields of CollectProtocolFeesV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpool | Pubkey |
| 2 | collect_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | memo_ | Pubkey |
| 12… | remaining | Vec< |
CollectReward#
From the program's IDL:
Collect rewards accrued for this position.
Authority
position_- authority that owns the token corresponding to this desired position.authority
Discriminator 4605845756ebb122 · data CollectReward · accounts CollectRewardInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
Required accounts: 7; extras go to remaining.
Fields of CollectRewardInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | reward_ | Pubkey |
| 5 | reward_ | Pubkey |
| 6 | token_ | Pubkey |
| 7… | remaining | Vec< |
CollectRewardV2#
From the program's IDL:
Collect rewards accrued for this position.
This instruction works with both Token and Token-2022.Authority
position_- authority that owns the token corresponding to this desired position.authority
Discriminator b16b25b4a01331d1 · data CollectRewardV2 · accounts CollectRewardV2InstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
remaining_ | Option< |
Required accounts: 9; extras go to remaining.
Fields of CollectRewardV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | reward_ | Pubkey |
| 5 | reward_mint | Pubkey |
| 6 | reward_ | Pubkey |
| 7 | reward_ | Pubkey |
| 8 | memo_ | Pubkey |
| 9… | remaining | Vec< |
DecreaseLiquidity#
From the program's IDL:
Withdraw liquidity from a position in the Whirlpool. This call also updates the position's accrued fees and rewards. ### Authority
position_- authority that owns the token corresponding to this desired position.authority Parameters
liquidity_- The total amount of Liquidity the user desires to withdraw.amount token_min_a- The minimum amount of tokenA the user is willing to withdraw.token_min_b- The minimum amount of tokenB the user is willing to withdraw.Special Errors
LiquidityZero- Provided liquidity amount is zero.LiquidityTooHigh- Provided liquidity exceeds u128::max.TokenMinSubceeded- The required token to perform this operation subceeds the user defined amount.
Discriminator a026d06f685b2c01 · data DecreaseLiquidity · accounts DecreaseLiquidityInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u128 |
token_min_a | u64 |
token_min_b | u64 |
Required accounts: 11; extras go to remaining.
Fields of DecreaseLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | token_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | position | Pubkey |
| 4 | position_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | tick_ | Pubkey |
| 10 | tick_ | Pubkey |
| 11… | remaining | Vec< |
DecreaseLiquidityV2#
From the program's IDL:
Withdraw liquidity from a position in the Whirlpool. This call also updates the position's accrued fees and rewards. This instruction works with both
Token and Token-2022. ### Authority
position_- authority that owns the token corresponding to this desired position.authority Parameters
liquidity_- The total amount of Liquidity the user desires to withdraw.amount token_min_a- The minimum amount of tokenA the user is willing to withdraw.token_min_b- The minimum amount of tokenB the user is willing to withdraw.Special Errors
LiquidityZero- Provided liquidity amount is zero.LiquidityTooHigh- Provided liquidity exceeds u128::max.TokenMinSubceeded- The required token to perform this operation subceeds the user defined amount.
Discriminator 3a7fbc3e4f52c460 · data DecreaseLiquidityV2 · accounts DecreaseLiquidityV2InstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u128 |
token_min_a | u64 |
token_min_b | u64 |
remaining_ | Option< |
Required accounts: 15; extras go to remaining.
Fields of DecreaseLiquidityV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | token_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | memo_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | position | Pubkey |
| 6 | position_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | tick_ | Pubkey |
| 14 | tick_ | Pubkey |
| 15… | remaining | Vec< |
DeletePositionBundle#
From the program's IDL:
Delete a PositionBundle account. Burns the position bundle token in the owner's wallet. ### Authority
position_- The owner that owns the position bundle token.bundle_ owner Special Errors
PositionBundleNotDeletable- The provided position bundle has open positions.
Discriminator 64196302d9ef7cad · data DeletePositionBundle · accounts DeletePositionBundleInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of DeletePositionBundleInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | position_ | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | position_ | Pubkey |
| 4 | receiver | Pubkey |
| 5 | token_ | Pubkey |
| 6… | remaining | Vec< |
DeleteTokenBadge#
From the program's IDL:
Delete a TokenBadge account.
Authority
- "token_badge_authority" - Set authority in the WhirlpoolConfigExtension
Special Errors
FeatureIsNotEnabled- If the feature flag for token badges is not enabled.
Discriminator 35924408127511b9 · data DeleteTokenBadge · accounts DeleteTokenBadgeInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of DeleteTokenBadgeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpools_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_mint | Pubkey |
| 4 | token_badge | Pubkey |
| 5 | receiver | Pubkey |
| 6… | remaining | Vec< |
IdlInclude#
Discriminator dffd79793cc1811f · data IdlInclude · accounts IdlIncludeInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of IdlIncludeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | tick_array | Pubkey |
| 1 | system_ | Pubkey |
| 2… | remaining | Vec< |
IncreaseLiquidity#
From the program's IDL:
Add liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards. ### Authority
position_- authority that owns the token corresponding to this desired position.authority Parameters
liquidity_- The total amount of Liquidity the user is willing to deposit.amount token_max_a- The maximum amount of tokenA the user is willing to deposit.token_max_b- The maximum amount of tokenB the user is willing to deposit.Special Errors
LiquidityZero- Provided liquidity amount is zero.LiquidityTooHigh- Provided liquidity exceeds u128::max.TokenMaxExceeded- The required token to perform this operation exceeds the user defined amount.
Discriminator 2e9cf3760dcdfbb2 · data IncreaseLiquidity · accounts IncreaseLiquidityInstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u128 |
token_max_a | u64 |
token_max_b | u64 |
Required accounts: 11; extras go to remaining.
Fields of IncreaseLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | token_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | position | Pubkey |
| 4 | position_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | tick_ | Pubkey |
| 10 | tick_ | Pubkey |
| 11… | remaining | Vec< |
IncreaseLiquidityByTokenAmountsV2#
From the program's IDL:
Add liquidity to a position by specifying token maxima, not liquidity.
This instruction works with both Token and Token-2022.
NOTE: This instruction is only implemented in Pinocchio, not Anchor.Authority
position_- authority that owns the token corresponding to this desired position.authority Parameters
token_max_a- The maximum amount of tokenA the user is willing to deposit.token_max_b- The maximum amount of tokenB the user is willing to deposit.min_- The minimum sqrt price allowed.sqrt_ price max_- The maximum sqrt price allowed.sqrt_ price Special Errors
LiquidityZero- Computed liquidity amount is zero.LiquidityTooHigh- Computed liquidity exceeds u128::max.TokenMaxExceeded- The required token to perform this operation exceeds the user defined amount.
Discriminator effb097cd2c6352b · data IncreaseLiquidityByTokenAmountsV2 · accounts IncreaseLiquidityByTokenAmountsV2InstructionAccounts.
| Field | Type |
|---|---|
method | IncreaseLiquidityMethod |
remaining_ | Option< |
Required accounts: 15; extras go to remaining.
Fields of IncreaseLiquidityByTokenAmountsV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | token_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | memo_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | position | Pubkey |
| 6 | position_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | tick_ | Pubkey |
| 14 | tick_ | Pubkey |
| 15… | remaining | Vec< |
IncreaseLiquidityV2#
From the program's IDL:
Add liquidity to a position in the Whirlpool. This call also updates the position's accrued fees and rewards. This instruction works with both Token and Token-2022. ### Authority
position_- authority that owns the token corresponding to this desired position.authority Parameters
liquidity_- The total amount of Liquidity the user is willing to deposit.amount token_max_a- The maximum amount of tokenA the user is willing to deposit.token_max_b- The maximum amount of tokenB the user is willing to deposit.Special Errors
LiquidityZero- Provided liquidity amount is zero.LiquidityTooHigh- Provided liquidity exceeds u128::max.TokenMaxExceeded- The required token to perform this operation exceeds the user defined amount.
Discriminator 851d59df45eeb00a · data IncreaseLiquidityV2 · accounts IncreaseLiquidityV2InstructionAccounts.
| Field | Type |
|---|---|
liquidity_ | u128 |
token_max_a | u64 |
token_max_b | u64 |
remaining_ | Option< |
Required accounts: 15; extras go to remaining.
Fields of IncreaseLiquidityV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | token_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | memo_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | position | Pubkey |
| 6 | position_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | tick_ | Pubkey |
| 14 | tick_ | Pubkey |
| 15… | remaining | Vec< |
InitializeAdaptiveFeeTier#
From the program's IDL:
Initializes an adaptive_fee_tier account usable by Whirlpools in a
WhirlpoolConfig space. ### Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Parameters
fee_- The index of the fee-tier that this adaptive fee tier will be initialized.tier_ index tick_- The tick-spacing that this fee-tier suggests the default_fee_rate for.spacing initialize_- The authority that can initialize pools with this adaptive fee-tier.pool_ authority delegated_- The authority that can set the base fee rate for pools using this adaptive fee-tier.fee_ authority default_- The default fee rate that a pool will use if the pool uses thisfee_ rate fee tier during initialization.
filter_- Period determine high frequency trading time window.period
(seconds)decay_- Period determine when the adaptive fee start decrease.period
(seconds)reduction_- Adaptive fee rate decrement rate.factor adaptive_- Adaptive fee control factor.fee_ control_ factor max_- Max volatility accumulator.volatility_ accumulator tick_- Tick group size to define tick group index.group_ size major_- Major swap threshold ticks to define major swap.swap_ threshold_ ticks Special Errors
InvalidTickSpacing- If the provided tick_spacing is 0.InvalidFeeTierIndex- If the provided fee_tier_index is same to tick_spacing.FeeRateMaxExceeded- If the provided default_fee_rate exceeds
MAX_FEE_RATE.InvalidAdaptiveFeeConstants- If the provided adaptive fee constants are invalid.
Discriminator 4d63d0c88d7b7530 · data InitializeAdaptiveFeeTier · accounts InitializeAdaptiveFeeTierInstructionAccounts.
| Field | Type |
|---|---|
fee_ | u16 |
tick_ | u16 |
initialize_ | Pubkey |
delegated_ | Pubkey |
default_ | u16 |
filter_ | u16 |
decay_ | u16 |
reduction_ | u16 |
adaptive_ | u32 |
max_ | u32 |
tick_ | u16 |
major_ | u16 |
Required accounts: 5; extras go to remaining.
Fields of InitializeAdaptiveFeeTierInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | adaptive_ | Pubkey |
| 2 | funder | Pubkey |
| 3 | fee_ | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
InitializeConfig#
From the program's IDL:
Initializes a WhirlpoolsConfig account that hosts info & authorities required to govern a set of Whirlpools.
Authority
- "authority" - Set authority that is one of ADMINS.
Parameters
fee_- Authority authorized to initialize fee-tiers and set customs fees.authority collect_- Authority authorized to collect protocol fees.protocol_ fees_ authority reward_- Authority authorized to set reward authorities in pools.emissions_ super_ authority
Discriminator d07f1501c2bec446 · data InitializeConfig · accounts InitializeConfigInstructionAccounts.
| Field | Type |
|---|---|
fee_ | Pubkey |
collect_ | Pubkey |
reward_ | Pubkey |
default_ | u16 |
Required accounts: 3; extras go to remaining.
Fields of InitializeConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | funder | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
InitializeConfigExtension#
From the program's IDL:
Initializes a WhirlpoolConfigExtension account that hosts info & authorities. ### Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Discriminator 370935097239d134 · data InitializeConfigExtension · accounts InitializeConfigExtensionInstructionAccounts.
No data fields.
Required accounts: 5; extras go to remaining.
Fields of InitializeConfigExtensionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | config_ | Pubkey |
| 2 | funder | Pubkey |
| 3 | fee_ | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
InitializeDynamicTickArray#
From the program's IDL:
Initialize a variable-length tick array for a Whirlpool.
Parameters
start_- The starting tick index for this tick-array.tick_ index Has to be a multiple of TickArray size & the tick spacing of this pool.
idempotent- If true, the instruction will not fail if the tick array already exists.Note: The idempotent option exits successfully if a FixedTickArray is present as well as a DynamicTickArray. #### Special Errors
InvalidStartTick- if the provided start tick is out of bounds or is not a multiple ofTICK_ARRAY_SIZE * tick spacing.
Discriminator 2921a5c878e78e32 · data InitializeDynamicTickArray · accounts InitializeDynamicTickArrayInstructionAccounts.
| Field | Type |
|---|---|
start_ | i32 |
idempotent | bool |
Required accounts: 4; extras go to remaining.
Fields of InitializeDynamicTickArrayInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | funder | Pubkey |
| 2 | tick_array | Pubkey |
| 3 | system_ | Pubkey |
| 4… | remaining | Vec< |
InitializeFeeTier#
From the program's IDL:
Initializes a fee_tier account usable by Whirlpools in a WhirlpoolConfig space. ### Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Parameters
tick_- The tick-spacing that this fee-tier suggests the default_fee_rate for.spacing default_- The default fee rate that a pool will use if the pool uses thisfee_ rate fee tier during initialization.
Special Errors
InvalidTickSpacing- If the provided tick_spacing is 0.FeeRateMaxExceeded- If the provided default_fee_rate exceeds MAX_FEE_RATE.
Discriminator b74a9ca070022a1e · data InitializeFeeTier · accounts InitializeFeeTierInstructionAccounts.
| Field | Type |
|---|---|
tick_ | u16 |
default_ | u16 |
Required accounts: 5; extras go to remaining.
Fields of InitializeFeeTierInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | fee_tier | Pubkey |
| 2 | funder | Pubkey |
| 3 | fee_ | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
InitializePool#
From the program's IDL:
Initializes a Whirlpool account.
Fee rate is set to the default values on the config and supplied fee_tier.Parameters
bumps- The bump value when deriving the PDA of the Whirlpool address.tick_- The desired tick spacing for this pool.spacing initial_- The desired initial sqrt-price for this poolsqrt_ price Special Errors
InvalidTokenMintOrder- The order of mints have to be ordered bySqrtPriceOutOfBounds- provided initial_sqrt_price is not between 2^-64 to 2^64
Discriminator 5fb40aac54aee828 · data InitializePool · accounts InitializePoolInstructionAccounts.
| Field | Type |
|---|---|
bumps | WhirlpoolBumps |
tick_ | u16 |
initial_ | u128 |
Required accounts: 11; extras go to remaining.
Fields of InitializePoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | token_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | funder | Pubkey |
| 4 | whirlpool | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | fee_tier | Pubkey |
| 8 | token_ | Pubkey |
| 9 | system_ | Pubkey |
| 10 | rent | Pubkey |
| 11… | remaining | Vec< |
InitializePoolV2#
From the program's IDL:
Initializes a Whirlpool account.
This instruction works with both Token and Token-2022.
Fee rate is set to the default values on the config and supplied fee_tier.Parameters
bumps- The bump value when deriving the PDA of the Whirlpool address.tick_- The desired tick spacing for this pool.spacing initial_- The desired initial sqrt-price for this poolsqrt_ price Special Errors
InvalidTokenMintOrder- The order of mints have to be ordered bySqrtPriceOutOfBounds- provided initial_sqrt_price is not between 2^-64 to 2^64
Discriminator cf2d57f21b3fcc43 · data InitializePoolV2 · accounts InitializePoolV2InstructionAccounts.
| Field | Type |
|---|---|
tick_ | u16 |
initial_ | u128 |
Required accounts: 14; extras go to remaining.
Fields of InitializePoolV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | token_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | funder | Pubkey |
| 6 | whirlpool | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | fee_tier | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | system_ | Pubkey |
| 13 | rent | Pubkey |
| 14… | remaining | Vec< |
InitializePoolWithAdaptiveFee#
From the program's IDL:
Initializes a Whirlpool account and Oracle account with adaptive fee.
Parameters
initial_- The desired initial sqrt-price for this poolsqrt_ price trade_- The timestamp when trading is enabled for this pool (within 72 hours)enable_ timestamp Special Errors
InvalidTokenMintOrder- The order of mints have to be ordered bySqrtPriceOutOfBounds- provided initial_sqrt_price is not between 2^-64 to 2^64InvalidTradeEnableTimestamp- provided trade_enable_timestamp is not within 72 hours or the adaptive fee-tier is permission-lessUnsupportedTokenMint- The provided token mint is not supported by the program (e.g. it has risky token extensions)
Discriminator 8f5e604cac7c77c7 · data InitializePoolWithAdaptiveFee · accounts InitializePoolWithAdaptiveFeeInstructionAccounts.
| Field | Type |
|---|---|
initial_ | u128 |
trade_ | Option<u64> |
Required accounts: 16; extras go to remaining.
Fields of InitializePoolWithAdaptiveFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | token_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | funder | Pubkey |
| 6 | initialize_ | Pubkey |
| 7 | whirlpool | Pubkey |
| 8 | oracle | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | adaptive_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | token_ | Pubkey |
| 14 | system_ | Pubkey |
| 15 | rent | Pubkey |
| 16… | remaining | Vec< |
InitializePositionBundle#
From the program's IDL:
Initializes a PositionBundle account that bundles several positions.
A unique token will be minted to represent the position bundle in the users wallet.
Discriminator 752df1951812c241 · data InitializePositionBundle · accounts InitializePositionBundleInstructionAccounts.
No data fields.
Required accounts: 9; extras go to remaining.
Fields of InitializePositionBundleInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | position_ | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | position_ | Pubkey |
| 4 | funder | Pubkey |
| 5 | token_ | Pubkey |
| 6 | system_ | Pubkey |
| 7 | rent | Pubkey |
| 8 | associated_ | Pubkey |
| 9… | remaining | Vec< |
InitializePositionBundleWithMetadata#
From the program's IDL:
Initializes a PositionBundle account that bundles several positions.
A unique token will be minted to represent the position bundle in the users wallet. Additional Metaplex metadata is appended to identify the token.
Discriminator 5d7c10b3f98373f5 · data InitializePositionBundleWithMetadata · accounts InitializePositionBundleWithMetadataInstructionAccounts.
No data fields.
Required accounts: 12; extras go to remaining.
Fields of InitializePositionBundleWithMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | position_ | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | funder | Pubkey |
| 6 | metadata_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | system_ | Pubkey |
| 9 | rent | Pubkey |
| 10 | associated_ | Pubkey |
| 11 | metadata_ | Pubkey |
| 12… | remaining | Vec< |
InitializeReward#
From the program's IDL:
Initialize reward for a Whirlpool. A pool can only support up to a set number of rewards. ### Authority
- "reward_authority" - assigned authority by the reward_super_authority for the specified
reward-index in this Whirlpool
Parameters
reward_- The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS)index Special Errors
InvalidRewardIndex- If the provided reward index doesn't match the lowest uninitializedindex in this pool, or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.
Discriminator 5f87c0c4f281e644 · data InitializeReward · accounts InitializeRewardInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
Required accounts: 8; extras go to remaining.
Fields of InitializeRewardInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | reward_ | Pubkey |
| 1 | funder | Pubkey |
| 2 | whirlpool | Pubkey |
| 3 | reward_mint | Pubkey |
| 4 | reward_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | system_ | Pubkey |
| 7 | rent | Pubkey |
| 8… | remaining | Vec< |
InitializeRewardV2#
From the program's IDL:
Initialize reward for a Whirlpool. A pool can only support up to a set number of rewards. This instruction works with both Token and Token-2022.
Authority
- "reward_authority" - assigned authority by the reward_super_authority for the specified
reward-index in this Whirlpool
Parameters
reward_- The reward index that we'd like to initialize. (0 <= index <= NUM_REWARDS)index Special Errors
InvalidRewardIndex- If the provided reward index doesn't match the lowest uninitializedindex in this pool, or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.
Discriminator 5b014d32ebe58531 · data InitializeRewardV2 · accounts InitializeRewardV2InstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
Required accounts: 9; extras go to remaining.
Fields of InitializeRewardV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | reward_ | Pubkey |
| 1 | funder | Pubkey |
| 2 | whirlpool | Pubkey |
| 3 | reward_mint | Pubkey |
| 4 | reward_ | Pubkey |
| 5 | reward_ | Pubkey |
| 6 | reward_ | Pubkey |
| 7 | system_ | Pubkey |
| 8 | rent | Pubkey |
| 9… | remaining | Vec< |
InitializeTickArray#
From the program's IDL:
Initializes a fixed-length tick_array account to represent a tick-range in a
Whirlpool. ### Parameters
start_- The starting tick index for this tick-array.tick_ index Has to be a multiple of TickArray size & the tick spacing of this pool.
Special Errors
InvalidStartTick- if the provided start tick is out of bounds or is not a multiple ofTICK_ARRAY_SIZE * tick spacing.
Discriminator 0bbcc1d68d5b95b8 · data InitializeTickArray · accounts InitializeTickArrayInstructionAccounts.
| Field | Type |
|---|---|
start_ | i32 |
Required accounts: 4; extras go to remaining.
Fields of InitializeTickArrayInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | funder | Pubkey |
| 2 | tick_array | Pubkey |
| 3 | system_ | Pubkey |
| 4… | remaining | Vec< |
InitializeTokenBadge#
From the program's IDL:
Initialize a TokenBadge account.
Authority
- "token_badge_authority" - Set authority in the WhirlpoolConfigExtension
Special Errors
FeatureIsNotEnabled- If the feature flag for token badges is not enabled.
Discriminator fd4dcd5f1be059df · data InitializeTokenBadge · accounts InitializeTokenBadgeInstructionAccounts.
No data fields.
Required accounts: 7; extras go to remaining.
Fields of InitializeTokenBadgeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpools_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_mint | Pubkey |
| 4 | token_badge | Pubkey |
| 5 | funder | Pubkey |
| 6 | system_ | Pubkey |
| 7… | remaining | Vec< |
LockPosition#
From the program's IDL:
Lock the position to prevent any liquidity changes.
Authority
position_- The authority that owns the position token.authority Special Errors
PositionAlreadyLocked- The provided position is already locked.PositionNotLockable- The provided position is not lockable (e.g. An empty position).
Discriminator e33e02fcf70aabb9 · data LockPosition · accounts LockPositionInstructionAccounts.
| Field | Type |
|---|---|
lock_type | LockType |
Required accounts: 9; extras go to remaining.
Fields of LockPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | funder | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | lock_config | Pubkey |
| 6 | whirlpool | Pubkey |
| 7 | token2022_ | Pubkey |
| 8 | system_ | Pubkey |
| 9… | remaining | Vec< |
MigrateRepurposeRewardAuthoritySpace#
From the program's IDL:
Migration instruction to repurpose the reward authority space in the
Whirlpool. TODO: This instruction should be removed once all pools have been migrated.
Discriminator d6a1f84f9862ace7 · data MigrateRepurposeRewardAuthoritySpace · accounts MigrateRepurposeRewardAuthoritySpaceInstructionAccounts.
No data fields.
Required accounts: 1; extras go to remaining.
Fields of MigrateRepurposeRewardAuthoritySpaceInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1… | remaining | Vec< |
OpenBundledPosition#
From the program's IDL:
Open a bundled position in a Whirlpool. No new tokens are issued because the owner of the position bundle becomes the owner of the position.
The position will start off with 0 liquidity.Authority
position_- authority that owns the token corresponding to this desired position bundle.bundle_ authority Parameters
bundle_- The bundle index that we'd like to open.index tick_- The tick specifying the lower end of the position range.lower_ index tick_- The tick specifying the upper end of the position range.upper_ index Special Errors
InvalidBundleIndex- If the provided bundle index is out of bounds.InvalidTickIndex- If a provided tick is out of bounds, out of order or not a multiple ofthe tick-spacing in this pool.
Discriminator a9717eabd5acd431 · data OpenBundledPosition · accounts OpenBundledPositionInstructionAccounts.
| Field | Type |
|---|---|
bundle_ | u16 |
tick_ | i32 |
tick_ | i32 |
Required accounts: 8; extras go to remaining.
Fields of OpenBundledPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | bundled_ | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | position_ | Pubkey |
| 4 | whirlpool | Pubkey |
| 5 | funder | Pubkey |
| 6 | system_ | Pubkey |
| 7 | rent | Pubkey |
| 8… | remaining | Vec< |
OpenPosition#
From the program's IDL:
Open a position in a Whirlpool. A unique token will be minted to represent the position in the users wallet. The position will start off with 0 liquidity. ### Parameters
tick_- The tick specifying the lower end of the position range.lower_ index tick_- The tick specifying the upper end of the position range.upper_ index Special Errors
InvalidTickIndex- If a provided tick is out of bounds, out of order or not a multiple ofthe tick-spacing in this pool.
Discriminator 87802f4d0f98f031 · data OpenPosition · accounts OpenPositionInstructionAccounts.
| Field | Type |
|---|---|
bumps | OpenPositionBumps |
tick_ | i32 |
tick_ | i32 |
Required accounts: 10; extras go to remaining.
Fields of OpenPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | funder | Pubkey |
| 1 | owner | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | whirlpool | Pubkey |
| 6 | token_ | Pubkey |
| 7 | system_ | Pubkey |
| 8 | rent | Pubkey |
| 9 | associated_ | Pubkey |
| 10… | remaining | Vec< |
OpenPositionWithMetadata#
From the program's IDL:
Open a position in a Whirlpool. A unique token will be minted to represent the position in the users wallet. Additional Metaplex metadata is appended to identify the token. The position will start off with 0 liquidity.
Parameters
tick_- The tick specifying the lower end of the position range.lower_ index tick_- The tick specifying the upper end of the position range.upper_ index Special Errors
InvalidTickIndex- If a provided tick is out of bounds, out of order or not a multiple ofthe tick-spacing in this pool.
Discriminator f21d86303a6e0e3c · data OpenPositionWithMetadata · accounts OpenPositionWithMetadataInstructionAccounts.
| Field | Type |
|---|---|
bumps | OpenPositionWithMetadataBumps |
tick_ | i32 |
tick_ | i32 |
Required accounts: 13; extras go to remaining.
Fields of OpenPositionWithMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | funder | Pubkey |
| 1 | owner | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | position_ | Pubkey |
| 6 | whirlpool | Pubkey |
| 7 | token_ | Pubkey |
| 8 | system_ | Pubkey |
| 9 | rent | Pubkey |
| 10 | associated_ | Pubkey |
| 11 | metadata_ | Pubkey |
| 12 | metadata_ | Pubkey |
| 13… | remaining | Vec< |
OpenPositionWithTokenExtensions#
From the program's IDL:
Open a position in a Whirlpool. A unique token will be minted to represent the position in the users wallet. Additional TokenMetadata extension is initialized to identify the token. Mint and TokenAccount are based on
Token-2022. The position will start off with 0 liquidity.Parameters
tick_- The tick specifying the lower end of the position range.lower_ index tick_- The tick specifying the upper end of the position range.upper_ index with_- If true, the token metadata extension will be initialized.token_ metadata_ extension Special Errors
InvalidTickIndex- If a provided tick is out of bounds, out of order or not a multiple ofthe tick-spacing in this pool.
Discriminator d42f5f5c726683fa · data OpenPositionWithTokenExtensions · accounts OpenPositionWithTokenExtensionsInstructionAccounts.
| Field | Type |
|---|---|
tick_ | i32 |
tick_ | i32 |
with_ | bool |
Required accounts: 10; extras go to remaining.
Fields of OpenPositionWithTokenExtensionsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | funder | Pubkey |
| 1 | owner | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | whirlpool | Pubkey |
| 6 | token2022_ | Pubkey |
| 7 | system_ | Pubkey |
| 8 | associated_ | Pubkey |
| 9 | metadata_ | Pubkey |
| 10… | remaining | Vec< |
RepositionLiquidityV2#
From the program's IDL:
An atomic instruction that repositions liquidity for a position through the following steps:
- Withdraws liquidity from the current position range
- Resets the position to a new tick range
- Adds liquidity to the new position range
- Restores fees and rewards
This instruction works with both Token and Token-2022.
Authority
position_- authority that owns the token corresponding to this desired position.authority Parameters
new_- The new tick index for the lower end of the position range.tick_ lower_ index new_- The new tick index for the upper end of the position range.tick_ upper_ index new_- The total amount of Liquidity the user is willing to deposit.liquidity_ amount existing_- The minimum amount of tokenA the user is willing to withdraw from the existing range.range_ token_ min_ a existing_- The minimum amount of tokenB the user is willing to withdraw from the existing range.range_ token_ min_ b new_- The maximum amount of tokenA the user is willing to deposit into the new range.range_ token_ max_ a new_- The maximum amount of tokenB the user is willing to deposit into the new range.range_ token_ max_ b Special Errors
LiquidityZero- Provided liquidity amount is zero.LiquidityTooHigh- Provided liquidity exceeds u128::max.TokenMaxExceeded- The required token to perform this operation exceeds the user defined amount.TokenMinSubceeded- The required token to perform this operation subceeds the user defined amount.InvalidTickIndex- If a provided tick is out of bounds, out of order or not a multiple ofthe tick-spacing in this pool.
SameTickRangeNotAllowed- The provided tick range is the same as the current tick range.
Discriminator bfa9e00b83139efd · data RepositionLiquidityV2 · accounts RepositionLiquidityV2InstructionAccounts.
| Field | Type |
|---|---|
new_ | i32 |
new_ | i32 |
method | RepositionLiquidityMethod |
remaining_ | Option< |
Required accounts: 19; extras go to remaining.
Fields of RepositionLiquidityV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | token_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | memo_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | funder | Pubkey |
| 6 | position | Pubkey |
| 7 | position_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | token_ | Pubkey |
| 14 | existing_ | Pubkey |
| 15 | existing_ | Pubkey |
| 16 | new_ | Pubkey |
| 17 | new_ | Pubkey |
| 18 | system_ | Pubkey |
| 19… | remaining | Vec< |
ResetPositionRange#
From the program's IDL:
Reset the position range to a new range.
Authority
position_- The authority that owns the position token.authority Parameters
new_- The new tick specifying the lower end of the position range.tick_ lower_ index new_- The new tick specifying the upper end of the position range.tick_ upper_ index Special Errors
InvalidTickIndex- If a provided tick is out of bounds, out of order or not a multiple ofthe tick-spacing in this pool.
ClosePositionNotEmpty- The provided position account is not empty.SameTickRangeNotAllowed- The provided tick range is the same as the current tick range.
Discriminator a47bb48dc264a0af · data ResetPositionRange · accounts ResetPositionRangeInstructionAccounts.
| Field | Type |
|---|---|
new_ | i32 |
new_ | i32 |
Required accounts: 6; extras go to remaining.
Fields of ResetPositionRangeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | funder | Pubkey |
| 1 | position_ | Pubkey |
| 2 | whirlpool | Pubkey |
| 3 | position | Pubkey |
| 4 | position_ | Pubkey |
| 5 | system_ | Pubkey |
| 6… | remaining | Vec< |
SetAdaptiveFeeConstants#
From the program's IDL:
Sets specific adaptive fee constants for a pool. Only the provided constants will be updated, others remain unchanged. Caller should avoid invoking this instruction when a pool's adaptive fee is high to prevent LP revenue loss
Authority
fee_- Set authority in the WhirlpoolsConfigauthority Parameters
All parameters are optional. Only provided values will be updated.
filter_- Period determine high frequency trading time window.period
(seconds)decay_- Period determine when the adaptive fee start decrease.period
(seconds)reduction_- Adaptive fee rate decrement rate.factor adaptive_- Adaptive fee control factor.fee_ control_ factor max_- Max volatility accumulator.volatility_ accumulator tick_- Tick group size to define tick group index.group_ size major_- Major swap threshold ticks to define major swap.swap_ threshold_ ticks Special Errors
InvalidAdaptiveFeeConstants- If the resulting constants are invalid for the pool's tick_spacing.AdaptiveFeeConstantsUnchanged- If the provided adaptive fee constants are unchanged from the existing constants.
Discriminator 859ed4bded0c4927 · data SetAdaptiveFeeConstants · accounts SetAdaptiveFeeConstantsInstructionAccounts.
| Field | Type |
|---|---|
filter_ | Option<u16> |
decay_ | Option<u16> |
reduction_ | Option<u16> |
adaptive_ | Option<u32> |
max_ | Option<u32> |
tick_ | Option<u16> |
major_ | Option<u16> |
Required accounts: 4; extras go to remaining.
Fields of SetAdaptiveFeeConstantsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | whirlpools_ | Pubkey |
| 2 | oracle | Pubkey |
| 3 | fee_ | Pubkey |
| 4… | remaining | Vec< |
SetCollectProtocolFeesAuthority#
From the program's IDL:
Sets the fee authority to collect protocol fees for a WhirlpoolConfig.
Only the current collect protocol fee authority has permission to invoke this instruction. ### Authority
- "fee_authority" - Set authority that can collect protocol fees in the
WhirlpoolConfig
Discriminator 22965df48be1e943 · data SetCollectProtocolFeesAuthority · accounts SetCollectProtocolFeesAuthorityInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of SetCollectProtocolFeesAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | collect_ | Pubkey |
| 2 | new_ | Pubkey |
| 3… | remaining | Vec< |
SetConfigExtensionAuthority#
From the program's IDL:
Sets the config extension authority for a WhirlpoolsConfigExtension.
Only the current config extension authority has permission to invoke this instruction. ### Authority
- "config_extension_authority" - Set authority in the
WhirlpoolConfigExtension
Discriminator 2c5ef17418bc3c8f · data SetConfigExtensionAuthority · accounts SetConfigExtensionAuthorityInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of SetConfigExtensionAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpools_ | Pubkey |
| 2 | config_ | Pubkey |
| 3 | new_ | Pubkey |
| 4… | remaining | Vec< |
SetConfigFeatureFlag#
From the program's IDL:
Sets the feature flag for a WhirlpoolConfig.
Authority
- "authority" - Set authority that is one of ADMINS.
Parameters
feature_- The feature flag that the WhirlpoolConfig will use.flag
Discriminator 47ade41243f7d239 · data SetConfigFeatureFlag · accounts SetConfigFeatureFlagInstructionAccounts.
| Field | Type |
|---|---|
feature_ | ConfigFeatureFlag |
Required accounts: 2; extras go to remaining.
Fields of SetConfigFeatureFlagInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | authority | Pubkey |
| 2… | remaining | Vec< |
SetDefaultBaseFeeRate#
From the program's IDL:
Set the default_base_fee_rate for an AdaptiveFeeTier
Only the current fee authority in WhirlpoolsConfig has permission to invoke this instruction. ### Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Parameters
default_- The default base fee rate that a pool will use if the pool uses thisbase_ fee_ rate adaptive fee-tier during initialization.
Special Errors
FeeRateMaxExceeded- If the provided default_fee_rate exceeds MAX_FEE_RATE.
Discriminator e54254fba486b707 · data SetDefaultBaseFeeRate · accounts SetDefaultBaseFeeRateInstructionAccounts.
| Field | Type |
|---|---|
default_ | u16 |
Required accounts: 3; extras go to remaining.
Fields of SetDefaultBaseFeeRateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | adaptive_ | Pubkey |
| 2 | fee_ | Pubkey |
| 3… | remaining | Vec< |
SetDefaultFeeRate#
From the program's IDL:
Set the default_fee_rate for a FeeTier
Only the current fee authority has permission to invoke this instruction.Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Parameters
default_- The default fee rate that a pool will use if the pool uses thisfee_ rate fee tier during initialization.
Special Errors
FeeRateMaxExceeded- If the provided default_fee_rate exceeds MAX_FEE_RATE.
Discriminator 76d7d69db6e5d0e4 · data SetDefaultFeeRate · accounts SetDefaultFeeRateInstructionAccounts.
| Field | Type |
|---|---|
default_ | u16 |
Required accounts: 3; extras go to remaining.
Fields of SetDefaultFeeRateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | fee_tier | Pubkey |
| 2 | fee_ | Pubkey |
| 3… | remaining | Vec< |
SetDefaultProtocolFeeRate#
From the program's IDL:
Sets the default protocol fee rate for a WhirlpoolConfig
Protocol fee rate is represented as a basis point.
Only the current fee authority has permission to invoke this instruction.Authority
- "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig
Parameters
default_- Rate that is referenced during the initialization of a Whirlpool using this config.protocol_ fee_ rate Special Errors
ProtocolFeeRateMaxExceeded- If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE.
Discriminator 6bcdf9e297235600 · data SetDefaultProtocolFeeRate · accounts SetDefaultProtocolFeeRateInstructionAccounts.
| Field | Type |
|---|---|
default_ | u16 |
Required accounts: 2; extras go to remaining.
Fields of SetDefaultProtocolFeeRateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | fee_ | Pubkey |
| 2… | remaining | Vec< |
SetDelegatedFeeAuthority#
From the program's IDL:
Sets the delegated fee authority for an AdaptiveFeeTier.
The delegated fee authority can set the fee rate for individual pools initialized with the adaptive fee-tier. Only the current fee authority in
WhirlpoolsConfig has permission to invoke this instruction. ### Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Discriminator c1eae7938a39037a · data SetDelegatedFeeAuthority · accounts SetDelegatedFeeAuthorityInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of SetDelegatedFeeAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | adaptive_ | Pubkey |
| 2 | fee_ | Pubkey |
| 3 | new_ | Pubkey |
| 4… | remaining | Vec< |
SetFeeAuthority#
From the program's IDL:
Sets the fee authority for a WhirlpoolConfig.
The fee authority can set the fee & protocol fee rate for individual pools or set the default fee rate for newly minted pools.
Only the current fee authority has permission to invoke this instruction.Authority
- "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig
Discriminator 1f013257ed656184 · data SetFeeAuthority · accounts SetFeeAuthorityInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of SetFeeAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | fee_ | Pubkey |
| 2 | new_ | Pubkey |
| 3… | remaining | Vec< |
SetFeeRate#
From the program's IDL:
Sets the fee rate for a Whirlpool.
Fee rate is represented as hundredths of a basis point.
Only the current fee authority has permission to invoke this instruction.Authority
- "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig
Parameters
fee_rate- The rate that the pool will use to calculate fees going onwards.Special Errors
FeeRateMaxExceeded- If the provided fee_rate exceeds MAX_FEE_RATE.
Discriminator 35f38941088c9e06 · data SetFeeRate · accounts SetFeeRateInstructionAccounts.
| Field | Type |
|---|---|
fee_rate | u16 |
Required accounts: 3; extras go to remaining.
Fields of SetFeeRateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpool | Pubkey |
| 2 | fee_ | Pubkey |
| 3… | remaining | Vec< |
SetFeeRateByDelegatedFeeAuthority#
From the program's IDL:
Sets the fee rate for a Whirlpool by the delegated fee authority in
AdaptiveFeeTier. Fee rate is represented as hundredths of a basis point.Authority
- "delegated_fee_authority" - Set authority that can modify pool fees in the AdaptiveFeeTier
Parameters
fee_rate- The rate that the pool will use to calculate fees going onwards.Special Errors
FeeRateMaxExceeded- If the provided fee_rate exceeds MAX_FEE_RATE.
Discriminator 7979367283e6a268 · data SetFeeRateByDelegatedFeeAuthority · accounts SetFeeRateByDelegatedFeeAuthorityInstructionAccounts.
| Field | Type |
|---|---|
fee_rate | u16 |
Required accounts: 3; extras go to remaining.
Fields of SetFeeRateByDelegatedFeeAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | adaptive_ | Pubkey |
| 2 | delegated_ | Pubkey |
| 3… | remaining | Vec< |
SetInitializePoolAuthority#
From the program's IDL:
Sets the initialize pool authority for an AdaptiveFeeTier.
Only the initialize pool authority can initialize pools with the adaptive fee-tier. Only the current fee authority in WhirlpoolsConfig has permission to invoke this instruction. ### Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Discriminator 7d2b7feb951a6aec · data SetInitializePoolAuthority · accounts SetInitializePoolAuthorityInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of SetInitializePoolAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | adaptive_ | Pubkey |
| 2 | fee_ | Pubkey |
| 3 | new_ | Pubkey |
| 4… | remaining | Vec< |
SetPresetAdaptiveFeeConstants#
From the program's IDL:
Sets the adaptive fee constants for an AdaptiveFeeTier.
Only the current fee authority in WhirlpoolsConfig has permission to invoke this instruction. ### Authority
- "fee_authority" - Set authority in the WhirlpoolConfig
Parameters
filter_- Period determine high frequency trading time window. (seconds)period decay_- Period determine when the adaptive fee start decrease.period
(seconds)reduction_- Adaptive fee rate decrement rate.factor adaptive_- Adaptive fee control factor.fee_ control_ factor max_- Max volatility accumulator.volatility_ accumulator tick_- Tick group size to define tick group index.group_ size major_- Major swap threshold ticks to define major swap.swap_ threshold_ ticks
Discriminator 84b94294535886c6 · data SetPresetAdaptiveFeeConstants · accounts SetPresetAdaptiveFeeConstantsInstructionAccounts.
| Field | Type |
|---|---|
filter_ | u16 |
decay_ | u16 |
reduction_ | u16 |
adaptive_ | u32 |
max_ | u32 |
tick_ | u16 |
major_ | u16 |
Required accounts: 3; extras go to remaining.
Fields of SetPresetAdaptiveFeeConstantsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | adaptive_ | Pubkey |
| 2 | fee_ | Pubkey |
| 3… | remaining | Vec< |
SetProtocolFeeRate#
From the program's IDL:
Sets the protocol fee rate for a Whirlpool.
Protocol fee rate is represented as a basis point.
Only the current fee authority has permission to invoke this instruction.Authority
- "fee_authority" - Set authority that can modify pool fees in the WhirlpoolConfig
Parameters
protocol_- The rate that the pool will use to calculate protocol fees going onwards.fee_ rate Special Errors
ProtocolFeeRateMaxExceeded- If the provided default_protocol_fee_rate exceeds MAX_PROTOCOL_FEE_RATE.
Discriminator 5f0704329a4f9c83 · data SetProtocolFeeRate · accounts SetProtocolFeeRateInstructionAccounts.
| Field | Type |
|---|---|
protocol_ | u16 |
Required accounts: 3; extras go to remaining.
Fields of SetProtocolFeeRateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpool | Pubkey |
| 2 | fee_ | Pubkey |
| 3… | remaining | Vec< |
SetRewardAuthority#
From the program's IDL:
Set the whirlpool reward authority at the provided
reward_.index
Only the current reward authority for this reward index has permission to invoke this instruction. ### Authority
- "reward_authority" - Set authority that can control reward emission for this particular reward.
Special Errors
InvalidRewardIndex- If the provided reward index doesn't match the lowest uninitializedindex in this pool, or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.
Discriminator 2227b7fc531c557f · data SetRewardAuthority · accounts SetRewardAuthorityInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
Required accounts: 3; extras go to remaining.
Fields of SetRewardAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | reward_ | Pubkey |
| 2 | new_ | Pubkey |
| 3… | remaining | Vec< |
SetRewardAuthorityBySuperAuthority#
From the program's IDL:
Set the whirlpool reward authority at the provided
reward_.index
Only the current reward super authority has permission to invoke this instruction. ### Authority
- "reward_authority" - Set authority that can control reward emission for this particular reward.
Special Errors
InvalidRewardIndex- If the provided reward index doesn't match the lowest uninitializedindex in this pool, or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.
Discriminator f09ac9c6945d3819 · data SetRewardAuthorityBySuperAuthority · accounts SetRewardAuthorityBySuperAuthorityInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
Required accounts: 4; extras go to remaining.
Fields of SetRewardAuthorityBySuperAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpool | Pubkey |
| 2 | reward_ | Pubkey |
| 3 | new_ | Pubkey |
| 4… | remaining | Vec< |
SetRewardEmissions#
From the program's IDL:
Set the reward emissions for a reward in a Whirlpool.
Authority
- "reward_authority" - assigned authority by the reward_super_authority for the specified
reward-index in this Whirlpool
Parameters
reward_- The reward index (0 <= index <= NUM_REWARDS) that we'd like to modify.index emissions_- The amount of rewards emitted in this pool.per_ second_ x64 Special Errors
RewardVaultAmountInsufficient- The amount of rewards in the reward vault cannot emitmore than a day of desired emissions.
InvalidTimestamp- Provided timestamp is not in order with the previous timestamp.InvalidRewardIndex- If the provided reward index doesn't match the lowest uninitializedindex in this pool, or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.
Discriminator 0dc556a86db01bf4 · data SetRewardEmissions · accounts SetRewardEmissionsInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
emissions_ | u128 |
Required accounts: 3; extras go to remaining.
Fields of SetRewardEmissionsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | reward_ | Pubkey |
| 2 | reward_ | Pubkey |
| 3… | remaining | Vec< |
SetRewardEmissionsSuperAuthority#
From the program's IDL:
Set the whirlpool reward super authority for a WhirlpoolConfig
Only the current reward super authority has permission to invoke this instruction. This instruction will not change the authority on anyWhirlpoolRewardInfowhirlpool rewards. ### Authority
- "reward_emissions_super_authority" - Set authority that can control reward authorities for all pools in this config space.
Discriminator cf05c8d17a3852b7 · data SetRewardEmissionsSuperAuthority · accounts SetRewardEmissionsSuperAuthorityInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of SetRewardEmissionsSuperAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | reward_ | Pubkey |
| 2 | new_ | Pubkey |
| 3… | remaining | Vec< |
SetRewardEmissionsV2#
From the program's IDL:
Set the reward emissions for a reward in a Whirlpool.
This instruction works with both Token and Token-2022.Authority
- "reward_authority" - assigned authority by the reward_super_authority for the specified
reward-index in this Whirlpool
Parameters
reward_- The reward index (0 <= index <= NUM_REWARDS) that we'd like to modify.index emissions_- The amount of rewards emitted in this pool.per_ second_ x64 Special Errors
RewardVaultAmountInsufficient- The amount of rewards in the reward vault cannot emitmore than a day of desired emissions.
InvalidTimestamp- Provided timestamp is not in order with the previous timestamp.InvalidRewardIndex- If the provided reward index doesn't match the lowest uninitializedindex in this pool, or exceeds NUM_REWARDS, or all reward slots for this pool has been initialized.
Discriminator 72e44820c130a066 · data SetRewardEmissionsV2 · accounts SetRewardEmissionsV2InstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
emissions_ | u128 |
Required accounts: 3; extras go to remaining.
Fields of SetRewardEmissionsV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | reward_ | Pubkey |
| 2 | reward_ | Pubkey |
| 3… | remaining | Vec< |
SetTokenBadgeAttribute#
From the program's IDL:
Set an attribute on a TokenBadge account.
Authority
- "token_badge_authority" - Set authority in the WhirlpoolConfigExtension
Parameters
attribute- The attribute to set on the TokenBadge account.Special Errors
FeatureIsNotEnabled- If the feature flag for token badges is not enabled.
Discriminator e05841218a93f689 · data SetTokenBadgeAttribute · accounts SetTokenBadgeAttributeInstructionAccounts.
| Field | Type |
|---|---|
attribute | TokenBadgeAttribute |
Required accounts: 5; extras go to remaining.
Fields of SetTokenBadgeAttributeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpools_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_mint | Pubkey |
| 4 | token_badge | Pubkey |
| 5… | remaining | Vec< |
SetTokenBadgeAuthority#
From the program's IDL:
Sets the token badge authority for a WhirlpoolsConfigExtension.
Only the config extension authority has permission to invoke this instruction. ### Authority
- "config_extension_authority" - Set authority in the
WhirlpoolConfigExtension
Discriminator cfca0420cd4f0db2 · data SetTokenBadgeAuthority · accounts SetTokenBadgeAuthorityInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of SetTokenBadgeAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpools_ | Pubkey |
| 1 | whirlpools_ | Pubkey |
| 2 | config_ | Pubkey |
| 3 | new_ | Pubkey |
| 4… | remaining | Vec< |
Swap#
From the program's IDL:
Perform a swap in this Whirlpool
Authority
- "token_authority" - The authority to withdraw tokens from the input token account.
Parameters
amount- The amount of input or output token to swap from (depending on amount_specified_is_input).other_- The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).amount_ threshold sqrt_- The maximum/minimum price the swap will swap to.price_ limit amount_- Specifies the token the parameterspecified_ is_ input amountrepresents. If true, the amount represents the input token of the swap.a_to_b- The direction of the swap. True if swapping from A to B. False if swapping from B to A.Special Errors
ZeroTradableAmount- User provided parameteramountis 0.InvalidSqrtPriceLimitDirection- User provided parametersqrt_does not match the direction of the trade.price_ limit SqrtPriceOutOfBounds- User provided parametersqrt_is over Whirlppool's max/min bounds for sqrt-price.price_ limit InvalidTickArraySequence- User provided tick-arrays are not in sequential order required to proceed in this trade direction.TickArraySequenceInvalidIndex- The swap loop attempted to access an invalid array index during the query of the next initialized tick.TickArrayIndexOutofBounds- The swap loop attempted to access an invalid array index during tick crossing.LiquidityOverflow- Liquidity value overflowed 128bits during tick crossing.InvalidTickSpacing- The swap pool was initialized with tick-spacing of 0.
Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
other_ | u64 |
sqrt_ | u128 |
amount_ | bool |
a_to_b | bool |
Required accounts: 11; extras go to remaining.
Fields of SwapInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | token_ | Pubkey |
| 2 | whirlpool | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | tick_array0 | Pubkey |
| 8 | tick_array1 | Pubkey |
| 9 | tick_array2 | Pubkey |
| 10 | oracle | Pubkey |
| 11… | remaining | Vec< |
SwapV2#
From the program's IDL:
Perform a swap in this Whirlpool
This instruction works with both Token and Token-2022.Authority
- "token_authority" - The authority to withdraw tokens from the input token account.
Parameters
amount- The amount of input or output token to swap from (depending on amount_specified_is_input).other_- The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).amount_ threshold sqrt_- The maximum/minimum price the swap will swap to.price_ limit amount_- Specifies the token the parameterspecified_ is_ input amountrepresents. If true, the amount represents the input token of the swap.a_to_b- The direction of the swap. True if swapping from A to B. False if swapping from B to A.Special Errors
ZeroTradableAmount- User provided parameteramountis 0.InvalidSqrtPriceLimitDirection- User provided parametersqrt_does not match the direction of the trade.price_ limit SqrtPriceOutOfBounds- User provided parametersqrt_is over Whirlppool's max/min bounds for sqrt-price.price_ limit InvalidTickArraySequence- User provided tick-arrays are not in sequential order required to proceed in this trade direction.TickArraySequenceInvalidIndex- The swap loop attempted to access an invalid array index during the query of the next initialized tick.TickArrayIndexOutofBounds- The swap loop attempted to access an invalid array index during tick crossing.LiquidityOverflow- Liquidity value overflowed 128bits during tick crossing.InvalidTickSpacing- The swap pool was initialized with tick-spacing of 0.
Discriminator 2b04ed0b1ac91e62 · data SwapV2 · accounts SwapV2InstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
other_ | u64 |
sqrt_ | u128 |
amount_ | bool |
a_to_b | bool |
remaining_ | Option< |
Required accounts: 15; extras go to remaining.
Fields of SwapV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | token_ | Pubkey |
| 2 | memo_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | whirlpool | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | tick_array0 | Pubkey |
| 12 | tick_array1 | Pubkey |
| 13 | tick_array2 | Pubkey |
| 14 | oracle | Pubkey |
| 15… | remaining | Vec< |
TransferLockedPosition#
From the program's IDL:
Transfer a locked position to a different token account.
Authority
position_- The authority that owns the position token.authority
Discriminator b379e52e438ac28a · data TransferLockedPosition · accounts TransferLockedPositionInstructionAccounts.
No data fields.
Required accounts: 8; extras go to remaining.
Fields of TransferLockedPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | position_ | Pubkey |
| 1 | receiver | Pubkey |
| 2 | position | Pubkey |
| 3 | position_ | Pubkey |
| 4 | position_ | Pubkey |
| 5 | destination_ | Pubkey |
| 6 | lock_config | Pubkey |
| 7 | token2022_ | Pubkey |
| 8… | remaining | Vec< |
TwoHopSwap#
From the program's IDL:
Perform a two-hop swap in this Whirlpool
Authority
- "token_authority" - The authority to withdraw tokens from the input token account.
Parameters
amount- The amount of input or output token to swap from (depending on amount_specified_is_input).other_- The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).amount_ threshold amount_- Specifies the token the parameterspecified_ is_ input amountrepresents. If true, the amount represents the input token of the swap.a_to_b_one- The direction of the swap of hop one. True if swapping from
A to B. False if swapping from B to A.a_to_b_two- The direction of the swap of hop two. True if swapping from
A to B. False if swapping from B to A.sqrt_- The maximum/minimum price the swap will swap to in the first hop.price_ limit_ one sqrt_- The maximum/minimum price the swap will swap to in the second hop.price_ limit_ two Special Errors
ZeroTradableAmount- User provided parameteramountis 0.InvalidSqrtPriceLimitDirection- User provided parametersqrt_does not match the direction of the trade.price_ limit SqrtPriceOutOfBounds- User provided parametersqrt_is over Whirlppool's max/min bounds for sqrt-price.price_ limit InvalidTickArraySequence- User provided tick-arrays are not in sequential order required to proceed in this trade direction.TickArraySequenceInvalidIndex- The swap loop attempted to access an invalid array index during the query of the next initialized tick.TickArrayIndexOutofBounds- The swap loop attempted to access an invalid array index during tick crossing.LiquidityOverflow- Liquidity value overflowed 128bits during tick crossing.InvalidTickSpacing- The swap pool was initialized with tick-spacing of 0.InvalidIntermediaryMint- Error if the intermediary mint between hop one and two do not equal.DuplicateTwoHopPool- Error if whirlpool one & two are the same pool.
Discriminator c360ed6c44a2dbe6 · data TwoHopSwap · accounts TwoHopSwapInstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
other_ | u64 |
amount_ | bool |
a_to_b_one | bool |
a_to_b_two | bool |
sqrt_ | u128 |
sqrt_ | u128 |
Required accounts: 20; extras go to remaining.
Fields of TwoHopSwapInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_ | Pubkey |
| 1 | token_ | Pubkey |
| 2 | whirlpool_ | Pubkey |
| 3 | whirlpool_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | tick_ | Pubkey |
| 13 | tick_ | Pubkey |
| 14 | tick_ | Pubkey |
| 15 | tick_ | Pubkey |
| 16 | tick_ | Pubkey |
| 17 | tick_ | Pubkey |
| 18 | oracle_one | Pubkey |
| 19 | oracle_two | Pubkey |
| 20… | remaining | Vec< |
TwoHopSwapV2#
From the program's IDL:
Perform a two-hop swap in this Whirlpool
This instruction works with both Token and Token-2022.Authority
- "token_authority" - The authority to withdraw tokens from the input token account.
Parameters
amount- The amount of input or output token to swap from (depending on amount_specified_is_input).other_- The maximum/minimum of input/output token to swap into (depending on amount_specified_is_input).amount_ threshold amount_- Specifies the token the parameterspecified_ is_ input amountrepresents. If true, the amount represents the input token of the swap.a_to_b_one- The direction of the swap of hop one. True if swapping from
A to B. False if swapping from B to A.a_to_b_two- The direction of the swap of hop two. True if swapping from
A to B. False if swapping from B to A.sqrt_- The maximum/minimum price the swap will swap to in the first hop.price_ limit_ one sqrt_- The maximum/minimum price the swap will swap to in the second hop.price_ limit_ two Special Errors
ZeroTradableAmount- User provided parameteramountis 0.InvalidSqrtPriceLimitDirection- User provided parametersqrt_does not match the direction of the trade.price_ limit SqrtPriceOutOfBounds- User provided parametersqrt_is over Whirlppool's max/min bounds for sqrt-price.price_ limit InvalidTickArraySequence- User provided tick-arrays are not in sequential order required to proceed in this trade direction.TickArraySequenceInvalidIndex- The swap loop attempted to access an invalid array index during the query of the next initialized tick.TickArrayIndexOutofBounds- The swap loop attempted to access an invalid array index during tick crossing.LiquidityOverflow- Liquidity value overflowed 128bits during tick crossing.InvalidTickSpacing- The swap pool was initialized with tick-spacing of 0.InvalidIntermediaryMint- Error if the intermediary mint between hop one and two do not equal.DuplicateTwoHopPool- Error if whirlpool one & two are the same pool.
Discriminator ba8fd11dfe02c275 · data TwoHopSwapV2 · accounts TwoHopSwapV2InstructionAccounts.
| Field | Type |
|---|---|
amount | u64 |
other_ | u64 |
amount_ | bool |
a_to_b_one | bool |
a_to_b_two | bool |
sqrt_ | u128 |
sqrt_ | u128 |
remaining_ | Option< |
Required accounts: 24; extras go to remaining.
Fields of TwoHopSwapV2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool_ | Pubkey |
| 1 | whirlpool_ | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | token_ | Pubkey |
| 14 | token_ | Pubkey |
| 15 | tick_ | Pubkey |
| 16 | tick_ | Pubkey |
| 17 | tick_ | Pubkey |
| 18 | tick_ | Pubkey |
| 19 | tick_ | Pubkey |
| 20 | tick_ | Pubkey |
| 21 | oracle_one | Pubkey |
| 22 | oracle_two | Pubkey |
| 23 | memo_ | Pubkey |
| 24… | remaining | Vec< |
UpdateFeesAndRewards#
From the program's IDL:
Update the accrued fees and rewards for a position.
Special Errors
TickNotFound- Provided tick array account does not contain the tick for this position.LiquidityZero- Position has zero liquidity and therefore already has the most updated fees and reward values.
Discriminator 9ae6fa0decd14bdf · data UpdateFeesAndRewards · accounts UpdateFeesAndRewardsInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of UpdateFeesAndRewardsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | whirlpool | Pubkey |
| 1 | position | Pubkey |
| 2 | tick_ | Pubkey |
| 3 | tick_ | Pubkey |
| 4… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | program | Pubkey |
| 1 | event_ | Pubkey |
| 2… | remaining | Vec< |
Accounts#
Variants of OrcaWhirlpoolAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
AdaptiveFeeTier#
Discriminator 931090742f92952e · accounts::.
| Field | Type |
|---|---|
whirlpools_ | Pubkey |
fee_ | u16 |
tick_ | u16 |
initialize_ | Pubkey |
delegated_ | Pubkey |
default_ | u16 |
filter_ | u16 |
decay_ | u16 |
reduction_ | u16 |
adaptive_ | u32 |
max_ | u32 |
tick_ | u16 |
major_ | u16 |
DynamicTickArray#
Discriminator 11d8f68ee1c7da38 · accounts::.
| Field | Type |
|---|---|
start_ | i32 |
whirlpool | Pubkey |
tick_bitmap | u128 |
ticks | [DynamicTick; 88] |
FeeTier#
Discriminator 384b9f4c8e44be69 · accounts::.
| Field | Type |
|---|---|
whirlpools_ | Pubkey |
tick_ | u16 |
default_ | u16 |
LockConfig#
Discriminator 6a2fee9f7c0ca0c0 · accounts::.
| Field | Type |
|---|---|
position | Pubkey |
position_ | Pubkey |
whirlpool | Pubkey |
locked_ | u64 |
lock_type | LockTypeLabel |
Oracle#
Discriminator 8bc283b38cb3e5f4 · accounts::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
trade_ | u64 |
adaptive_ | AdaptiveFeeConstants |
adaptive_ | AdaptiveFeeVariables |
reserved | [u8; 128] |
Position#
Discriminator aabc8fe47a40f7d0 · accounts::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
position_ | Pubkey |
liquidity | u128 |
tick_ | i32 |
tick_ | i32 |
fee_ | u128 |
fee_owed_a | u64 |
fee_ | u128 |
fee_owed_b | u64 |
reward_ | [PositionRewardInfo; 3] |
PositionBundle#
Discriminator 81a9af41b95f2064 · accounts::.
| Field | Type |
|---|---|
position_ | Pubkey |
position_ | [u8; 32] |
TickArray#
Discriminator 4561bdbe6e0742bb · accounts::.
| Field | Type |
|---|---|
start_ | i32 |
ticks | [Tick; 88] |
whirlpool | Pubkey |
TokenBadge#
Discriminator 74dbcce5f974ff96 · accounts::.
| Field | Type |
|---|---|
whirlpools_ | Pubkey |
token_mint | Pubkey |
attribute_ | bool |
Whirlpool#
Discriminator 3f95d10ce1806309 · accounts::.
| Field | Type |
|---|---|
whirlpools_ | Pubkey |
whirlpool_ | [u8; 1] |
tick_ | u16 |
fee_ | [u8; 2] |
fee_rate | u16 |
protocol_ | u16 |
liquidity | u128 |
sqrt_price | u128 |
tick_ | i32 |
protocol_ | u64 |
protocol_ | u64 |
token_ | Pubkey |
token_ | Pubkey |
fee_ | u128 |
token_ | Pubkey |
token_ | Pubkey |
fee_ | u128 |
reward_ | u64 |
reward_ | [WhirlpoolRewardInfo; 3] |
WhirlpoolsConfig#
Discriminator 9d1431e0d957c1fe · accounts::.
| Field | Type |
|---|---|
fee_ | Pubkey |
collect_ | Pubkey |
reward_ | Pubkey |
default_ | u16 |
feature_ | u16 |
WhirlpoolsConfigExtension#
Discriminator 0263d7a3f01a993a · accounts::.
| Field | Type |
|---|---|
whirlpools_ | Pubkey |
config_ | Pubkey |
token_ | Pubkey |
Events#
Variants of instructions::, decoded from the CpiEvent instruction. Each wraps a struct from carbon_. The discriminator is the 8-byte event discriminator that follows the e445a52e51cb9a1d CPI-event tag.
LiquidityDecreased#
Discriminator a601244770cab5ab · events::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
position | Pubkey |
tick_ | i32 |
tick_ | i32 |
liquidity | u128 |
token_ | u64 |
token_ | u64 |
token_ | u64 |
token_ | u64 |
LiquidityIncreased#
Discriminator 1e0790b566fe9ba1 · events::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
position | Pubkey |
tick_ | i32 |
tick_ | i32 |
liquidity | u128 |
token_ | u64 |
token_ | u64 |
token_ | u64 |
token_ | u64 |
LiquidityRepositioned#
Discriminator 5f82b584fb32c326 · events::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
position | Pubkey |
existing_ | i32 |
existing_ | i32 |
new_ | i32 |
new_ | i32 |
existing_ | u128 |
new_ | u128 |
existing_ | u64 |
existing_ | u64 |
new_ | u64 |
new_ | u64 |
token_ | u64 |
token_ | u64 |
is_ | bool |
token_ | u64 |
token_ | u64 |
is_ | bool |
PoolInitialized#
Discriminator 6476ad570cc6fee5 · events::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
whirlpools_ | Pubkey |
token_ | Pubkey |
token_ | Pubkey |
tick_ | u16 |
token_ | Pubkey |
token_ | Pubkey |
decimals_a | u8 |
decimals_b | u8 |
initial_ | u128 |
PositionOpened#
Discriminator edaff3e693756579 · events::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
position | Pubkey |
tick_ | i32 |
tick_ | i32 |
Traded#
Discriminator e1ca49af932ba096 · events::.
| Field | Type |
|---|---|
whirlpool | Pubkey |
a_to_b | bool |
pre_ | u128 |
post_ | u128 |
input_ | u64 |
output_ | u64 |
input_ | u64 |
output_ | u64 |
lp_fee | u64 |
protocol_ | u64 |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
AccountsType#
Enum types::.
| Variant |
|---|
TransferHookA |
TransferHookB |
TransferHookReward |
TransferHookInput |
TransferHookIntermediate |
TransferHookOutput |
SupplementalTickArrays |
SupplementalTickArraysOne |
SupplementalTickArraysTwo |
TransferHookDepositA |
TransferHookDepositB |
TransferHookWithdrawalA |
TransferHookWithdrawalB |
AdaptiveFeeConstants#
Struct types::.
| Field | Type |
|---|---|
filter_ | u16 |
decay_ | u16 |
reduction_ | u16 |
adaptive_ | u32 |
max_ | u32 |
tick_ | u16 |
major_ | u16 |
reserved | [u8; 16] |
AdaptiveFeeVariables#
Struct types::.
| Field | Type |
|---|---|
last_ | u64 |
last_ | u64 |
volatility_ | u32 |
tick_ | i32 |
volatility_ | u32 |
reserved | [u8; 16] |
ConfigFeatureFlag#
Enum types::.
| Variant | Fields |
|---|---|
TokenBadge | bool |
DynamicTick#
Enum types::.
| Variant | Fields |
|---|---|
Uninitialized | |
Initialized | DynamicTickData |
DynamicTickData#
Struct types::.
| Field | Type |
|---|---|
liquidity_ | i128 |
liquidity_ | u128 |
fee_ | u128 |
fee_ | u128 |
reward_ | [u128; 3] |
IncreaseLiquidityMethod#
Enum types::.
| Variant | Fields |
|---|---|
ByTokenAmounts | token_max_a: u64, token_max_b: u64, min_: u128, max_: u128 |
LiquidityDecreased#
Struct types::. Same fields as the LiquidityDecreased event.
LiquidityIncreased#
Struct types::. Same fields as the LiquidityIncreased event.
LiquidityRepositioned#
Struct types::. Same fields as the LiquidityRepositioned event.
LockType#
Enum types::.
| Variant |
|---|
Permanent |
LockTypeLabel#
Enum types::.
| Variant |
|---|
Permanent |
OpenPositionBumps#
Struct types::.
| Field | Type |
|---|---|
position_ | u8 |
OpenPositionWithMetadataBumps#
Struct types::.
| Field | Type |
|---|---|
position_ | u8 |
metadata_ | u8 |
PoolInitialized#
Struct types::. Same fields as the PoolInitialized event.
PositionOpened#
Struct types::. Same fields as the PositionOpened event.
PositionRewardInfo#
Struct types::.
| Field | Type |
|---|---|
growth_ | u128 |
amount_owed | u64 |
RemainingAccountsInfo#
Struct types::.
| Field | Type |
|---|---|
slices | Vec< |
RemainingAccountsSlice#
Struct types::.
| Field | Type |
|---|---|
accounts_ | AccountsType |
length | u8 |
RepositionLiquidityMethod#
Enum types::.
| Variant | Fields |
|---|---|
ByLiquidity | new_: u128, existing_: u64, existing_: u64, new_: u64, new_: u64 |
Tick#
Struct types::Tick.
| Field | Type |
|---|---|
initialized | bool |
liquidity_ | i128 |
liquidity_ | u128 |
fee_ | u128 |
fee_ | u128 |
reward_ | [u128; 3] |
TokenBadgeAttribute#
Enum types::.
| Variant | Fields |
|---|---|
RequireNonTransferablePosition | bool |
Traded#
Struct types::. Same fields as the Traded event.
WhirlpoolBumps#
Struct types::.
| Field | Type |
|---|---|
whirlpool_ | u8 |
WhirlpoolRewardInfo#
From the program's IDL:
Stores the state relevant for tracking liquidity mining rewards at the
Whirlpoollevel. These values are used in conjunction withPositionRewardInfo,Tick., andreward_ growths_ outside Whirlpool.to determine how many rewards are earned by open positions.\ reward_ last_ updated_ timestamp
Struct types::.
| Field | Type | Description |
|---|---|---|
mint | Pubkey | Reward token mint. |
vault | Pubkey | Reward vault token account. |
extension | [u8; 32] | reward_infos[0]: Authority account that has permission to initialize the reward and set emissions. reward_infos[1]: used for a struct that contains fields for extending the functionality of Whirlpool. reward_infos[2]: reserved for future use. Historical notes: Originally, this was a field named "authority", but it was found that there was no opportunity to set different authorities for the three rewards. Therefore, the use of this field was changed for Whirlpool's future extensibility. |
emissions_ | u128 | Q64.64 number that indicates how many tokens per second are earned per unit of liquidity. |
growth_ | u128 | Q64.64 number that tracks the total tokens earned per unit of liquidity since the reward emissions were turned on. |