Skip to content
Open
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
9 changes: 7 additions & 2 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ bincode = "^1.0"
borsh = "^0.9"
jupiter-amm-interface = "~0.3.2"
lazy_static = "^1.0"
lido = { git = "https://github.com/igneous-labs/solido", branch = "mod/2.0.0-loose-deps", features = ["no-entrypoint"] }
marinade_finance_interface = { git = "https://github.com/igneous-labs/marinade_finance_interface", rev = "4d1895b" }
num-derive = ">=0.1"
num-traits = ">=0.1"
rust_decimal = "^1.0"
Expand Down
2 changes: 2 additions & 0 deletions common/src/address/marinade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pub mod marinade_program {
("liq_pool_msol_leg_authority", b"u\x11\x9b1u\x80u\x86\xe3\xf4\xa7\xe5\xcd\x0f\x89\x0e\x96\xa7S\xb1\x0f\xcc\xc7h\x1e\x94s\xa0\x082p\xf1", b"liq_st_sol_authority"),
("msol_mint_auth", b"u\x11\x9b1u\x80u\x86\xe3\xf4\xa7\xe5\xcd\x0f\x89\x0e\x96\xa7S\xb1\x0f\xcc\xc7h\x1e\x94s\xa0\x082p\xf1", b"st_mint"),
("reserve", b"u\x11\x9b1u\x80u\x86\xe3\xf4\xa7\xe5\xcd\x0f\x89\x0e\x96\xa7S\xb1\x0f\xcc\xc7h\x1e\x94s\xa0\x082p\xf1", b"reserve"),
("stake_withdraw_auth", b"u\x11\x9b1u\x80u\x86\xe3\xf4\xa7\xe5\xcd\x0f\x89\x0e\x96\xa7S\xb1\x0f\xcc\xc7h\x1e\x94s\xa0\x082p\xf1", b"withdraw"),
("stake_deposit_auth", b"u\x11\x9b1u\x80u\x86\xe3\xf4\xa7\xe5\xcd\x0f\x89\x0e\x96\xa7S\xb1\x0f\xcc\xc7h\x1e\x94s\xa0\x082p\xf1", b"deposit"),
]
);
}
Expand Down
15 changes: 12 additions & 3 deletions common/src/pool_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ use crate::{
account_missing_err, apply_global_fee, find_bridge_stake, find_fee_token_acc,
find_stake_pool_pair_amm_key,
jupiter_stakedex_interface::{Swap, STAKEDEX_ACCOUNT_META},
DepositStake, DepositStakeInfo, DepositStakeQuote, SwapViaStakeQuoteErr, WithdrawStake,
WithdrawStakeQuote, WithdrawStakeQuoteErr, SWAP_VIA_STAKE_DST_TOKEN_MINT_ACCOUNT_INDEX,
SWAP_VIA_STAKE_SRC_TOKEN_MINT_ACCOUNT_INDEX, TEMPORARY_JUP_AMM_LABEL,
marinade_state, DepositStake, DepositStakeInfo, DepositStakeQuote, SwapViaStakeQuoteErr,
WithdrawStake, WithdrawStakeQuote, WithdrawStakeQuoteErr,
SWAP_VIA_STAKE_DST_TOKEN_MINT_ACCOUNT_INDEX, SWAP_VIA_STAKE_SRC_TOKEN_MINT_ACCOUNT_INDEX,
TEMPORARY_JUP_AMM_LABEL,
};

pub fn first_avail_quote<W: WithdrawStake + ?Sized, D: DepositStake + ?Sized>(
Expand Down Expand Up @@ -331,4 +332,12 @@ where
fn program_id(&self) -> Pubkey {
stakedex_interface::ID
}

/// Because marinade doesn't provide an easy way to match their stake accounts
/// to the validator vote account, we have to fetch all their stake accounts on
/// update to figure this out
fn has_dynamic_accounts(&self) -> bool {
self.p1.main_state_key() == marinade_state::ID
|| self.p2.main_state_key() == marinade_state::ID
}
}
Loading