jupiter_amm_interface/
swap.rs

1#[derive(Copy, Clone, Debug, PartialEq)]
2pub enum Side {
3    Bid,
4    Ask,
5}
6
7#[derive(Clone, PartialEq, Debug)]
8pub enum Swap {
9    Saber,
10    SaberAddDecimalsDeposit,
11    SaberAddDecimalsWithdraw,
12    TokenSwap,
13    Raydium,
14    Crema {
15        a_to_b: bool,
16    },
17    Mercurial,
18    Aldrin {
19        side: Side,
20    },
21    AldrinV2 {
22        side: Side,
23    },
24    Whirlpool {
25        a_to_b: bool,
26    },
27    Invariant {
28        x_to_y: bool,
29    },
30    Meteora,
31    MarcoPolo {
32        x_to_y: bool,
33    },
34    LifinityV2,
35    RaydiumClmm,
36    Phoenix {
37        side: Side,
38    },
39    TokenSwapV2,
40    HeliumTreasuryManagementRedeemV0,
41    StakeDexStakeWrappedSol,
42    MeteoraDlmm,
43    OpenBookV2 {
44        side: Side,
45    },
46    RaydiumClmmV2,
47    StakeDexPrefundWithdrawStakeAndDepositStake {
48        bridge_stake_seed: u32,
49    },
50    SanctumS {
51        src_lst_value_calc_accs: u8,
52        dst_lst_value_calc_accs: u8,
53        src_lst_index: u32,
54        dst_lst_index: u32,
55    },
56    SanctumSAddLiquidity {
57        lst_value_calc_accs: u8,
58        lst_index: u32,
59    },
60    SanctumSRemoveLiquidity {
61        lst_value_calc_accs: u8,
62        lst_index: u32,
63    },
64    RaydiumCP,
65    WhirlpoolSwapV2 {
66        a_to_b: bool,
67        remaining_accounts_info: Option<RemainingAccountsInfo>,
68    },
69    OneIntro,
70    PumpWrappedBuy,
71    PumpWrappedSell,
72    PerpsV2,
73    PerpsV2AddLiquidity,
74    PerpsV2RemoveLiquidity,
75    MoonshotWrappedBuy,
76    MoonshotWrappedSell,
77    StabbleStableSwap,
78    StabbleWeightedSwap,
79    Obric {
80        x_to_y: bool,
81    },
82    SolFi {
83        is_quote_to_base: bool,
84    },
85    SolayerDelegateNoInit,
86    SolayerUndelegateNoInit,
87    ZeroFi,
88    StakeDexWithdrawWrappedSol,
89    VirtualsBuy,
90    VirtualsSell,
91    Perena {
92        in_index: u8,
93        out_index: u8,
94    },
95    PumpSwapBuy,
96    PumpSwapSell,
97    Gamma,
98    MeteoraDlmmSwapV2 {
99        remaining_accounts_info: RemainingAccountsInfo,
100    },
101    Woofi,
102    MeteoraDammV2,
103    StabbleStableSwapV2,
104    StabbleWeightedSwapV2,
105    RaydiumLaunchlabBuy {
106        share_fee_rate: u64,
107    },
108    RaydiumLaunchlabSell {
109        share_fee_rate: u64,
110    },
111    BoopdotfunWrappedBuy,
112    BoopdotfunWrappedSell,
113    Plasma {
114        side: Side,
115    },
116    GoonFi {
117        is_bid: bool,
118        blacklist_bump: u8,
119    },
120    HumidiFi {
121        swap_id: u64,
122        is_base_to_quote: bool,
123    },
124    MeteoraDynamicBondingCurveSwapWithRemainingAccounts,
125    TesseraV {
126        side: Side,
127    },
128}
129#[derive(Clone, PartialEq, Eq, Debug)]
130pub enum AccountsType {
131    TransferHookA,
132    TransferHookB,
133    // TransferHookReward,
134    // TransferHookInput,
135    // TransferHookIntermediate,
136    // TransferHookOutput,
137    //TickArray,
138    //TickArrayOne,
139    //TickArrayTwo,
140}
141
142#[derive(Clone, Debug, PartialEq)]
143pub struct RemainingAccountsSlice {
144    pub accounts_type: AccountsType,
145    pub length: u8,
146}
147
148#[derive(Clone, Debug, PartialEq)]
149pub struct RemainingAccountsInfo {
150    pub slices: Vec<RemainingAccountsSlice>,
151}