defituna_client/generated/instructions/
update_market.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 solana_pubkey::Pubkey;
9use borsh::BorshSerialize;
10use borsh::BorshDeserialize;
11
12pub const UPDATE_MARKET_DISCRIMINATOR: [u8; 8] = [153, 39, 2, 197, 179, 50, 199, 217];
13
14/// Accounts.
15#[derive(Debug)]
16pub struct UpdateMarket {
17      
18              
19          pub authority: solana_pubkey::Pubkey,
20          
21              
22          pub tuna_config: solana_pubkey::Pubkey,
23          
24              
25          pub market: solana_pubkey::Pubkey,
26      }
27
28impl UpdateMarket {
29  pub fn instruction(&self, args: UpdateMarketInstructionArgs) -> solana_instruction::Instruction {
30    self.instruction_with_remaining_accounts(args, &[])
31  }
32  #[allow(clippy::arithmetic_side_effects)]
33  #[allow(clippy::vec_init_then_push)]
34  pub fn instruction_with_remaining_accounts(&self, args: UpdateMarketInstructionArgs, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
35    let mut accounts = Vec::with_capacity(3+ remaining_accounts.len());
36                            accounts.push(solana_instruction::AccountMeta::new(
37            self.authority,
38            true
39          ));
40                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
41            self.tuna_config,
42            false
43          ));
44                                          accounts.push(solana_instruction::AccountMeta::new(
45            self.market,
46            false
47          ));
48                      accounts.extend_from_slice(remaining_accounts);
49    let mut data = borsh::to_vec(&UpdateMarketInstructionData::new()).unwrap();
50          let mut args = borsh::to_vec(&args).unwrap();
51      data.append(&mut args);
52    
53    solana_instruction::Instruction {
54      program_id: crate::TUNA_ID,
55      accounts,
56      data,
57    }
58  }
59}
60
61#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
62#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
63 pub struct UpdateMarketInstructionData {
64            discriminator: [u8; 8],
65                                                                                                }
66
67impl UpdateMarketInstructionData {
68  pub fn new() -> Self {
69    Self {
70                        discriminator: [153, 39, 2, 197, 179, 50, 199, 217],
71                                                                                                                                                                                                                                    }
72  }
73}
74
75impl Default for UpdateMarketInstructionData {
76  fn default() -> Self {
77    Self::new()
78  }
79}
80
81#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
82#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
83 pub struct UpdateMarketInstructionArgs {
84                  pub address_lookup_table: Pubkey,
85                pub max_leverage: u32,
86                pub protocol_fee: u16,
87                pub protocol_fee_on_collateral: u16,
88                pub liquidation_fee: u32,
89                pub liquidation_threshold: u32,
90                pub limit_order_execution_fee: u32,
91                pub oracle_price_deviation_threshold: u32,
92                pub disabled: bool,
93                pub borrow_limit_a: u64,
94                pub borrow_limit_b: u64,
95                pub max_swap_slippage: u32,
96                pub rebalance_protocol_fee: u32,
97                pub spot_position_size_limit_a: u64,
98                pub spot_position_size_limit_b: u64,
99      }
100
101
102/// Instruction builder for `UpdateMarket`.
103///
104/// ### Accounts:
105///
106                      ///   0. `[writable, signer]` authority
107          ///   1. `[]` tuna_config
108                ///   2. `[writable]` market
109#[derive(Clone, Debug, Default)]
110pub struct UpdateMarketBuilder {
111            authority: Option<solana_pubkey::Pubkey>,
112                tuna_config: Option<solana_pubkey::Pubkey>,
113                market: Option<solana_pubkey::Pubkey>,
114                        address_lookup_table: Option<Pubkey>,
115                max_leverage: Option<u32>,
116                protocol_fee: Option<u16>,
117                protocol_fee_on_collateral: Option<u16>,
118                liquidation_fee: Option<u32>,
119                liquidation_threshold: Option<u32>,
120                limit_order_execution_fee: Option<u32>,
121                oracle_price_deviation_threshold: Option<u32>,
122                disabled: Option<bool>,
123                borrow_limit_a: Option<u64>,
124                borrow_limit_b: Option<u64>,
125                max_swap_slippage: Option<u32>,
126                rebalance_protocol_fee: Option<u32>,
127                spot_position_size_limit_a: Option<u64>,
128                spot_position_size_limit_b: Option<u64>,
129        __remaining_accounts: Vec<solana_instruction::AccountMeta>,
130}
131
132impl UpdateMarketBuilder {
133  pub fn new() -> Self {
134    Self::default()
135  }
136            #[inline(always)]
137    pub fn authority(&mut self, authority: solana_pubkey::Pubkey) -> &mut Self {
138                        self.authority = Some(authority);
139                    self
140    }
141            #[inline(always)]
142    pub fn tuna_config(&mut self, tuna_config: solana_pubkey::Pubkey) -> &mut Self {
143                        self.tuna_config = Some(tuna_config);
144                    self
145    }
146            #[inline(always)]
147    pub fn market(&mut self, market: solana_pubkey::Pubkey) -> &mut Self {
148                        self.market = Some(market);
149                    self
150    }
151                    #[inline(always)]
152      pub fn address_lookup_table(&mut self, address_lookup_table: Pubkey) -> &mut Self {
153        self.address_lookup_table = Some(address_lookup_table);
154        self
155      }
156                #[inline(always)]
157      pub fn max_leverage(&mut self, max_leverage: u32) -> &mut Self {
158        self.max_leverage = Some(max_leverage);
159        self
160      }
161                #[inline(always)]
162      pub fn protocol_fee(&mut self, protocol_fee: u16) -> &mut Self {
163        self.protocol_fee = Some(protocol_fee);
164        self
165      }
166                #[inline(always)]
167      pub fn protocol_fee_on_collateral(&mut self, protocol_fee_on_collateral: u16) -> &mut Self {
168        self.protocol_fee_on_collateral = Some(protocol_fee_on_collateral);
169        self
170      }
171                #[inline(always)]
172      pub fn liquidation_fee(&mut self, liquidation_fee: u32) -> &mut Self {
173        self.liquidation_fee = Some(liquidation_fee);
174        self
175      }
176                #[inline(always)]
177      pub fn liquidation_threshold(&mut self, liquidation_threshold: u32) -> &mut Self {
178        self.liquidation_threshold = Some(liquidation_threshold);
179        self
180      }
181                #[inline(always)]
182      pub fn limit_order_execution_fee(&mut self, limit_order_execution_fee: u32) -> &mut Self {
183        self.limit_order_execution_fee = Some(limit_order_execution_fee);
184        self
185      }
186                #[inline(always)]
187      pub fn oracle_price_deviation_threshold(&mut self, oracle_price_deviation_threshold: u32) -> &mut Self {
188        self.oracle_price_deviation_threshold = Some(oracle_price_deviation_threshold);
189        self
190      }
191                #[inline(always)]
192      pub fn disabled(&mut self, disabled: bool) -> &mut Self {
193        self.disabled = Some(disabled);
194        self
195      }
196                #[inline(always)]
197      pub fn borrow_limit_a(&mut self, borrow_limit_a: u64) -> &mut Self {
198        self.borrow_limit_a = Some(borrow_limit_a);
199        self
200      }
201                #[inline(always)]
202      pub fn borrow_limit_b(&mut self, borrow_limit_b: u64) -> &mut Self {
203        self.borrow_limit_b = Some(borrow_limit_b);
204        self
205      }
206                #[inline(always)]
207      pub fn max_swap_slippage(&mut self, max_swap_slippage: u32) -> &mut Self {
208        self.max_swap_slippage = Some(max_swap_slippage);
209        self
210      }
211                #[inline(always)]
212      pub fn rebalance_protocol_fee(&mut self, rebalance_protocol_fee: u32) -> &mut Self {
213        self.rebalance_protocol_fee = Some(rebalance_protocol_fee);
214        self
215      }
216                #[inline(always)]
217      pub fn spot_position_size_limit_a(&mut self, spot_position_size_limit_a: u64) -> &mut Self {
218        self.spot_position_size_limit_a = Some(spot_position_size_limit_a);
219        self
220      }
221                #[inline(always)]
222      pub fn spot_position_size_limit_b(&mut self, spot_position_size_limit_b: u64) -> &mut Self {
223        self.spot_position_size_limit_b = Some(spot_position_size_limit_b);
224        self
225      }
226        /// Add an additional account to the instruction.
227  #[inline(always)]
228  pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
229    self.__remaining_accounts.push(account);
230    self
231  }
232  /// Add additional accounts to the instruction.
233  #[inline(always)]
234  pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
235    self.__remaining_accounts.extend_from_slice(accounts);
236    self
237  }
238  #[allow(clippy::clone_on_copy)]
239  pub fn instruction(&self) -> solana_instruction::Instruction {
240    let accounts = UpdateMarket {
241                              authority: self.authority.expect("authority is not set"),
242                                        tuna_config: self.tuna_config.expect("tuna_config is not set"),
243                                        market: self.market.expect("market is not set"),
244                      };
245          let args = UpdateMarketInstructionArgs {
246                                                              address_lookup_table: self.address_lookup_table.clone().expect("address_lookup_table is not set"),
247                                                                  max_leverage: self.max_leverage.clone().expect("max_leverage is not set"),
248                                                                  protocol_fee: self.protocol_fee.clone().expect("protocol_fee is not set"),
249                                                                  protocol_fee_on_collateral: self.protocol_fee_on_collateral.clone().expect("protocol_fee_on_collateral is not set"),
250                                                                  liquidation_fee: self.liquidation_fee.clone().expect("liquidation_fee is not set"),
251                                                                  liquidation_threshold: self.liquidation_threshold.clone().expect("liquidation_threshold is not set"),
252                                                                  limit_order_execution_fee: self.limit_order_execution_fee.clone().expect("limit_order_execution_fee is not set"),
253                                                                  oracle_price_deviation_threshold: self.oracle_price_deviation_threshold.clone().expect("oracle_price_deviation_threshold is not set"),
254                                                                  disabled: self.disabled.clone().expect("disabled is not set"),
255                                                                  borrow_limit_a: self.borrow_limit_a.clone().expect("borrow_limit_a is not set"),
256                                                                  borrow_limit_b: self.borrow_limit_b.clone().expect("borrow_limit_b is not set"),
257                                                                  max_swap_slippage: self.max_swap_slippage.clone().expect("max_swap_slippage is not set"),
258                                                                  rebalance_protocol_fee: self.rebalance_protocol_fee.clone().expect("rebalance_protocol_fee is not set"),
259                                                                  spot_position_size_limit_a: self.spot_position_size_limit_a.clone().expect("spot_position_size_limit_a is not set"),
260                                                                  spot_position_size_limit_b: self.spot_position_size_limit_b.clone().expect("spot_position_size_limit_b is not set"),
261                                    };
262    
263    accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
264  }
265}
266
267  /// `update_market` CPI accounts.
268  pub struct UpdateMarketCpiAccounts<'a, 'b> {
269          
270                    
271              pub authority: &'b solana_account_info::AccountInfo<'a>,
272                
273                    
274              pub tuna_config: &'b solana_account_info::AccountInfo<'a>,
275                
276                    
277              pub market: &'b solana_account_info::AccountInfo<'a>,
278            }
279
280/// `update_market` CPI instruction.
281pub struct UpdateMarketCpi<'a, 'b> {
282  /// The program to invoke.
283  pub __program: &'b solana_account_info::AccountInfo<'a>,
284      
285              
286          pub authority: &'b solana_account_info::AccountInfo<'a>,
287          
288              
289          pub tuna_config: &'b solana_account_info::AccountInfo<'a>,
290          
291              
292          pub market: &'b solana_account_info::AccountInfo<'a>,
293            /// The arguments for the instruction.
294    pub __args: UpdateMarketInstructionArgs,
295  }
296
297impl<'a, 'b> UpdateMarketCpi<'a, 'b> {
298  pub fn new(
299    program: &'b solana_account_info::AccountInfo<'a>,
300          accounts: UpdateMarketCpiAccounts<'a, 'b>,
301              args: UpdateMarketInstructionArgs,
302      ) -> Self {
303    Self {
304      __program: program,
305              authority: accounts.authority,
306              tuna_config: accounts.tuna_config,
307              market: accounts.market,
308                    __args: args,
309          }
310  }
311  #[inline(always)]
312  pub fn invoke(&self) -> solana_program_error::ProgramResult {
313    self.invoke_signed_with_remaining_accounts(&[], &[])
314  }
315  #[inline(always)]
316  pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
317    self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
318  }
319  #[inline(always)]
320  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
321    self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
322  }
323  #[allow(clippy::arithmetic_side_effects)]
324  #[allow(clippy::clone_on_copy)]
325  #[allow(clippy::vec_init_then_push)]
326  pub fn invoke_signed_with_remaining_accounts(
327    &self,
328    signers_seeds: &[&[&[u8]]],
329    remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
330  ) -> solana_program_error::ProgramResult {
331    let mut accounts = Vec::with_capacity(3+ remaining_accounts.len());
332                            accounts.push(solana_instruction::AccountMeta::new(
333            *self.authority.key,
334            true
335          ));
336                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
337            *self.tuna_config.key,
338            false
339          ));
340                                          accounts.push(solana_instruction::AccountMeta::new(
341            *self.market.key,
342            false
343          ));
344                      remaining_accounts.iter().for_each(|remaining_account| {
345      accounts.push(solana_instruction::AccountMeta {
346          pubkey: *remaining_account.0.key,
347          is_signer: remaining_account.1,
348          is_writable: remaining_account.2,
349      })
350    });
351    let mut data = borsh::to_vec(&UpdateMarketInstructionData::new()).unwrap();
352          let mut args = borsh::to_vec(&self.__args).unwrap();
353      data.append(&mut args);
354    
355    let instruction = solana_instruction::Instruction {
356      program_id: crate::TUNA_ID,
357      accounts,
358      data,
359    };
360    let mut account_infos = Vec::with_capacity(4 + remaining_accounts.len());
361    account_infos.push(self.__program.clone());
362                  account_infos.push(self.authority.clone());
363                        account_infos.push(self.tuna_config.clone());
364                        account_infos.push(self.market.clone());
365              remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
366
367    if signers_seeds.is_empty() {
368      solana_cpi::invoke(&instruction, &account_infos)
369    } else {
370      solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
371    }
372  }
373}
374
375/// Instruction builder for `UpdateMarket` via CPI.
376///
377/// ### Accounts:
378///
379                      ///   0. `[writable, signer]` authority
380          ///   1. `[]` tuna_config
381                ///   2. `[writable]` market
382#[derive(Clone, Debug)]
383pub struct UpdateMarketCpiBuilder<'a, 'b> {
384  instruction: Box<UpdateMarketCpiBuilderInstruction<'a, 'b>>,
385}
386
387impl<'a, 'b> UpdateMarketCpiBuilder<'a, 'b> {
388  pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
389    let instruction = Box::new(UpdateMarketCpiBuilderInstruction {
390      __program: program,
391              authority: None,
392              tuna_config: None,
393              market: None,
394                                            address_lookup_table: None,
395                                max_leverage: None,
396                                protocol_fee: None,
397                                protocol_fee_on_collateral: None,
398                                liquidation_fee: None,
399                                liquidation_threshold: None,
400                                limit_order_execution_fee: None,
401                                oracle_price_deviation_threshold: None,
402                                disabled: None,
403                                borrow_limit_a: None,
404                                borrow_limit_b: None,
405                                max_swap_slippage: None,
406                                rebalance_protocol_fee: None,
407                                spot_position_size_limit_a: None,
408                                spot_position_size_limit_b: None,
409                    __remaining_accounts: Vec::new(),
410    });
411    Self { instruction }
412  }
413      #[inline(always)]
414    pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
415                        self.instruction.authority = Some(authority);
416                    self
417    }
418      #[inline(always)]
419    pub fn tuna_config(&mut self, tuna_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
420                        self.instruction.tuna_config = Some(tuna_config);
421                    self
422    }
423      #[inline(always)]
424    pub fn market(&mut self, market: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
425                        self.instruction.market = Some(market);
426                    self
427    }
428                    #[inline(always)]
429      pub fn address_lookup_table(&mut self, address_lookup_table: Pubkey) -> &mut Self {
430        self.instruction.address_lookup_table = Some(address_lookup_table);
431        self
432      }
433                #[inline(always)]
434      pub fn max_leverage(&mut self, max_leverage: u32) -> &mut Self {
435        self.instruction.max_leverage = Some(max_leverage);
436        self
437      }
438                #[inline(always)]
439      pub fn protocol_fee(&mut self, protocol_fee: u16) -> &mut Self {
440        self.instruction.protocol_fee = Some(protocol_fee);
441        self
442      }
443                #[inline(always)]
444      pub fn protocol_fee_on_collateral(&mut self, protocol_fee_on_collateral: u16) -> &mut Self {
445        self.instruction.protocol_fee_on_collateral = Some(protocol_fee_on_collateral);
446        self
447      }
448                #[inline(always)]
449      pub fn liquidation_fee(&mut self, liquidation_fee: u32) -> &mut Self {
450        self.instruction.liquidation_fee = Some(liquidation_fee);
451        self
452      }
453                #[inline(always)]
454      pub fn liquidation_threshold(&mut self, liquidation_threshold: u32) -> &mut Self {
455        self.instruction.liquidation_threshold = Some(liquidation_threshold);
456        self
457      }
458                #[inline(always)]
459      pub fn limit_order_execution_fee(&mut self, limit_order_execution_fee: u32) -> &mut Self {
460        self.instruction.limit_order_execution_fee = Some(limit_order_execution_fee);
461        self
462      }
463                #[inline(always)]
464      pub fn oracle_price_deviation_threshold(&mut self, oracle_price_deviation_threshold: u32) -> &mut Self {
465        self.instruction.oracle_price_deviation_threshold = Some(oracle_price_deviation_threshold);
466        self
467      }
468                #[inline(always)]
469      pub fn disabled(&mut self, disabled: bool) -> &mut Self {
470        self.instruction.disabled = Some(disabled);
471        self
472      }
473                #[inline(always)]
474      pub fn borrow_limit_a(&mut self, borrow_limit_a: u64) -> &mut Self {
475        self.instruction.borrow_limit_a = Some(borrow_limit_a);
476        self
477      }
478                #[inline(always)]
479      pub fn borrow_limit_b(&mut self, borrow_limit_b: u64) -> &mut Self {
480        self.instruction.borrow_limit_b = Some(borrow_limit_b);
481        self
482      }
483                #[inline(always)]
484      pub fn max_swap_slippage(&mut self, max_swap_slippage: u32) -> &mut Self {
485        self.instruction.max_swap_slippage = Some(max_swap_slippage);
486        self
487      }
488                #[inline(always)]
489      pub fn rebalance_protocol_fee(&mut self, rebalance_protocol_fee: u32) -> &mut Self {
490        self.instruction.rebalance_protocol_fee = Some(rebalance_protocol_fee);
491        self
492      }
493                #[inline(always)]
494      pub fn spot_position_size_limit_a(&mut self, spot_position_size_limit_a: u64) -> &mut Self {
495        self.instruction.spot_position_size_limit_a = Some(spot_position_size_limit_a);
496        self
497      }
498                #[inline(always)]
499      pub fn spot_position_size_limit_b(&mut self, spot_position_size_limit_b: u64) -> &mut Self {
500        self.instruction.spot_position_size_limit_b = Some(spot_position_size_limit_b);
501        self
502      }
503        /// Add an additional account to the instruction.
504  #[inline(always)]
505  pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
506    self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
507    self
508  }
509  /// Add additional accounts to the instruction.
510  ///
511  /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
512  /// and a `bool` indicating whether the account is a signer or not.
513  #[inline(always)]
514  pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
515    self.instruction.__remaining_accounts.extend_from_slice(accounts);
516    self
517  }
518  #[inline(always)]
519  pub fn invoke(&self) -> solana_program_error::ProgramResult {
520    self.invoke_signed(&[])
521  }
522  #[allow(clippy::clone_on_copy)]
523  #[allow(clippy::vec_init_then_push)]
524  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
525          let args = UpdateMarketInstructionArgs {
526                                                              address_lookup_table: self.instruction.address_lookup_table.clone().expect("address_lookup_table is not set"),
527                                                                  max_leverage: self.instruction.max_leverage.clone().expect("max_leverage is not set"),
528                                                                  protocol_fee: self.instruction.protocol_fee.clone().expect("protocol_fee is not set"),
529                                                                  protocol_fee_on_collateral: self.instruction.protocol_fee_on_collateral.clone().expect("protocol_fee_on_collateral is not set"),
530                                                                  liquidation_fee: self.instruction.liquidation_fee.clone().expect("liquidation_fee is not set"),
531                                                                  liquidation_threshold: self.instruction.liquidation_threshold.clone().expect("liquidation_threshold is not set"),
532                                                                  limit_order_execution_fee: self.instruction.limit_order_execution_fee.clone().expect("limit_order_execution_fee is not set"),
533                                                                  oracle_price_deviation_threshold: self.instruction.oracle_price_deviation_threshold.clone().expect("oracle_price_deviation_threshold is not set"),
534                                                                  disabled: self.instruction.disabled.clone().expect("disabled is not set"),
535                                                                  borrow_limit_a: self.instruction.borrow_limit_a.clone().expect("borrow_limit_a is not set"),
536                                                                  borrow_limit_b: self.instruction.borrow_limit_b.clone().expect("borrow_limit_b is not set"),
537                                                                  max_swap_slippage: self.instruction.max_swap_slippage.clone().expect("max_swap_slippage is not set"),
538                                                                  rebalance_protocol_fee: self.instruction.rebalance_protocol_fee.clone().expect("rebalance_protocol_fee is not set"),
539                                                                  spot_position_size_limit_a: self.instruction.spot_position_size_limit_a.clone().expect("spot_position_size_limit_a is not set"),
540                                                                  spot_position_size_limit_b: self.instruction.spot_position_size_limit_b.clone().expect("spot_position_size_limit_b is not set"),
541                                    };
542        let instruction = UpdateMarketCpi {
543        __program: self.instruction.__program,
544                  
545          authority: self.instruction.authority.expect("authority is not set"),
546                  
547          tuna_config: self.instruction.tuna_config.expect("tuna_config is not set"),
548                  
549          market: self.instruction.market.expect("market is not set"),
550                          __args: args,
551            };
552    instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
553  }
554}
555
556#[derive(Clone, Debug)]
557struct UpdateMarketCpiBuilderInstruction<'a, 'b> {
558  __program: &'b solana_account_info::AccountInfo<'a>,
559            authority: Option<&'b solana_account_info::AccountInfo<'a>>,
560                tuna_config: Option<&'b solana_account_info::AccountInfo<'a>>,
561                market: Option<&'b solana_account_info::AccountInfo<'a>>,
562                        address_lookup_table: Option<Pubkey>,
563                max_leverage: Option<u32>,
564                protocol_fee: Option<u16>,
565                protocol_fee_on_collateral: Option<u16>,
566                liquidation_fee: Option<u32>,
567                liquidation_threshold: Option<u32>,
568                limit_order_execution_fee: Option<u32>,
569                oracle_price_deviation_threshold: Option<u32>,
570                disabled: Option<bool>,
571                borrow_limit_a: Option<u64>,
572                borrow_limit_b: Option<u64>,
573                max_swap_slippage: Option<u32>,
574                rebalance_protocol_fee: Option<u32>,
575                spot_position_size_limit_a: Option<u64>,
576                spot_position_size_limit_b: Option<u64>,
577        /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
578  __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
579}
580