diff --git a/stakedex_sdk/src/lib.rs b/stakedex_sdk/src/lib.rs index 5a178c9..cdd6aa6 100644 --- a/stakedex_sdk/src/lib.rs +++ b/stakedex_sdk/src/lib.rs @@ -470,6 +470,12 @@ impl Stakedex { for (first_stakedex, second_stakedex) in stakedexes.into_iter().tuple_combinations() { match (first_stakedex, second_stakedex) { (Stakedex::SplStakePool(p1), Stakedex::SplStakePool(p2)) => { + // To provide a stable ordering of SPL stake pools + let (p1, p2) = if p1.staked_sol_mint() < p2.staked_sol_mint() { + (p1, p2) + } else { + (p2, p1) + }; amms.push(Box::new(TwoWayPoolPair::new(p1, p2))); } match_stakedexes!(SplStakePool, Marinade, withdraw, deposit) => {