defituna_client/generated/instructions/
remove_liquidity_orca.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use crate::generated::types::RemainingAccountsInfo;
9use borsh::BorshSerialize;
10use borsh::BorshDeserialize;
11
12/// Accounts.
13#[derive(Debug)]
14pub struct RemoveLiquidityOrca {
15            /// 
16/// TUNA accounts
17/// 
18
19    
20              
21          pub authority: solana_program::pubkey::Pubkey,
22          
23              
24          pub tuna_config: solana_program::pubkey::Pubkey,
25          
26              
27          pub market: solana_program::pubkey::Pubkey,
28          
29              
30          pub mint_a: solana_program::pubkey::Pubkey,
31          
32              
33          pub mint_b: solana_program::pubkey::Pubkey,
34          
35              
36          pub vault_a: solana_program::pubkey::Pubkey,
37          
38              
39          pub vault_b: solana_program::pubkey::Pubkey,
40          
41              
42          pub vault_a_ata: solana_program::pubkey::Pubkey,
43          
44              
45          pub vault_b_ata: solana_program::pubkey::Pubkey,
46          
47              
48          pub tuna_position: solana_program::pubkey::Pubkey,
49          
50              
51          pub tuna_position_ata: solana_program::pubkey::Pubkey,
52          
53              
54          pub tuna_position_ata_a: solana_program::pubkey::Pubkey,
55          
56              
57          pub tuna_position_ata_b: solana_program::pubkey::Pubkey,
58          
59              
60          pub tuna_position_owner_ata_a: solana_program::pubkey::Pubkey,
61          
62              
63          pub tuna_position_owner_ata_b: solana_program::pubkey::Pubkey,
64          
65              
66          pub pyth_oracle_price_feed_a: solana_program::pubkey::Pubkey,
67          
68              
69          pub pyth_oracle_price_feed_b: solana_program::pubkey::Pubkey,
70                /// 
71/// ORCA accounts
72/// 
73
74    
75              
76          pub whirlpool_program: solana_program::pubkey::Pubkey,
77          
78              
79          pub whirlpool: solana_program::pubkey::Pubkey,
80          
81              
82          pub orca_position: solana_program::pubkey::Pubkey,
83          
84              
85          pub token_program_a: solana_program::pubkey::Pubkey,
86          
87              
88          pub token_program_b: solana_program::pubkey::Pubkey,
89          
90              
91          pub memo_program: solana_program::pubkey::Pubkey,
92      }
93
94impl RemoveLiquidityOrca {
95  pub fn instruction(&self, args: RemoveLiquidityOrcaInstructionArgs) -> solana_program::instruction::Instruction {
96    self.instruction_with_remaining_accounts(args, &[])
97  }
98  #[allow(clippy::arithmetic_side_effects)]
99  #[allow(clippy::vec_init_then_push)]
100  pub fn instruction_with_remaining_accounts(&self, args: RemoveLiquidityOrcaInstructionArgs, remaining_accounts: &[solana_program::instruction::AccountMeta]) -> solana_program::instruction::Instruction {
101    let mut accounts = Vec::with_capacity(23+ remaining_accounts.len());
102                            accounts.push(solana_program::instruction::AccountMeta::new(
103            self.authority,
104            true
105          ));
106                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
107            self.tuna_config,
108            false
109          ));
110                                          accounts.push(solana_program::instruction::AccountMeta::new(
111            self.market,
112            false
113          ));
114                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
115            self.mint_a,
116            false
117          ));
118                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
119            self.mint_b,
120            false
121          ));
122                                          accounts.push(solana_program::instruction::AccountMeta::new(
123            self.vault_a,
124            false
125          ));
126                                          accounts.push(solana_program::instruction::AccountMeta::new(
127            self.vault_b,
128            false
129          ));
130                                          accounts.push(solana_program::instruction::AccountMeta::new(
131            self.vault_a_ata,
132            false
133          ));
134                                          accounts.push(solana_program::instruction::AccountMeta::new(
135            self.vault_b_ata,
136            false
137          ));
138                                          accounts.push(solana_program::instruction::AccountMeta::new(
139            self.tuna_position,
140            false
141          ));
142                                          accounts.push(solana_program::instruction::AccountMeta::new(
143            self.tuna_position_ata,
144            false
145          ));
146                                          accounts.push(solana_program::instruction::AccountMeta::new(
147            self.tuna_position_ata_a,
148            false
149          ));
150                                          accounts.push(solana_program::instruction::AccountMeta::new(
151            self.tuna_position_ata_b,
152            false
153          ));
154                                          accounts.push(solana_program::instruction::AccountMeta::new(
155            self.tuna_position_owner_ata_a,
156            false
157          ));
158                                          accounts.push(solana_program::instruction::AccountMeta::new(
159            self.tuna_position_owner_ata_b,
160            false
161          ));
162                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
163            self.pyth_oracle_price_feed_a,
164            false
165          ));
166                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
167            self.pyth_oracle_price_feed_b,
168            false
169          ));
170                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
171            self.whirlpool_program,
172            false
173          ));
174                                          accounts.push(solana_program::instruction::AccountMeta::new(
175            self.whirlpool,
176            false
177          ));
178                                          accounts.push(solana_program::instruction::AccountMeta::new(
179            self.orca_position,
180            false
181          ));
182                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
183            self.token_program_a,
184            false
185          ));
186                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
187            self.token_program_b,
188            false
189          ));
190                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
191            self.memo_program,
192            false
193          ));
194                      accounts.extend_from_slice(remaining_accounts);
195    let mut data = borsh::to_vec(&RemoveLiquidityOrcaInstructionData::new()).unwrap();
196          let mut args = borsh::to_vec(&args).unwrap();
197      data.append(&mut args);
198    
199    solana_program::instruction::Instruction {
200      program_id: crate::TUNA_ID,
201      accounts,
202      data,
203    }
204  }
205}
206
207#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
208#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
209 pub struct RemoveLiquidityOrcaInstructionData {
210            discriminator: [u8; 8],
211                                          }
212
213impl RemoveLiquidityOrcaInstructionData {
214  pub fn new() -> Self {
215    Self {
216                        discriminator: [30, 69, 45, 170, 183, 195, 12, 119],
217                                                                                                      }
218  }
219}
220
221impl Default for RemoveLiquidityOrcaInstructionData {
222  fn default() -> Self {
223    Self::new()
224  }
225}
226
227#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
228#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
229 pub struct RemoveLiquidityOrcaInstructionArgs {
230                  pub withdraw_percent: u32,
231                pub swap_to_token: u8,
232                pub min_removed_amount_a: u64,
233                pub min_removed_amount_b: u64,
234                pub max_swap_slippage: u32,
235                pub remaining_accounts_info: RemainingAccountsInfo,
236      }
237
238
239/// Instruction builder for `RemoveLiquidityOrca`.
240///
241/// ### Accounts:
242///
243                      ///   0. `[writable, signer]` authority
244          ///   1. `[]` tuna_config
245                ///   2. `[writable]` market
246          ///   3. `[]` mint_a
247          ///   4. `[]` mint_b
248                ///   5. `[writable]` vault_a
249                ///   6. `[writable]` vault_b
250                ///   7. `[writable]` vault_a_ata
251                ///   8. `[writable]` vault_b_ata
252                ///   9. `[writable]` tuna_position
253                ///   10. `[writable]` tuna_position_ata
254                ///   11. `[writable]` tuna_position_ata_a
255                ///   12. `[writable]` tuna_position_ata_b
256                ///   13. `[writable]` tuna_position_owner_ata_a
257                ///   14. `[writable]` tuna_position_owner_ata_b
258          ///   15. `[]` pyth_oracle_price_feed_a
259          ///   16. `[]` pyth_oracle_price_feed_b
260          ///   17. `[]` whirlpool_program
261                ///   18. `[writable]` whirlpool
262                ///   19. `[writable]` orca_position
263          ///   20. `[]` token_program_a
264          ///   21. `[]` token_program_b
265          ///   22. `[]` memo_program
266#[derive(Clone, Debug, Default)]
267pub struct RemoveLiquidityOrcaBuilder {
268            authority: Option<solana_program::pubkey::Pubkey>,
269                tuna_config: Option<solana_program::pubkey::Pubkey>,
270                market: Option<solana_program::pubkey::Pubkey>,
271                mint_a: Option<solana_program::pubkey::Pubkey>,
272                mint_b: Option<solana_program::pubkey::Pubkey>,
273                vault_a: Option<solana_program::pubkey::Pubkey>,
274                vault_b: Option<solana_program::pubkey::Pubkey>,
275                vault_a_ata: Option<solana_program::pubkey::Pubkey>,
276                vault_b_ata: Option<solana_program::pubkey::Pubkey>,
277                tuna_position: Option<solana_program::pubkey::Pubkey>,
278                tuna_position_ata: Option<solana_program::pubkey::Pubkey>,
279                tuna_position_ata_a: Option<solana_program::pubkey::Pubkey>,
280                tuna_position_ata_b: Option<solana_program::pubkey::Pubkey>,
281                tuna_position_owner_ata_a: Option<solana_program::pubkey::Pubkey>,
282                tuna_position_owner_ata_b: Option<solana_program::pubkey::Pubkey>,
283                pyth_oracle_price_feed_a: Option<solana_program::pubkey::Pubkey>,
284                pyth_oracle_price_feed_b: Option<solana_program::pubkey::Pubkey>,
285                whirlpool_program: Option<solana_program::pubkey::Pubkey>,
286                whirlpool: Option<solana_program::pubkey::Pubkey>,
287                orca_position: Option<solana_program::pubkey::Pubkey>,
288                token_program_a: Option<solana_program::pubkey::Pubkey>,
289                token_program_b: Option<solana_program::pubkey::Pubkey>,
290                memo_program: Option<solana_program::pubkey::Pubkey>,
291                        withdraw_percent: Option<u32>,
292                swap_to_token: Option<u8>,
293                min_removed_amount_a: Option<u64>,
294                min_removed_amount_b: Option<u64>,
295                max_swap_slippage: Option<u32>,
296                remaining_accounts_info: Option<RemainingAccountsInfo>,
297        __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
298}
299
300impl RemoveLiquidityOrcaBuilder {
301  pub fn new() -> Self {
302    Self::default()
303  }
304            /// 
305/// TUNA accounts
306/// 
307#[inline(always)]
308    pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self {
309                        self.authority = Some(authority);
310                    self
311    }
312            #[inline(always)]
313    pub fn tuna_config(&mut self, tuna_config: solana_program::pubkey::Pubkey) -> &mut Self {
314                        self.tuna_config = Some(tuna_config);
315                    self
316    }
317            #[inline(always)]
318    pub fn market(&mut self, market: solana_program::pubkey::Pubkey) -> &mut Self {
319                        self.market = Some(market);
320                    self
321    }
322            #[inline(always)]
323    pub fn mint_a(&mut self, mint_a: solana_program::pubkey::Pubkey) -> &mut Self {
324                        self.mint_a = Some(mint_a);
325                    self
326    }
327            #[inline(always)]
328    pub fn mint_b(&mut self, mint_b: solana_program::pubkey::Pubkey) -> &mut Self {
329                        self.mint_b = Some(mint_b);
330                    self
331    }
332            #[inline(always)]
333    pub fn vault_a(&mut self, vault_a: solana_program::pubkey::Pubkey) -> &mut Self {
334                        self.vault_a = Some(vault_a);
335                    self
336    }
337            #[inline(always)]
338    pub fn vault_b(&mut self, vault_b: solana_program::pubkey::Pubkey) -> &mut Self {
339                        self.vault_b = Some(vault_b);
340                    self
341    }
342            #[inline(always)]
343    pub fn vault_a_ata(&mut self, vault_a_ata: solana_program::pubkey::Pubkey) -> &mut Self {
344                        self.vault_a_ata = Some(vault_a_ata);
345                    self
346    }
347            #[inline(always)]
348    pub fn vault_b_ata(&mut self, vault_b_ata: solana_program::pubkey::Pubkey) -> &mut Self {
349                        self.vault_b_ata = Some(vault_b_ata);
350                    self
351    }
352            #[inline(always)]
353    pub fn tuna_position(&mut self, tuna_position: solana_program::pubkey::Pubkey) -> &mut Self {
354                        self.tuna_position = Some(tuna_position);
355                    self
356    }
357            #[inline(always)]
358    pub fn tuna_position_ata(&mut self, tuna_position_ata: solana_program::pubkey::Pubkey) -> &mut Self {
359                        self.tuna_position_ata = Some(tuna_position_ata);
360                    self
361    }
362            #[inline(always)]
363    pub fn tuna_position_ata_a(&mut self, tuna_position_ata_a: solana_program::pubkey::Pubkey) -> &mut Self {
364                        self.tuna_position_ata_a = Some(tuna_position_ata_a);
365                    self
366    }
367            #[inline(always)]
368    pub fn tuna_position_ata_b(&mut self, tuna_position_ata_b: solana_program::pubkey::Pubkey) -> &mut Self {
369                        self.tuna_position_ata_b = Some(tuna_position_ata_b);
370                    self
371    }
372            #[inline(always)]
373    pub fn tuna_position_owner_ata_a(&mut self, tuna_position_owner_ata_a: solana_program::pubkey::Pubkey) -> &mut Self {
374                        self.tuna_position_owner_ata_a = Some(tuna_position_owner_ata_a);
375                    self
376    }
377            #[inline(always)]
378    pub fn tuna_position_owner_ata_b(&mut self, tuna_position_owner_ata_b: solana_program::pubkey::Pubkey) -> &mut Self {
379                        self.tuna_position_owner_ata_b = Some(tuna_position_owner_ata_b);
380                    self
381    }
382            #[inline(always)]
383    pub fn pyth_oracle_price_feed_a(&mut self, pyth_oracle_price_feed_a: solana_program::pubkey::Pubkey) -> &mut Self {
384                        self.pyth_oracle_price_feed_a = Some(pyth_oracle_price_feed_a);
385                    self
386    }
387            #[inline(always)]
388    pub fn pyth_oracle_price_feed_b(&mut self, pyth_oracle_price_feed_b: solana_program::pubkey::Pubkey) -> &mut Self {
389                        self.pyth_oracle_price_feed_b = Some(pyth_oracle_price_feed_b);
390                    self
391    }
392            /// 
393/// ORCA accounts
394/// 
395#[inline(always)]
396    pub fn whirlpool_program(&mut self, whirlpool_program: solana_program::pubkey::Pubkey) -> &mut Self {
397                        self.whirlpool_program = Some(whirlpool_program);
398                    self
399    }
400            #[inline(always)]
401    pub fn whirlpool(&mut self, whirlpool: solana_program::pubkey::Pubkey) -> &mut Self {
402                        self.whirlpool = Some(whirlpool);
403                    self
404    }
405            #[inline(always)]
406    pub fn orca_position(&mut self, orca_position: solana_program::pubkey::Pubkey) -> &mut Self {
407                        self.orca_position = Some(orca_position);
408                    self
409    }
410            #[inline(always)]
411    pub fn token_program_a(&mut self, token_program_a: solana_program::pubkey::Pubkey) -> &mut Self {
412                        self.token_program_a = Some(token_program_a);
413                    self
414    }
415            #[inline(always)]
416    pub fn token_program_b(&mut self, token_program_b: solana_program::pubkey::Pubkey) -> &mut Self {
417                        self.token_program_b = Some(token_program_b);
418                    self
419    }
420            #[inline(always)]
421    pub fn memo_program(&mut self, memo_program: solana_program::pubkey::Pubkey) -> &mut Self {
422                        self.memo_program = Some(memo_program);
423                    self
424    }
425                    #[inline(always)]
426      pub fn withdraw_percent(&mut self, withdraw_percent: u32) -> &mut Self {
427        self.withdraw_percent = Some(withdraw_percent);
428        self
429      }
430                #[inline(always)]
431      pub fn swap_to_token(&mut self, swap_to_token: u8) -> &mut Self {
432        self.swap_to_token = Some(swap_to_token);
433        self
434      }
435                #[inline(always)]
436      pub fn min_removed_amount_a(&mut self, min_removed_amount_a: u64) -> &mut Self {
437        self.min_removed_amount_a = Some(min_removed_amount_a);
438        self
439      }
440                #[inline(always)]
441      pub fn min_removed_amount_b(&mut self, min_removed_amount_b: u64) -> &mut Self {
442        self.min_removed_amount_b = Some(min_removed_amount_b);
443        self
444      }
445                #[inline(always)]
446      pub fn max_swap_slippage(&mut self, max_swap_slippage: u32) -> &mut Self {
447        self.max_swap_slippage = Some(max_swap_slippage);
448        self
449      }
450                #[inline(always)]
451      pub fn remaining_accounts_info(&mut self, remaining_accounts_info: RemainingAccountsInfo) -> &mut Self {
452        self.remaining_accounts_info = Some(remaining_accounts_info);
453        self
454      }
455        /// Add an additional account to the instruction.
456  #[inline(always)]
457  pub fn add_remaining_account(&mut self, account: solana_program::instruction::AccountMeta) -> &mut Self {
458    self.__remaining_accounts.push(account);
459    self
460  }
461  /// Add additional accounts to the instruction.
462  #[inline(always)]
463  pub fn add_remaining_accounts(&mut self, accounts: &[solana_program::instruction::AccountMeta]) -> &mut Self {
464    self.__remaining_accounts.extend_from_slice(accounts);
465    self
466  }
467  #[allow(clippy::clone_on_copy)]
468  pub fn instruction(&self) -> solana_program::instruction::Instruction {
469    let accounts = RemoveLiquidityOrca {
470                              authority: self.authority.expect("authority is not set"),
471                                        tuna_config: self.tuna_config.expect("tuna_config is not set"),
472                                        market: self.market.expect("market is not set"),
473                                        mint_a: self.mint_a.expect("mint_a is not set"),
474                                        mint_b: self.mint_b.expect("mint_b is not set"),
475                                        vault_a: self.vault_a.expect("vault_a is not set"),
476                                        vault_b: self.vault_b.expect("vault_b is not set"),
477                                        vault_a_ata: self.vault_a_ata.expect("vault_a_ata is not set"),
478                                        vault_b_ata: self.vault_b_ata.expect("vault_b_ata is not set"),
479                                        tuna_position: self.tuna_position.expect("tuna_position is not set"),
480                                        tuna_position_ata: self.tuna_position_ata.expect("tuna_position_ata is not set"),
481                                        tuna_position_ata_a: self.tuna_position_ata_a.expect("tuna_position_ata_a is not set"),
482                                        tuna_position_ata_b: self.tuna_position_ata_b.expect("tuna_position_ata_b is not set"),
483                                        tuna_position_owner_ata_a: self.tuna_position_owner_ata_a.expect("tuna_position_owner_ata_a is not set"),
484                                        tuna_position_owner_ata_b: self.tuna_position_owner_ata_b.expect("tuna_position_owner_ata_b is not set"),
485                                        pyth_oracle_price_feed_a: self.pyth_oracle_price_feed_a.expect("pyth_oracle_price_feed_a is not set"),
486                                        pyth_oracle_price_feed_b: self.pyth_oracle_price_feed_b.expect("pyth_oracle_price_feed_b is not set"),
487                                        whirlpool_program: self.whirlpool_program.expect("whirlpool_program is not set"),
488                                        whirlpool: self.whirlpool.expect("whirlpool is not set"),
489                                        orca_position: self.orca_position.expect("orca_position is not set"),
490                                        token_program_a: self.token_program_a.expect("token_program_a is not set"),
491                                        token_program_b: self.token_program_b.expect("token_program_b is not set"),
492                                        memo_program: self.memo_program.expect("memo_program is not set"),
493                      };
494          let args = RemoveLiquidityOrcaInstructionArgs {
495                                                              withdraw_percent: self.withdraw_percent.clone().expect("withdraw_percent is not set"),
496                                                                  swap_to_token: self.swap_to_token.clone().expect("swap_to_token is not set"),
497                                                                  min_removed_amount_a: self.min_removed_amount_a.clone().expect("min_removed_amount_a is not set"),
498                                                                  min_removed_amount_b: self.min_removed_amount_b.clone().expect("min_removed_amount_b is not set"),
499                                                                  max_swap_slippage: self.max_swap_slippage.clone().expect("max_swap_slippage is not set"),
500                                                                  remaining_accounts_info: self.remaining_accounts_info.clone().expect("remaining_accounts_info is not set"),
501                                    };
502    
503    accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
504  }
505}
506
507  /// `remove_liquidity_orca` CPI accounts.
508  pub struct RemoveLiquidityOrcaCpiAccounts<'a, 'b> {
509                  /// 
510/// TUNA accounts
511/// 
512
513      
514                    
515              pub authority: &'b solana_program::account_info::AccountInfo<'a>,
516                
517                    
518              pub tuna_config: &'b solana_program::account_info::AccountInfo<'a>,
519                
520                    
521              pub market: &'b solana_program::account_info::AccountInfo<'a>,
522                
523                    
524              pub mint_a: &'b solana_program::account_info::AccountInfo<'a>,
525                
526                    
527              pub mint_b: &'b solana_program::account_info::AccountInfo<'a>,
528                
529                    
530              pub vault_a: &'b solana_program::account_info::AccountInfo<'a>,
531                
532                    
533              pub vault_b: &'b solana_program::account_info::AccountInfo<'a>,
534                
535                    
536              pub vault_a_ata: &'b solana_program::account_info::AccountInfo<'a>,
537                
538                    
539              pub vault_b_ata: &'b solana_program::account_info::AccountInfo<'a>,
540                
541                    
542              pub tuna_position: &'b solana_program::account_info::AccountInfo<'a>,
543                
544                    
545              pub tuna_position_ata: &'b solana_program::account_info::AccountInfo<'a>,
546                
547                    
548              pub tuna_position_ata_a: &'b solana_program::account_info::AccountInfo<'a>,
549                
550                    
551              pub tuna_position_ata_b: &'b solana_program::account_info::AccountInfo<'a>,
552                
553                    
554              pub tuna_position_owner_ata_a: &'b solana_program::account_info::AccountInfo<'a>,
555                
556                    
557              pub tuna_position_owner_ata_b: &'b solana_program::account_info::AccountInfo<'a>,
558                
559                    
560              pub pyth_oracle_price_feed_a: &'b solana_program::account_info::AccountInfo<'a>,
561                
562                    
563              pub pyth_oracle_price_feed_b: &'b solana_program::account_info::AccountInfo<'a>,
564                        /// 
565/// ORCA accounts
566/// 
567
568      
569                    
570              pub whirlpool_program: &'b solana_program::account_info::AccountInfo<'a>,
571                
572                    
573              pub whirlpool: &'b solana_program::account_info::AccountInfo<'a>,
574                
575                    
576              pub orca_position: &'b solana_program::account_info::AccountInfo<'a>,
577                
578                    
579              pub token_program_a: &'b solana_program::account_info::AccountInfo<'a>,
580                
581                    
582              pub token_program_b: &'b solana_program::account_info::AccountInfo<'a>,
583                
584                    
585              pub memo_program: &'b solana_program::account_info::AccountInfo<'a>,
586            }
587
588/// `remove_liquidity_orca` CPI instruction.
589pub struct RemoveLiquidityOrcaCpi<'a, 'b> {
590  /// The program to invoke.
591  pub __program: &'b solana_program::account_info::AccountInfo<'a>,
592            /// 
593/// TUNA accounts
594/// 
595
596    
597              
598          pub authority: &'b solana_program::account_info::AccountInfo<'a>,
599          
600              
601          pub tuna_config: &'b solana_program::account_info::AccountInfo<'a>,
602          
603              
604          pub market: &'b solana_program::account_info::AccountInfo<'a>,
605          
606              
607          pub mint_a: &'b solana_program::account_info::AccountInfo<'a>,
608          
609              
610          pub mint_b: &'b solana_program::account_info::AccountInfo<'a>,
611          
612              
613          pub vault_a: &'b solana_program::account_info::AccountInfo<'a>,
614          
615              
616          pub vault_b: &'b solana_program::account_info::AccountInfo<'a>,
617          
618              
619          pub vault_a_ata: &'b solana_program::account_info::AccountInfo<'a>,
620          
621              
622          pub vault_b_ata: &'b solana_program::account_info::AccountInfo<'a>,
623          
624              
625          pub tuna_position: &'b solana_program::account_info::AccountInfo<'a>,
626          
627              
628          pub tuna_position_ata: &'b solana_program::account_info::AccountInfo<'a>,
629          
630              
631          pub tuna_position_ata_a: &'b solana_program::account_info::AccountInfo<'a>,
632          
633              
634          pub tuna_position_ata_b: &'b solana_program::account_info::AccountInfo<'a>,
635          
636              
637          pub tuna_position_owner_ata_a: &'b solana_program::account_info::AccountInfo<'a>,
638          
639              
640          pub tuna_position_owner_ata_b: &'b solana_program::account_info::AccountInfo<'a>,
641          
642              
643          pub pyth_oracle_price_feed_a: &'b solana_program::account_info::AccountInfo<'a>,
644          
645              
646          pub pyth_oracle_price_feed_b: &'b solana_program::account_info::AccountInfo<'a>,
647                /// 
648/// ORCA accounts
649/// 
650
651    
652              
653          pub whirlpool_program: &'b solana_program::account_info::AccountInfo<'a>,
654          
655              
656          pub whirlpool: &'b solana_program::account_info::AccountInfo<'a>,
657          
658              
659          pub orca_position: &'b solana_program::account_info::AccountInfo<'a>,
660          
661              
662          pub token_program_a: &'b solana_program::account_info::AccountInfo<'a>,
663          
664              
665          pub token_program_b: &'b solana_program::account_info::AccountInfo<'a>,
666          
667              
668          pub memo_program: &'b solana_program::account_info::AccountInfo<'a>,
669            /// The arguments for the instruction.
670    pub __args: RemoveLiquidityOrcaInstructionArgs,
671  }
672
673impl<'a, 'b> RemoveLiquidityOrcaCpi<'a, 'b> {
674  pub fn new(
675    program: &'b solana_program::account_info::AccountInfo<'a>,
676          accounts: RemoveLiquidityOrcaCpiAccounts<'a, 'b>,
677              args: RemoveLiquidityOrcaInstructionArgs,
678      ) -> Self {
679    Self {
680      __program: program,
681              authority: accounts.authority,
682              tuna_config: accounts.tuna_config,
683              market: accounts.market,
684              mint_a: accounts.mint_a,
685              mint_b: accounts.mint_b,
686              vault_a: accounts.vault_a,
687              vault_b: accounts.vault_b,
688              vault_a_ata: accounts.vault_a_ata,
689              vault_b_ata: accounts.vault_b_ata,
690              tuna_position: accounts.tuna_position,
691              tuna_position_ata: accounts.tuna_position_ata,
692              tuna_position_ata_a: accounts.tuna_position_ata_a,
693              tuna_position_ata_b: accounts.tuna_position_ata_b,
694              tuna_position_owner_ata_a: accounts.tuna_position_owner_ata_a,
695              tuna_position_owner_ata_b: accounts.tuna_position_owner_ata_b,
696              pyth_oracle_price_feed_a: accounts.pyth_oracle_price_feed_a,
697              pyth_oracle_price_feed_b: accounts.pyth_oracle_price_feed_b,
698              whirlpool_program: accounts.whirlpool_program,
699              whirlpool: accounts.whirlpool,
700              orca_position: accounts.orca_position,
701              token_program_a: accounts.token_program_a,
702              token_program_b: accounts.token_program_b,
703              memo_program: accounts.memo_program,
704                    __args: args,
705          }
706  }
707  #[inline(always)]
708  pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
709    self.invoke_signed_with_remaining_accounts(&[], &[])
710  }
711  #[inline(always)]
712  pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)]) -> solana_program::entrypoint::ProgramResult {
713    self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
714  }
715  #[inline(always)]
716  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program::entrypoint::ProgramResult {
717    self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
718  }
719  #[allow(clippy::arithmetic_side_effects)]
720  #[allow(clippy::clone_on_copy)]
721  #[allow(clippy::vec_init_then_push)]
722  pub fn invoke_signed_with_remaining_accounts(
723    &self,
724    signers_seeds: &[&[&[u8]]],
725    remaining_accounts: &[(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)]
726  ) -> solana_program::entrypoint::ProgramResult {
727    let mut accounts = Vec::with_capacity(23+ remaining_accounts.len());
728                            accounts.push(solana_program::instruction::AccountMeta::new(
729            *self.authority.key,
730            true
731          ));
732                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
733            *self.tuna_config.key,
734            false
735          ));
736                                          accounts.push(solana_program::instruction::AccountMeta::new(
737            *self.market.key,
738            false
739          ));
740                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
741            *self.mint_a.key,
742            false
743          ));
744                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
745            *self.mint_b.key,
746            false
747          ));
748                                          accounts.push(solana_program::instruction::AccountMeta::new(
749            *self.vault_a.key,
750            false
751          ));
752                                          accounts.push(solana_program::instruction::AccountMeta::new(
753            *self.vault_b.key,
754            false
755          ));
756                                          accounts.push(solana_program::instruction::AccountMeta::new(
757            *self.vault_a_ata.key,
758            false
759          ));
760                                          accounts.push(solana_program::instruction::AccountMeta::new(
761            *self.vault_b_ata.key,
762            false
763          ));
764                                          accounts.push(solana_program::instruction::AccountMeta::new(
765            *self.tuna_position.key,
766            false
767          ));
768                                          accounts.push(solana_program::instruction::AccountMeta::new(
769            *self.tuna_position_ata.key,
770            false
771          ));
772                                          accounts.push(solana_program::instruction::AccountMeta::new(
773            *self.tuna_position_ata_a.key,
774            false
775          ));
776                                          accounts.push(solana_program::instruction::AccountMeta::new(
777            *self.tuna_position_ata_b.key,
778            false
779          ));
780                                          accounts.push(solana_program::instruction::AccountMeta::new(
781            *self.tuna_position_owner_ata_a.key,
782            false
783          ));
784                                          accounts.push(solana_program::instruction::AccountMeta::new(
785            *self.tuna_position_owner_ata_b.key,
786            false
787          ));
788                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
789            *self.pyth_oracle_price_feed_a.key,
790            false
791          ));
792                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
793            *self.pyth_oracle_price_feed_b.key,
794            false
795          ));
796                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
797            *self.whirlpool_program.key,
798            false
799          ));
800                                          accounts.push(solana_program::instruction::AccountMeta::new(
801            *self.whirlpool.key,
802            false
803          ));
804                                          accounts.push(solana_program::instruction::AccountMeta::new(
805            *self.orca_position.key,
806            false
807          ));
808                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
809            *self.token_program_a.key,
810            false
811          ));
812                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
813            *self.token_program_b.key,
814            false
815          ));
816                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
817            *self.memo_program.key,
818            false
819          ));
820                      remaining_accounts.iter().for_each(|remaining_account| {
821      accounts.push(solana_program::instruction::AccountMeta {
822          pubkey: *remaining_account.0.key,
823          is_signer: remaining_account.1,
824          is_writable: remaining_account.2,
825      })
826    });
827    let mut data = borsh::to_vec(&RemoveLiquidityOrcaInstructionData::new()).unwrap();
828          let mut args = borsh::to_vec(&self.__args).unwrap();
829      data.append(&mut args);
830    
831    let instruction = solana_program::instruction::Instruction {
832      program_id: crate::TUNA_ID,
833      accounts,
834      data,
835    };
836    let mut account_infos = Vec::with_capacity(24 + remaining_accounts.len());
837    account_infos.push(self.__program.clone());
838                  account_infos.push(self.authority.clone());
839                        account_infos.push(self.tuna_config.clone());
840                        account_infos.push(self.market.clone());
841                        account_infos.push(self.mint_a.clone());
842                        account_infos.push(self.mint_b.clone());
843                        account_infos.push(self.vault_a.clone());
844                        account_infos.push(self.vault_b.clone());
845                        account_infos.push(self.vault_a_ata.clone());
846                        account_infos.push(self.vault_b_ata.clone());
847                        account_infos.push(self.tuna_position.clone());
848                        account_infos.push(self.tuna_position_ata.clone());
849                        account_infos.push(self.tuna_position_ata_a.clone());
850                        account_infos.push(self.tuna_position_ata_b.clone());
851                        account_infos.push(self.tuna_position_owner_ata_a.clone());
852                        account_infos.push(self.tuna_position_owner_ata_b.clone());
853                        account_infos.push(self.pyth_oracle_price_feed_a.clone());
854                        account_infos.push(self.pyth_oracle_price_feed_b.clone());
855                        account_infos.push(self.whirlpool_program.clone());
856                        account_infos.push(self.whirlpool.clone());
857                        account_infos.push(self.orca_position.clone());
858                        account_infos.push(self.token_program_a.clone());
859                        account_infos.push(self.token_program_b.clone());
860                        account_infos.push(self.memo_program.clone());
861              remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
862
863    if signers_seeds.is_empty() {
864      solana_program::program::invoke(&instruction, &account_infos)
865    } else {
866      solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds)
867    }
868  }
869}
870
871/// Instruction builder for `RemoveLiquidityOrca` via CPI.
872///
873/// ### Accounts:
874///
875                      ///   0. `[writable, signer]` authority
876          ///   1. `[]` tuna_config
877                ///   2. `[writable]` market
878          ///   3. `[]` mint_a
879          ///   4. `[]` mint_b
880                ///   5. `[writable]` vault_a
881                ///   6. `[writable]` vault_b
882                ///   7. `[writable]` vault_a_ata
883                ///   8. `[writable]` vault_b_ata
884                ///   9. `[writable]` tuna_position
885                ///   10. `[writable]` tuna_position_ata
886                ///   11. `[writable]` tuna_position_ata_a
887                ///   12. `[writable]` tuna_position_ata_b
888                ///   13. `[writable]` tuna_position_owner_ata_a
889                ///   14. `[writable]` tuna_position_owner_ata_b
890          ///   15. `[]` pyth_oracle_price_feed_a
891          ///   16. `[]` pyth_oracle_price_feed_b
892          ///   17. `[]` whirlpool_program
893                ///   18. `[writable]` whirlpool
894                ///   19. `[writable]` orca_position
895          ///   20. `[]` token_program_a
896          ///   21. `[]` token_program_b
897          ///   22. `[]` memo_program
898#[derive(Clone, Debug)]
899pub struct RemoveLiquidityOrcaCpiBuilder<'a, 'b> {
900  instruction: Box<RemoveLiquidityOrcaCpiBuilderInstruction<'a, 'b>>,
901}
902
903impl<'a, 'b> RemoveLiquidityOrcaCpiBuilder<'a, 'b> {
904  pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
905    let instruction = Box::new(RemoveLiquidityOrcaCpiBuilderInstruction {
906      __program: program,
907              authority: None,
908              tuna_config: None,
909              market: None,
910              mint_a: None,
911              mint_b: None,
912              vault_a: None,
913              vault_b: None,
914              vault_a_ata: None,
915              vault_b_ata: None,
916              tuna_position: None,
917              tuna_position_ata: None,
918              tuna_position_ata_a: None,
919              tuna_position_ata_b: None,
920              tuna_position_owner_ata_a: None,
921              tuna_position_owner_ata_b: None,
922              pyth_oracle_price_feed_a: None,
923              pyth_oracle_price_feed_b: None,
924              whirlpool_program: None,
925              whirlpool: None,
926              orca_position: None,
927              token_program_a: None,
928              token_program_b: None,
929              memo_program: None,
930                                            withdraw_percent: None,
931                                swap_to_token: None,
932                                min_removed_amount_a: None,
933                                min_removed_amount_b: None,
934                                max_swap_slippage: None,
935                                remaining_accounts_info: None,
936                    __remaining_accounts: Vec::new(),
937    });
938    Self { instruction }
939  }
940      /// 
941/// TUNA accounts
942/// 
943#[inline(always)]
944    pub fn authority(&mut self, authority: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
945                        self.instruction.authority = Some(authority);
946                    self
947    }
948      #[inline(always)]
949    pub fn tuna_config(&mut self, tuna_config: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
950                        self.instruction.tuna_config = Some(tuna_config);
951                    self
952    }
953      #[inline(always)]
954    pub fn market(&mut self, market: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
955                        self.instruction.market = Some(market);
956                    self
957    }
958      #[inline(always)]
959    pub fn mint_a(&mut self, mint_a: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
960                        self.instruction.mint_a = Some(mint_a);
961                    self
962    }
963      #[inline(always)]
964    pub fn mint_b(&mut self, mint_b: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
965                        self.instruction.mint_b = Some(mint_b);
966                    self
967    }
968      #[inline(always)]
969    pub fn vault_a(&mut self, vault_a: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
970                        self.instruction.vault_a = Some(vault_a);
971                    self
972    }
973      #[inline(always)]
974    pub fn vault_b(&mut self, vault_b: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
975                        self.instruction.vault_b = Some(vault_b);
976                    self
977    }
978      #[inline(always)]
979    pub fn vault_a_ata(&mut self, vault_a_ata: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
980                        self.instruction.vault_a_ata = Some(vault_a_ata);
981                    self
982    }
983      #[inline(always)]
984    pub fn vault_b_ata(&mut self, vault_b_ata: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
985                        self.instruction.vault_b_ata = Some(vault_b_ata);
986                    self
987    }
988      #[inline(always)]
989    pub fn tuna_position(&mut self, tuna_position: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
990                        self.instruction.tuna_position = Some(tuna_position);
991                    self
992    }
993      #[inline(always)]
994    pub fn tuna_position_ata(&mut self, tuna_position_ata: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
995                        self.instruction.tuna_position_ata = Some(tuna_position_ata);
996                    self
997    }
998      #[inline(always)]
999    pub fn tuna_position_ata_a(&mut self, tuna_position_ata_a: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1000                        self.instruction.tuna_position_ata_a = Some(tuna_position_ata_a);
1001                    self
1002    }
1003      #[inline(always)]
1004    pub fn tuna_position_ata_b(&mut self, tuna_position_ata_b: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1005                        self.instruction.tuna_position_ata_b = Some(tuna_position_ata_b);
1006                    self
1007    }
1008      #[inline(always)]
1009    pub fn tuna_position_owner_ata_a(&mut self, tuna_position_owner_ata_a: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1010                        self.instruction.tuna_position_owner_ata_a = Some(tuna_position_owner_ata_a);
1011                    self
1012    }
1013      #[inline(always)]
1014    pub fn tuna_position_owner_ata_b(&mut self, tuna_position_owner_ata_b: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1015                        self.instruction.tuna_position_owner_ata_b = Some(tuna_position_owner_ata_b);
1016                    self
1017    }
1018      #[inline(always)]
1019    pub fn pyth_oracle_price_feed_a(&mut self, pyth_oracle_price_feed_a: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1020                        self.instruction.pyth_oracle_price_feed_a = Some(pyth_oracle_price_feed_a);
1021                    self
1022    }
1023      #[inline(always)]
1024    pub fn pyth_oracle_price_feed_b(&mut self, pyth_oracle_price_feed_b: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1025                        self.instruction.pyth_oracle_price_feed_b = Some(pyth_oracle_price_feed_b);
1026                    self
1027    }
1028      /// 
1029/// ORCA accounts
1030/// 
1031#[inline(always)]
1032    pub fn whirlpool_program(&mut self, whirlpool_program: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1033                        self.instruction.whirlpool_program = Some(whirlpool_program);
1034                    self
1035    }
1036      #[inline(always)]
1037    pub fn whirlpool(&mut self, whirlpool: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1038                        self.instruction.whirlpool = Some(whirlpool);
1039                    self
1040    }
1041      #[inline(always)]
1042    pub fn orca_position(&mut self, orca_position: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1043                        self.instruction.orca_position = Some(orca_position);
1044                    self
1045    }
1046      #[inline(always)]
1047    pub fn token_program_a(&mut self, token_program_a: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1048                        self.instruction.token_program_a = Some(token_program_a);
1049                    self
1050    }
1051      #[inline(always)]
1052    pub fn token_program_b(&mut self, token_program_b: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1053                        self.instruction.token_program_b = Some(token_program_b);
1054                    self
1055    }
1056      #[inline(always)]
1057    pub fn memo_program(&mut self, memo_program: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
1058                        self.instruction.memo_program = Some(memo_program);
1059                    self
1060    }
1061                    #[inline(always)]
1062      pub fn withdraw_percent(&mut self, withdraw_percent: u32) -> &mut Self {
1063        self.instruction.withdraw_percent = Some(withdraw_percent);
1064        self
1065      }
1066                #[inline(always)]
1067      pub fn swap_to_token(&mut self, swap_to_token: u8) -> &mut Self {
1068        self.instruction.swap_to_token = Some(swap_to_token);
1069        self
1070      }
1071                #[inline(always)]
1072      pub fn min_removed_amount_a(&mut self, min_removed_amount_a: u64) -> &mut Self {
1073        self.instruction.min_removed_amount_a = Some(min_removed_amount_a);
1074        self
1075      }
1076                #[inline(always)]
1077      pub fn min_removed_amount_b(&mut self, min_removed_amount_b: u64) -> &mut Self {
1078        self.instruction.min_removed_amount_b = Some(min_removed_amount_b);
1079        self
1080      }
1081                #[inline(always)]
1082      pub fn max_swap_slippage(&mut self, max_swap_slippage: u32) -> &mut Self {
1083        self.instruction.max_swap_slippage = Some(max_swap_slippage);
1084        self
1085      }
1086                #[inline(always)]
1087      pub fn remaining_accounts_info(&mut self, remaining_accounts_info: RemainingAccountsInfo) -> &mut Self {
1088        self.instruction.remaining_accounts_info = Some(remaining_accounts_info);
1089        self
1090      }
1091        /// Add an additional account to the instruction.
1092  #[inline(always)]
1093  pub fn add_remaining_account(&mut self, account: &'b solana_program::account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
1094    self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
1095    self
1096  }
1097  /// Add additional accounts to the instruction.
1098  ///
1099  /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
1100  /// and a `bool` indicating whether the account is a signer or not.
1101  #[inline(always)]
1102  pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
1103    self.instruction.__remaining_accounts.extend_from_slice(accounts);
1104    self
1105  }
1106  #[inline(always)]
1107  pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
1108    self.invoke_signed(&[])
1109  }
1110  #[allow(clippy::clone_on_copy)]
1111  #[allow(clippy::vec_init_then_push)]
1112  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program::entrypoint::ProgramResult {
1113          let args = RemoveLiquidityOrcaInstructionArgs {
1114                                                              withdraw_percent: self.instruction.withdraw_percent.clone().expect("withdraw_percent is not set"),
1115                                                                  swap_to_token: self.instruction.swap_to_token.clone().expect("swap_to_token is not set"),
1116                                                                  min_removed_amount_a: self.instruction.min_removed_amount_a.clone().expect("min_removed_amount_a is not set"),
1117                                                                  min_removed_amount_b: self.instruction.min_removed_amount_b.clone().expect("min_removed_amount_b is not set"),
1118                                                                  max_swap_slippage: self.instruction.max_swap_slippage.clone().expect("max_swap_slippage is not set"),
1119                                                                  remaining_accounts_info: self.instruction.remaining_accounts_info.clone().expect("remaining_accounts_info is not set"),
1120                                    };
1121        let instruction = RemoveLiquidityOrcaCpi {
1122        __program: self.instruction.__program,
1123                  
1124          authority: self.instruction.authority.expect("authority is not set"),
1125                  
1126          tuna_config: self.instruction.tuna_config.expect("tuna_config is not set"),
1127                  
1128          market: self.instruction.market.expect("market is not set"),
1129                  
1130          mint_a: self.instruction.mint_a.expect("mint_a is not set"),
1131                  
1132          mint_b: self.instruction.mint_b.expect("mint_b is not set"),
1133                  
1134          vault_a: self.instruction.vault_a.expect("vault_a is not set"),
1135                  
1136          vault_b: self.instruction.vault_b.expect("vault_b is not set"),
1137                  
1138          vault_a_ata: self.instruction.vault_a_ata.expect("vault_a_ata is not set"),
1139                  
1140          vault_b_ata: self.instruction.vault_b_ata.expect("vault_b_ata is not set"),
1141                  
1142          tuna_position: self.instruction.tuna_position.expect("tuna_position is not set"),
1143                  
1144          tuna_position_ata: self.instruction.tuna_position_ata.expect("tuna_position_ata is not set"),
1145                  
1146          tuna_position_ata_a: self.instruction.tuna_position_ata_a.expect("tuna_position_ata_a is not set"),
1147                  
1148          tuna_position_ata_b: self.instruction.tuna_position_ata_b.expect("tuna_position_ata_b is not set"),
1149                  
1150          tuna_position_owner_ata_a: self.instruction.tuna_position_owner_ata_a.expect("tuna_position_owner_ata_a is not set"),
1151                  
1152          tuna_position_owner_ata_b: self.instruction.tuna_position_owner_ata_b.expect("tuna_position_owner_ata_b is not set"),
1153                  
1154          pyth_oracle_price_feed_a: self.instruction.pyth_oracle_price_feed_a.expect("pyth_oracle_price_feed_a is not set"),
1155                  
1156          pyth_oracle_price_feed_b: self.instruction.pyth_oracle_price_feed_b.expect("pyth_oracle_price_feed_b is not set"),
1157                  
1158          whirlpool_program: self.instruction.whirlpool_program.expect("whirlpool_program is not set"),
1159                  
1160          whirlpool: self.instruction.whirlpool.expect("whirlpool is not set"),
1161                  
1162          orca_position: self.instruction.orca_position.expect("orca_position is not set"),
1163                  
1164          token_program_a: self.instruction.token_program_a.expect("token_program_a is not set"),
1165                  
1166          token_program_b: self.instruction.token_program_b.expect("token_program_b is not set"),
1167                  
1168          memo_program: self.instruction.memo_program.expect("memo_program is not set"),
1169                          __args: args,
1170            };
1171    instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
1172  }
1173}
1174
1175#[derive(Clone, Debug)]
1176struct RemoveLiquidityOrcaCpiBuilderInstruction<'a, 'b> {
1177  __program: &'b solana_program::account_info::AccountInfo<'a>,
1178            authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1179                tuna_config: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1180                market: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1181                mint_a: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1182                mint_b: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1183                vault_a: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1184                vault_b: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1185                vault_a_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1186                vault_b_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1187                tuna_position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1188                tuna_position_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1189                tuna_position_ata_a: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1190                tuna_position_ata_b: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1191                tuna_position_owner_ata_a: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1192                tuna_position_owner_ata_b: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1193                pyth_oracle_price_feed_a: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1194                pyth_oracle_price_feed_b: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1195                whirlpool_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1196                whirlpool: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1197                orca_position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1198                token_program_a: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1199                token_program_b: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1200                memo_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1201                        withdraw_percent: Option<u32>,
1202                swap_to_token: Option<u8>,
1203                min_removed_amount_a: Option<u64>,
1204                min_removed_amount_b: Option<u64>,
1205                max_swap_slippage: Option<u32>,
1206                remaining_accounts_info: Option<RemainingAccountsInfo>,
1207        /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
1208  __remaining_accounts: Vec<(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)>,
1209}
1210