Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition = "2021"

[workspace.dependencies]
anchor-lang = "0.28"
anchor-spl = { version = "0.28.0" }
anchor-syn = "0.28"
solana-sdk = "~1.16"
solana-client = "~1.16"
Expand Down
2 changes: 2 additions & 0 deletions jupiter-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = { workspace = true }

[dependencies]
anchor-lang = { workspace = true }
anchor-spl = { workspace = true }
solana-sdk = { workspace = true }
solana-client = { workspace = true }
solana-account-decoder = { workspace = true }
Expand All @@ -26,6 +27,7 @@ tokio = { workspace = true, features = ["full"] }
assert_matches = "1.5.0"
itertools = "0.12.1"
clap = { version = "4.5.2", features = ["derive"] }
uint = "0.9.1"

# SPL
spl-token = { workspace = true, features = ["no-entrypoint"] }
Expand Down
49 changes: 49 additions & 0 deletions jupiter-core/src/amms/account_meta_from_goat_swap.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
use anchor_lang::prelude::{AccountMeta, Pubkey};

#[derive(Copy, Clone, Debug)]
pub struct GoatTokenSwap {
pub token_swap_program: Pubkey,
pub token_program: Pubkey,
pub swap: Pubkey,
pub authority: Pubkey,
pub user_transfer_authority: Pubkey,
pub source: Pubkey,
pub swap_source: Pubkey,
pub swap_destination: Pubkey,
pub destination: Pubkey,
pub pool_mint: Pubkey,
pub pool_fee: Pubkey,
/// other accounts
// pub authority: Pubkey,
pub amm_config: Pubkey,
// pub pool_state: Pubkey,
// pub input_token_account: Pubkey,
// pub output_token_account: Pubkey,
// pub input_vault: Pubkey,
// pub output_vault: Pubkey,
// pub input_token_program: Pubkey,
pub output_token_program: Pubkey,
// pub input_token_mint: Pubkey,
// pub output_token_mint: Pubkey,
}

impl From<GoatTokenSwap> for Vec<AccountMeta> {
fn from(accounts: GoatTokenSwap) -> Self {
vec![
AccountMeta::new_readonly(accounts.token_swap_program, false),
AccountMeta::new_readonly(accounts.token_program, false),
AccountMeta::new_readonly(accounts.swap, false),
AccountMeta::new_readonly(accounts.authority, false),
AccountMeta::new_readonly(accounts.user_transfer_authority, false),
AccountMeta::new(accounts.source, false),
AccountMeta::new(accounts.swap_source, false),
AccountMeta::new(accounts.swap_destination, false),
AccountMeta::new(accounts.destination, false),
AccountMeta::new(accounts.pool_mint, false),
AccountMeta::new(accounts.pool_fee, false),
// other accounts
AccountMeta::new_readonly(accounts.amm_config, false),
AccountMeta::new(accounts.output_token_program, false),
]
}
}
Loading