BonkSwap decoder
Decode BonkSwap instructions and accounts in Rust with carbon-bonkswap-decoder 2.0.0. Program ID BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p.
On this page
carbon-bonkswap-decoder decodes the instructions and accounts of the BonkSwap program (BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p): 19 instructions, 5 account types. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.
| Crate | carbon-bonkswap-decoder 2.0.0 |
| Install | cargo add carbon-bonkswap-decoder@2. |
| Program ID | BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p (carbon_) |
| Category | DEX & AMM |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-bonkswap-decoder/2.0.0 |
| Source | decoders/bonkswap-decoder |
Other DEX and AMM decoders: 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, Orca Whirlpools, 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 BonkSwap transactions from the public RPC and prints every decoded Swap instruction. Add the dependencies:
cargo add carbon-core@2.0.0 carbon-bonkswap-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_bonkswap_decoder::{instructions::BonkswapInstruction, BonkswapDecoder, 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(BonkswapDecoder, InstructionLogger)
.build()?
.run()
.await
}
struct InstructionLogger;
impl Processor<InstructionProcessorInputType<'_, BonkswapInstruction>> for InstructionLogger {
async fn process(
&mut self,
input: &InstructionProcessorInputType<'_, BonkswapInstruction>,
) -> CarbonResult<()> {
let signature = input.metadata.transaction_metadata.signature;
if let BonkswapInstruction::Swap { data, accounts, .. } = input.decoded_instruction {
println!("swap {signature}: {data:?} state={}", accounts.state);
}
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.
Decode accounts#
The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with programSubscribe on the public WebSocket endpoint and prints every decoded Pool account as it changes. Add the datasource and the Solana RPC types it takes:
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_bonkswap_decoder::{accounts::BonkswapAccount, BonkswapDecoder, 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(BonkswapDecoder, AccountLogger)
.build()?
.run()
.await
}
struct AccountLogger;
impl Processor<AccountProcessorInputType<'_, BonkswapAccount>> for AccountLogger {
async fn process(
&mut self,
input: &AccountProcessorInputType<'_, BonkswapAccount>,
) -> CarbonResult<()> {
if let BonkswapAccount::Pool(pool) = &input.decoded_account.data {
println!("pool {}: {pool:?}", input.metadata.pubkey);
}
Ok(())
}
}RUST_LOG=info cargo runEach update to a Pool account prints its address and decoded fields; the program runs until you stop it. Cargo resolves solana-client to 4.2.2, the exact version the datasource pins, so both use the same RpcProgramAccountsConfig type. To load every existing account once instead of streaming changes, see load account state.
Instructions#
Variants of BonkswapInstruction. Each is BonkswapInstruction::, 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
BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p. - 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.
AddSupply#
Discriminator 50664639eb58ef08 · data AddSupply · accounts AddSupplyInstructionAccounts.
Required accounts: 13; extras go to remaining.
Fields of AddSupplyInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | admin_ | Pubkey |
| 9 | admin_ | Pubkey |
| 10 | admin_ | Pubkey |
| 11 | admin | Pubkey |
| 12 | token_ | Pubkey |
| 13… | remaining | Vec< |
AddTokens#
Discriminator 1cda1ed1af9b99f0 · data AddTokens · accounts AddTokensInstructionAccounts.
Required accounts: 25; extras go to remaining.
Fields of AddTokensInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | provider | Pubkey |
| 4 | token_x | Pubkey |
| 5 | token_y | Pubkey |
| 6 | token_marco | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | owner_ | Pubkey |
| 10 | owner_ | Pubkey |
| 11 | pool_ | Pubkey |
| 12 | pool_ | Pubkey |
| 13 | owner_ | Pubkey |
| 14 | owner_ | Pubkey |
| 15 | owner_ | Pubkey |
| 16 | token_ | Pubkey |
| 17 | token_ | Pubkey |
| 18 | token_ | Pubkey |
| 19 | owner | Pubkey |
| 20 | program_ | Pubkey |
| 21 | system_ | Pubkey |
| 22 | token_ | Pubkey |
| 23 | associated_ | Pubkey |
| 24 | rent | Pubkey |
| 25… | remaining | Vec< |
ClosePool#
Discriminator 8cbdd117ef3eef0b · data ClosePool · accounts ClosePoolInstructionAccounts.
No data fields.
Required accounts: 15; extras go to remaining.
Fields of ClosePoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | pool_ | Pubkey |
| 9 | pool_ | Pubkey |
| 10 | buyback_ | Pubkey |
| 11 | buyback_ | Pubkey |
| 12 | admin | Pubkey |
| 13 | program_ | Pubkey |
| 14 | token_ | Pubkey |
| 15… | remaining | Vec< |
CreateDualFarm#
Discriminator 2ab4678ace2bd062 · data CreateDualFarm · accounts CreateDualFarmInstructionAccounts.
Required accounts: 16; extras go to remaining.
Fields of CreateDualFarmInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | token_marco | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | admin_ | Pubkey |
| 10 | admin_ | Pubkey |
| 11 | admin | Pubkey |
| 12 | program_ | Pubkey |
| 13 | system_ | Pubkey |
| 14 | token_ | Pubkey |
| 15 | rent | Pubkey |
| 16… | remaining | Vec< |
CreateFarm#
Discriminator 4a3b80a057ae99c2 · data CreateFarm · accounts CreateFarmInstructionAccounts.
| Field | Type |
|---|---|
supply | Token |
duration | u64 |
bump | u8 |
Required accounts: 13; extras go to remaining.
Fields of CreateFarmInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | token_marco | Pubkey |
| 6 | token_ | Pubkey |
| 7 | admin_ | Pubkey |
| 8 | admin | Pubkey |
| 9 | program_ | Pubkey |
| 10 | system_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | rent | Pubkey |
| 13… | remaining | Vec< |
CreatePool#
Discriminator e992d18ecf6840bc · data CreatePool · accounts CreatePoolInstructionAccounts.
| Field | Type |
|---|---|
lp_fee | FixedPoint |
buyback_fee | FixedPoint |
project_fee | FixedPoint |
mercanti_ | FixedPoint |
initial_ | Token |
initial_ | Token |
bump | u8 |
Required accounts: 14; extras go to remaining.
Fields of CreatePoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_x | Pubkey |
| 3 | token_y | Pubkey |
| 4 | pool_ | Pubkey |
| 5 | pool_ | Pubkey |
| 6 | admin_ | Pubkey |
| 7 | admin_ | Pubkey |
| 8 | admin | Pubkey |
| 9 | project_ | Pubkey |
| 10 | program_ | Pubkey |
| 11 | system_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | rent | Pubkey |
| 14… | remaining | Vec< |
CreateProvider#
Discriminator 4a35d3ae26a8e3b1 · data CreateProvider · accounts CreateProviderInstructionAccounts.
Required accounts: 13; extras go to remaining.
Fields of CreateProviderInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | farm | Pubkey |
| 2 | provider | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | pool_ | Pubkey |
| 6 | pool_ | Pubkey |
| 7 | owner_ | Pubkey |
| 8 | owner_ | Pubkey |
| 9 | owner | Pubkey |
| 10 | system_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | rent | Pubkey |
| 13… | remaining | Vec< |
CreateState#
Discriminator d6d3d14f6b69f7de · data CreateState · accounts CreateStateInstructionAccounts.
| Field | Type |
|---|---|
nonce | u8 |
Required accounts: 4; extras go to remaining.
Fields of CreateStateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | admin | Pubkey |
| 2 | program_ | Pubkey |
| 3 | system_ | Pubkey |
| 4… | remaining | Vec< |
CreateTripleFarm#
Discriminator 9a1ab49112c987ab · data CreateTripleFarm · accounts CreateTripleFarmInstructionAccounts.
Required accounts: 19; extras go to remaining.
Fields of CreateTripleFarmInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | token_marco | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | admin_ | Pubkey |
| 12 | admin_ | Pubkey |
| 13 | admin_ | Pubkey |
| 14 | admin | Pubkey |
| 15 | program_ | Pubkey |
| 16 | system_ | Pubkey |
| 17 | token_ | Pubkey |
| 18 | rent | Pubkey |
| 19… | remaining | Vec< |
ResetFarm#
Discriminator 2f4de97576373d71 · data ResetFarm · accounts ResetFarmInstructionAccounts.
No data fields.
Required accounts: 17; extras go to remaining.
Fields of ResetFarmInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | token_marco | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | admin_ | Pubkey |
| 10 | admin_ | Pubkey |
| 11 | admin_ | Pubkey |
| 12 | admin | Pubkey |
| 13 | program_ | Pubkey |
| 14 | system_ | Pubkey |
| 15 | token_ | Pubkey |
| 16 | rent | Pubkey |
| 17… | remaining | Vec< |
Swap#
Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.
| Field | Type |
|---|---|
delta_in | Token |
price_limit | FixedPoint |
x_to_y | bool |
Required accounts: 17; extras go to remaining.
Fields of SwapInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_x | Pubkey |
| 3 | token_y | Pubkey |
| 4 | pool_ | Pubkey |
| 5 | pool_ | Pubkey |
| 6 | swapper_ | Pubkey |
| 7 | swapper_ | Pubkey |
| 8 | swapper | Pubkey |
| 9 | referrer_ | Pubkey |
| 10 | referrer_ | Pubkey |
| 11 | referrer | Pubkey |
| 12 | program_ | Pubkey |
| 13 | system_ | Pubkey |
| 14 | token_ | Pubkey |
| 15 | associated_ | Pubkey |
| 16 | rent | Pubkey |
| 17… | remaining | Vec< |
UpdateFees#
Discriminator e11b0d064554acbf · data UpdateFees · accounts UpdateFeesInstructionAccounts.
| Field | Type |
|---|---|
new_ | FixedPoint |
new_ | FixedPoint |
new_ | FixedPoint |
new_ | FixedPoint |
Required accounts: 6; extras go to remaining.
Fields of UpdateFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_x | Pubkey |
| 3 | token_y | Pubkey |
| 4 | admin | Pubkey |
| 5 | program_ | Pubkey |
| 6… | remaining | Vec< |
UpdateRewardTokens#
Discriminator f9ec474a683ae11c · data UpdateRewardTokens · accounts UpdateRewardTokensInstructionAccounts.
No data fields.
Required accounts: 12; extras go to remaining.
Fields of UpdateRewardTokensInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_marco | Pubkey |
| 7 | new_ | Pubkey |
| 8 | admin | Pubkey |
| 9 | program_ | Pubkey |
| 10 | system_ | Pubkey |
| 11 | token_ | Pubkey |
| 12… | remaining | Vec< |
WithdrawBuyback#
Discriminator bc4b1ec6632b0c36 · data WithdrawBuyback · accounts WithdrawBuybackInstructionAccounts.
No data fields.
Required accounts: 14; extras go to remaining.
Fields of WithdrawBuybackInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_x | Pubkey |
| 3 | token_y | Pubkey |
| 4 | buyback_ | Pubkey |
| 5 | buyback_ | Pubkey |
| 6 | pool_ | Pubkey |
| 7 | pool_ | Pubkey |
| 8 | admin | Pubkey |
| 9 | program_ | Pubkey |
| 10 | system_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | associated_ | Pubkey |
| 13 | rent | Pubkey |
| 14… | remaining | Vec< |
WithdrawLpFee#
Discriminator 95a102d5c3932a41 · data WithdrawLpFee · accounts WithdrawLpFeeInstructionAccounts.
No data fields.
Required accounts: 15; extras go to remaining.
Fields of WithdrawLpFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | provider | Pubkey |
| 3 | token_x | Pubkey |
| 4 | token_y | Pubkey |
| 5 | owner_ | Pubkey |
| 6 | owner_ | Pubkey |
| 7 | pool_ | Pubkey |
| 8 | pool_ | Pubkey |
| 9 | owner | Pubkey |
| 10 | program_ | Pubkey |
| 11 | system_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | associated_ | Pubkey |
| 14 | rent | Pubkey |
| 15… | remaining | Vec< |
WithdrawMercantiFee#
Discriminator fde581252f480bf0 · data WithdrawMercantiFee · accounts WithdrawMercantiFeeInstructionAccounts.
No data fields.
Required accounts: 11; extras go to remaining.
Fields of WithdrawMercantiFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_x | Pubkey |
| 3 | token_y | Pubkey |
| 4 | mercanti_ | Pubkey |
| 5 | mercanti_ | Pubkey |
| 6 | pool_ | Pubkey |
| 7 | pool_ | Pubkey |
| 8 | admin | Pubkey |
| 9 | program_ | Pubkey |
| 10 | token_ | Pubkey |
| 11… | remaining | Vec< |
WithdrawProjectFee#
Discriminator 82c98e9c9fcfa816 · data WithdrawProjectFee · accounts WithdrawProjectFeeInstructionAccounts.
No data fields.
Required accounts: 14; extras go to remaining.
Fields of WithdrawProjectFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_x | Pubkey |
| 3 | token_y | Pubkey |
| 4 | project_ | Pubkey |
| 5 | project_ | Pubkey |
| 6 | pool_ | Pubkey |
| 7 | pool_ | Pubkey |
| 8 | project_ | Pubkey |
| 9 | program_ | Pubkey |
| 10 | system_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | associated_ | Pubkey |
| 13 | rent | Pubkey |
| 14… | remaining | Vec< |
WithdrawRewards#
Discriminator 0ad6db8bcd16fb15 · data WithdrawRewards · accounts WithdrawRewardsInstructionAccounts.
No data fields.
Required accounts: 21; extras go to remaining.
Fields of WithdrawRewardsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | provider | Pubkey |
| 4 | token_x | Pubkey |
| 5 | token_y | Pubkey |
| 6 | token_marco | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | owner_ | Pubkey |
| 13 | owner_ | Pubkey |
| 14 | owner_ | Pubkey |
| 15 | owner | Pubkey |
| 16 | program_ | Pubkey |
| 17 | system_ | Pubkey |
| 18 | token_ | Pubkey |
| 19 | associated_ | Pubkey |
| 20 | rent | Pubkey |
| 21… | remaining | Vec< |
WithdrawShares#
Discriminator b0689a69fa5044f4 · data WithdrawShares · accounts WithdrawSharesInstructionAccounts.
| Field | Type |
|---|---|
shares | Token |
Required accounts: 25; extras go to remaining.
Fields of WithdrawSharesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pool | Pubkey |
| 2 | farm | Pubkey |
| 3 | provider | Pubkey |
| 4 | token_x | Pubkey |
| 5 | token_y | Pubkey |
| 6 | token_marco | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | pool_ | Pubkey |
| 10 | pool_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | token_ | Pubkey |
| 14 | owner_ | Pubkey |
| 15 | owner_ | Pubkey |
| 16 | owner_ | Pubkey |
| 17 | owner_ | Pubkey |
| 18 | owner_ | Pubkey |
| 19 | owner | Pubkey |
| 20 | program_ | Pubkey |
| 21 | system_ | Pubkey |
| 22 | token_ | Pubkey |
| 23 | associated_ | Pubkey |
| 24 | rent | Pubkey |
| 25… | remaining | Vec< |
Accounts#
Variants of BonkswapAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
Farm#
Discriminator a19cd3fdfa4035fa · accounts::.
| Field | Type |
|---|---|
pool | Pubkey |
tokens | [Pubkey; 3] |
token_ | [Pubkey; 3] |
supply | [Token; 3] |
supply_left | [Token; 3] |
accumulated_ | FixedPoint |
offset_ | FixedPoint |
start_time | u64 |
end_time | u64 |
last_update | u64 |
bump | u8 |
farm_type | FarmType |
Pool#
Discriminator f19a6d0411b16dbc · accounts::.
| Field | Type |
|---|---|
token_x | Pubkey |
token_y | Pubkey |
pool_ | Pubkey |
pool_ | Pubkey |
admin | Pubkey |
project_ | Pubkey |
token_ | Token |
token_ | Token |
self_shares | Token |
all_shares | Token |
buyback_ | Token |
buyback_ | Token |
project_ | Token |
project_ | Token |
mercanti_ | Token |
mercanti_ | Token |
lp_ | FixedPoint |
lp_ | FixedPoint |
const_k | Product |
price | FixedPoint |
lp_fee | FixedPoint |
buyback_fee | FixedPoint |
project_fee | FixedPoint |
mercanti_ | FixedPoint |
farm_count | u64 |
bump | u8 |
PoolV2#
Discriminator 5b0cd65707b9a737 · accounts::.
| Field | Type |
|---|---|
token_x | Pubkey |
token_y | Pubkey |
pool_ | Pubkey |
pool_ | Pubkey |
admin | Pubkey |
project_ | Pubkey |
token_ | Token |
token_ | Token |
self_shares | Token |
all_shares | Token |
buyback_ | Token |
buyback_ | Token |
project_ | Token |
project_ | Token |
mercanti_ | Token |
mercanti_ | Token |
lp_ | FixedPoint |
lp_ | FixedPoint |
const_k | Product |
price | FixedPoint |
lp_fee | FixedPoint |
buyback_fee | FixedPoint |
project_fee | FixedPoint |
mercanti_ | FixedPoint |
farm_count | u64 |
pool_bump | u8 |
lp_token | Pubkey |
lp_ | u8 |
padding | [u64; 8] |
Provider#
Discriminator a4b447114bd850c3 · accounts::.
| Field | Type |
|---|---|
token_x | Pubkey |
token_y | Pubkey |
owner | Pubkey |
shares | Token |
last_ | FixedPoint |
last_ | FixedPoint |
last_ | FixedPoint |
last_ | u64 |
tokens_ | Token |
tokens_ | Token |
current_ | u64 |
bump | u8 |
State#
Discriminator d8926b5e684bb6b1 · accounts::.
| Field | Type |
|---|---|
admin | Pubkey |
program_ | Pubkey |
bump | u8 |
nonce | u8 |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
FarmType#
Enum types::.
| Variant |
|---|
Single |
Dual |
Triple |
FixedPoint#
Struct types::.
| Field | Type |
|---|---|
v | u128 |
Product#
Struct types::.
| Field | Type |
|---|---|
v | u128 |
Token#
Struct types::.
| Field | Type |
|---|---|
v | u64 |