Skip to main content

orca_sol/instructions/
initialize_adaptive_fee_tier.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 borsh::BorshDeserialize;
9use borsh::BorshSerialize;
10use solana_pubkey::Pubkey;
11
12/// Accounts.
13#[derive(Debug)]
14pub struct InitializeAdaptiveFeeTier {
15    pub whirlpools_config: solana_pubkey::Pubkey,
16
17    pub adaptive_fee_tier: solana_pubkey::Pubkey,
18
19    pub funder: solana_pubkey::Pubkey,
20
21    pub fee_authority: solana_pubkey::Pubkey,
22
23    pub system_program: solana_pubkey::Pubkey,
24}
25
26impl InitializeAdaptiveFeeTier {
27    pub fn instruction(
28        &self,
29        args: InitializeAdaptiveFeeTierInstructionArgs,
30    ) -> solana_instruction::Instruction {
31        self.instruction_with_remaining_accounts(args, &[])
32    }
33    #[allow(clippy::arithmetic_side_effects)]
34    #[allow(clippy::vec_init_then_push)]
35    pub fn instruction_with_remaining_accounts(
36        &self,
37        args: InitializeAdaptiveFeeTierInstructionArgs,
38        remaining_accounts: &[solana_instruction::AccountMeta],
39    ) -> solana_instruction::Instruction {
40        let mut accounts = Vec::with_capacity(5 + remaining_accounts.len());
41        accounts.push(solana_instruction::AccountMeta::new_readonly(
42            self.whirlpools_config,
43            false,
44        ));
45        accounts.push(solana_instruction::AccountMeta::new(
46            self.adaptive_fee_tier,
47            false,
48        ));
49        accounts.push(solana_instruction::AccountMeta::new(self.funder, true));
50        accounts.push(solana_instruction::AccountMeta::new_readonly(
51            self.fee_authority,
52            true,
53        ));
54        accounts.push(solana_instruction::AccountMeta::new_readonly(
55            self.system_program,
56            false,
57        ));
58        accounts.extend_from_slice(remaining_accounts);
59        let mut data = borsh::to_vec(&InitializeAdaptiveFeeTierInstructionData::new()).unwrap();
60        let mut args = borsh::to_vec(&args).unwrap();
61        data.append(&mut args);
62
63        solana_instruction::Instruction {
64            program_id: crate::WHIRLPOOL_ID,
65            accounts,
66            data,
67        }
68    }
69}
70
71#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
72#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
73pub struct InitializeAdaptiveFeeTierInstructionData {
74    discriminator: [u8; 8],
75}
76
77impl InitializeAdaptiveFeeTierInstructionData {
78    pub fn new() -> Self {
79        Self {
80            discriminator: [77, 99, 208, 200, 141, 123, 117, 48],
81        }
82    }
83}
84
85impl Default for InitializeAdaptiveFeeTierInstructionData {
86    fn default() -> Self {
87        Self::new()
88    }
89}
90
91#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
92#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
93pub struct InitializeAdaptiveFeeTierInstructionArgs {
94    pub fee_tier_index: u16,
95    pub tick_spacing: u16,
96    pub initialize_pool_authority: Pubkey,
97    pub delegated_fee_authority: Pubkey,
98    pub default_base_fee_rate: u16,
99    pub filter_period: u16,
100    pub decay_period: u16,
101    pub reduction_factor: u16,
102    pub adaptive_fee_control_factor: u32,
103    pub max_volatility_accumulator: u32,
104    pub tick_group_size: u16,
105    pub major_swap_threshold_ticks: u16,
106}
107
108/// Instruction builder for `InitializeAdaptiveFeeTier`.
109///
110/// ### Accounts:
111///
112///   0. `[]` whirlpools_config
113///   1. `[writable]` adaptive_fee_tier
114///   2. `[writable, signer]` funder
115///   3. `[signer]` fee_authority
116///   4. `[optional]` system_program (default to `11111111111111111111111111111111`)
117#[derive(Clone, Debug, Default)]
118pub struct InitializeAdaptiveFeeTierBuilder {
119    whirlpools_config: Option<solana_pubkey::Pubkey>,
120    adaptive_fee_tier: Option<solana_pubkey::Pubkey>,
121    funder: Option<solana_pubkey::Pubkey>,
122    fee_authority: Option<solana_pubkey::Pubkey>,
123    system_program: Option<solana_pubkey::Pubkey>,
124    fee_tier_index: Option<u16>,
125    tick_spacing: Option<u16>,
126    initialize_pool_authority: Option<Pubkey>,
127    delegated_fee_authority: Option<Pubkey>,
128    default_base_fee_rate: Option<u16>,
129    filter_period: Option<u16>,
130    decay_period: Option<u16>,
131    reduction_factor: Option<u16>,
132    adaptive_fee_control_factor: Option<u32>,
133    max_volatility_accumulator: Option<u32>,
134    tick_group_size: Option<u16>,
135    major_swap_threshold_ticks: Option<u16>,
136    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
137}
138
139impl InitializeAdaptiveFeeTierBuilder {
140    pub fn new() -> Self {
141        Self::default()
142    }
143    #[inline(always)]
144    pub fn whirlpools_config(&mut self, whirlpools_config: solana_pubkey::Pubkey) -> &mut Self {
145        self.whirlpools_config = Some(whirlpools_config);
146        self
147    }
148    #[inline(always)]
149    pub fn adaptive_fee_tier(&mut self, adaptive_fee_tier: solana_pubkey::Pubkey) -> &mut Self {
150        self.adaptive_fee_tier = Some(adaptive_fee_tier);
151        self
152    }
153    #[inline(always)]
154    pub fn funder(&mut self, funder: solana_pubkey::Pubkey) -> &mut Self {
155        self.funder = Some(funder);
156        self
157    }
158    #[inline(always)]
159    pub fn fee_authority(&mut self, fee_authority: solana_pubkey::Pubkey) -> &mut Self {
160        self.fee_authority = Some(fee_authority);
161        self
162    }
163    /// `[optional account, default to '11111111111111111111111111111111']`
164    #[inline(always)]
165    pub fn system_program(&mut self, system_program: solana_pubkey::Pubkey) -> &mut Self {
166        self.system_program = Some(system_program);
167        self
168    }
169    #[inline(always)]
170    pub fn fee_tier_index(&mut self, fee_tier_index: u16) -> &mut Self {
171        self.fee_tier_index = Some(fee_tier_index);
172        self
173    }
174    #[inline(always)]
175    pub fn tick_spacing(&mut self, tick_spacing: u16) -> &mut Self {
176        self.tick_spacing = Some(tick_spacing);
177        self
178    }
179    #[inline(always)]
180    pub fn initialize_pool_authority(&mut self, initialize_pool_authority: Pubkey) -> &mut Self {
181        self.initialize_pool_authority = Some(initialize_pool_authority);
182        self
183    }
184    #[inline(always)]
185    pub fn delegated_fee_authority(&mut self, delegated_fee_authority: Pubkey) -> &mut Self {
186        self.delegated_fee_authority = Some(delegated_fee_authority);
187        self
188    }
189    #[inline(always)]
190    pub fn default_base_fee_rate(&mut self, default_base_fee_rate: u16) -> &mut Self {
191        self.default_base_fee_rate = Some(default_base_fee_rate);
192        self
193    }
194    #[inline(always)]
195    pub fn filter_period(&mut self, filter_period: u16) -> &mut Self {
196        self.filter_period = Some(filter_period);
197        self
198    }
199    #[inline(always)]
200    pub fn decay_period(&mut self, decay_period: u16) -> &mut Self {
201        self.decay_period = Some(decay_period);
202        self
203    }
204    #[inline(always)]
205    pub fn reduction_factor(&mut self, reduction_factor: u16) -> &mut Self {
206        self.reduction_factor = Some(reduction_factor);
207        self
208    }
209    #[inline(always)]
210    pub fn adaptive_fee_control_factor(&mut self, adaptive_fee_control_factor: u32) -> &mut Self {
211        self.adaptive_fee_control_factor = Some(adaptive_fee_control_factor);
212        self
213    }
214    #[inline(always)]
215    pub fn max_volatility_accumulator(&mut self, max_volatility_accumulator: u32) -> &mut Self {
216        self.max_volatility_accumulator = Some(max_volatility_accumulator);
217        self
218    }
219    #[inline(always)]
220    pub fn tick_group_size(&mut self, tick_group_size: u16) -> &mut Self {
221        self.tick_group_size = Some(tick_group_size);
222        self
223    }
224    #[inline(always)]
225    pub fn major_swap_threshold_ticks(&mut self, major_swap_threshold_ticks: u16) -> &mut Self {
226        self.major_swap_threshold_ticks = Some(major_swap_threshold_ticks);
227        self
228    }
229    /// Add an additional account to the instruction.
230    #[inline(always)]
231    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
232        self.__remaining_accounts.push(account);
233        self
234    }
235    /// Add additional accounts to the instruction.
236    #[inline(always)]
237    pub fn add_remaining_accounts(
238        &mut self,
239        accounts: &[solana_instruction::AccountMeta],
240    ) -> &mut Self {
241        self.__remaining_accounts.extend_from_slice(accounts);
242        self
243    }
244    #[allow(clippy::clone_on_copy)]
245    pub fn instruction(&self) -> solana_instruction::Instruction {
246        let accounts = InitializeAdaptiveFeeTier {
247            whirlpools_config: self
248                .whirlpools_config
249                .expect("whirlpools_config is not set"),
250            adaptive_fee_tier: self
251                .adaptive_fee_tier
252                .expect("adaptive_fee_tier is not set"),
253            funder: self.funder.expect("funder is not set"),
254            fee_authority: self.fee_authority.expect("fee_authority is not set"),
255            system_program: self
256                .system_program
257                .unwrap_or(solana_pubkey::pubkey!("11111111111111111111111111111111")),
258        };
259        let args = InitializeAdaptiveFeeTierInstructionArgs {
260            fee_tier_index: self
261                .fee_tier_index
262                .clone()
263                .expect("fee_tier_index is not set"),
264            tick_spacing: self.tick_spacing.clone().expect("tick_spacing is not set"),
265            initialize_pool_authority: self
266                .initialize_pool_authority
267                .clone()
268                .expect("initialize_pool_authority is not set"),
269            delegated_fee_authority: self
270                .delegated_fee_authority
271                .clone()
272                .expect("delegated_fee_authority is not set"),
273            default_base_fee_rate: self
274                .default_base_fee_rate
275                .clone()
276                .expect("default_base_fee_rate is not set"),
277            filter_period: self
278                .filter_period
279                .clone()
280                .expect("filter_period is not set"),
281            decay_period: self.decay_period.clone().expect("decay_period is not set"),
282            reduction_factor: self
283                .reduction_factor
284                .clone()
285                .expect("reduction_factor is not set"),
286            adaptive_fee_control_factor: self
287                .adaptive_fee_control_factor
288                .clone()
289                .expect("adaptive_fee_control_factor is not set"),
290            max_volatility_accumulator: self
291                .max_volatility_accumulator
292                .clone()
293                .expect("max_volatility_accumulator is not set"),
294            tick_group_size: self
295                .tick_group_size
296                .clone()
297                .expect("tick_group_size is not set"),
298            major_swap_threshold_ticks: self
299                .major_swap_threshold_ticks
300                .clone()
301                .expect("major_swap_threshold_ticks is not set"),
302        };
303
304        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
305    }
306}
307
308/// `initialize_adaptive_fee_tier` CPI accounts.
309pub struct InitializeAdaptiveFeeTierCpiAccounts<'a, 'b> {
310    pub whirlpools_config: &'b solana_account_info::AccountInfo<'a>,
311
312    pub adaptive_fee_tier: &'b solana_account_info::AccountInfo<'a>,
313
314    pub funder: &'b solana_account_info::AccountInfo<'a>,
315
316    pub fee_authority: &'b solana_account_info::AccountInfo<'a>,
317
318    pub system_program: &'b solana_account_info::AccountInfo<'a>,
319}
320
321/// `initialize_adaptive_fee_tier` CPI instruction.
322pub struct InitializeAdaptiveFeeTierCpi<'a, 'b> {
323    /// The program to invoke.
324    pub __program: &'b solana_account_info::AccountInfo<'a>,
325
326    pub whirlpools_config: &'b solana_account_info::AccountInfo<'a>,
327
328    pub adaptive_fee_tier: &'b solana_account_info::AccountInfo<'a>,
329
330    pub funder: &'b solana_account_info::AccountInfo<'a>,
331
332    pub fee_authority: &'b solana_account_info::AccountInfo<'a>,
333
334    pub system_program: &'b solana_account_info::AccountInfo<'a>,
335    /// The arguments for the instruction.
336    pub __args: InitializeAdaptiveFeeTierInstructionArgs,
337}
338
339impl<'a, 'b> InitializeAdaptiveFeeTierCpi<'a, 'b> {
340    pub fn new(
341        program: &'b solana_account_info::AccountInfo<'a>,
342        accounts: InitializeAdaptiveFeeTierCpiAccounts<'a, 'b>,
343        args: InitializeAdaptiveFeeTierInstructionArgs,
344    ) -> Self {
345        Self {
346            __program: program,
347            whirlpools_config: accounts.whirlpools_config,
348            adaptive_fee_tier: accounts.adaptive_fee_tier,
349            funder: accounts.funder,
350            fee_authority: accounts.fee_authority,
351            system_program: accounts.system_program,
352            __args: args,
353        }
354    }
355    #[inline(always)]
356    pub fn invoke(&self) -> solana_program_entrypoint::ProgramResult {
357        self.invoke_signed_with_remaining_accounts(&[], &[])
358    }
359    #[inline(always)]
360    pub fn invoke_with_remaining_accounts(
361        &self,
362        remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)],
363    ) -> solana_program_entrypoint::ProgramResult {
364        self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
365    }
366    #[inline(always)]
367    pub fn invoke_signed(
368        &self,
369        signers_seeds: &[&[&[u8]]],
370    ) -> solana_program_entrypoint::ProgramResult {
371        self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
372    }
373    #[allow(clippy::arithmetic_side_effects)]
374    #[allow(clippy::clone_on_copy)]
375    #[allow(clippy::vec_init_then_push)]
376    pub fn invoke_signed_with_remaining_accounts(
377        &self,
378        signers_seeds: &[&[&[u8]]],
379        remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)],
380    ) -> solana_program_entrypoint::ProgramResult {
381        let mut accounts = Vec::with_capacity(5 + remaining_accounts.len());
382        accounts.push(solana_instruction::AccountMeta::new_readonly(
383            *self.whirlpools_config.key,
384            false,
385        ));
386        accounts.push(solana_instruction::AccountMeta::new(
387            *self.adaptive_fee_tier.key,
388            false,
389        ));
390        accounts.push(solana_instruction::AccountMeta::new(*self.funder.key, true));
391        accounts.push(solana_instruction::AccountMeta::new_readonly(
392            *self.fee_authority.key,
393            true,
394        ));
395        accounts.push(solana_instruction::AccountMeta::new_readonly(
396            *self.system_program.key,
397            false,
398        ));
399        remaining_accounts.iter().for_each(|remaining_account| {
400            accounts.push(solana_instruction::AccountMeta {
401                pubkey: *remaining_account.0.key,
402                is_signer: remaining_account.1,
403                is_writable: remaining_account.2,
404            })
405        });
406        let mut data = borsh::to_vec(&InitializeAdaptiveFeeTierInstructionData::new()).unwrap();
407        let mut args = borsh::to_vec(&self.__args).unwrap();
408        data.append(&mut args);
409
410        let instruction = solana_instruction::Instruction {
411            program_id: crate::WHIRLPOOL_ID,
412            accounts,
413            data,
414        };
415        let mut account_infos = Vec::with_capacity(6 + remaining_accounts.len());
416        account_infos.push(self.__program.clone());
417        account_infos.push(self.whirlpools_config.clone());
418        account_infos.push(self.adaptive_fee_tier.clone());
419        account_infos.push(self.funder.clone());
420        account_infos.push(self.fee_authority.clone());
421        account_infos.push(self.system_program.clone());
422        remaining_accounts
423            .iter()
424            .for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
425
426        if signers_seeds.is_empty() {
427            solana_cpi::invoke(&instruction, &account_infos)
428        } else {
429            solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
430        }
431    }
432}
433
434/// Instruction builder for `InitializeAdaptiveFeeTier` via CPI.
435///
436/// ### Accounts:
437///
438///   0. `[]` whirlpools_config
439///   1. `[writable]` adaptive_fee_tier
440///   2. `[writable, signer]` funder
441///   3. `[signer]` fee_authority
442///   4. `[]` system_program
443#[derive(Clone, Debug)]
444pub struct InitializeAdaptiveFeeTierCpiBuilder<'a, 'b> {
445    instruction: Box<InitializeAdaptiveFeeTierCpiBuilderInstruction<'a, 'b>>,
446}
447
448impl<'a, 'b> InitializeAdaptiveFeeTierCpiBuilder<'a, 'b> {
449    pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
450        let instruction = Box::new(InitializeAdaptiveFeeTierCpiBuilderInstruction {
451            __program: program,
452            whirlpools_config: None,
453            adaptive_fee_tier: None,
454            funder: None,
455            fee_authority: None,
456            system_program: None,
457            fee_tier_index: None,
458            tick_spacing: None,
459            initialize_pool_authority: None,
460            delegated_fee_authority: None,
461            default_base_fee_rate: None,
462            filter_period: None,
463            decay_period: None,
464            reduction_factor: None,
465            adaptive_fee_control_factor: None,
466            max_volatility_accumulator: None,
467            tick_group_size: None,
468            major_swap_threshold_ticks: None,
469            __remaining_accounts: Vec::new(),
470        });
471        Self { instruction }
472    }
473    #[inline(always)]
474    pub fn whirlpools_config(
475        &mut self,
476        whirlpools_config: &'b solana_account_info::AccountInfo<'a>,
477    ) -> &mut Self {
478        self.instruction.whirlpools_config = Some(whirlpools_config);
479        self
480    }
481    #[inline(always)]
482    pub fn adaptive_fee_tier(
483        &mut self,
484        adaptive_fee_tier: &'b solana_account_info::AccountInfo<'a>,
485    ) -> &mut Self {
486        self.instruction.adaptive_fee_tier = Some(adaptive_fee_tier);
487        self
488    }
489    #[inline(always)]
490    pub fn funder(&mut self, funder: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
491        self.instruction.funder = Some(funder);
492        self
493    }
494    #[inline(always)]
495    pub fn fee_authority(
496        &mut self,
497        fee_authority: &'b solana_account_info::AccountInfo<'a>,
498    ) -> &mut Self {
499        self.instruction.fee_authority = Some(fee_authority);
500        self
501    }
502    #[inline(always)]
503    pub fn system_program(
504        &mut self,
505        system_program: &'b solana_account_info::AccountInfo<'a>,
506    ) -> &mut Self {
507        self.instruction.system_program = Some(system_program);
508        self
509    }
510    #[inline(always)]
511    pub fn fee_tier_index(&mut self, fee_tier_index: u16) -> &mut Self {
512        self.instruction.fee_tier_index = Some(fee_tier_index);
513        self
514    }
515    #[inline(always)]
516    pub fn tick_spacing(&mut self, tick_spacing: u16) -> &mut Self {
517        self.instruction.tick_spacing = Some(tick_spacing);
518        self
519    }
520    #[inline(always)]
521    pub fn initialize_pool_authority(&mut self, initialize_pool_authority: Pubkey) -> &mut Self {
522        self.instruction.initialize_pool_authority = Some(initialize_pool_authority);
523        self
524    }
525    #[inline(always)]
526    pub fn delegated_fee_authority(&mut self, delegated_fee_authority: Pubkey) -> &mut Self {
527        self.instruction.delegated_fee_authority = Some(delegated_fee_authority);
528        self
529    }
530    #[inline(always)]
531    pub fn default_base_fee_rate(&mut self, default_base_fee_rate: u16) -> &mut Self {
532        self.instruction.default_base_fee_rate = Some(default_base_fee_rate);
533        self
534    }
535    #[inline(always)]
536    pub fn filter_period(&mut self, filter_period: u16) -> &mut Self {
537        self.instruction.filter_period = Some(filter_period);
538        self
539    }
540    #[inline(always)]
541    pub fn decay_period(&mut self, decay_period: u16) -> &mut Self {
542        self.instruction.decay_period = Some(decay_period);
543        self
544    }
545    #[inline(always)]
546    pub fn reduction_factor(&mut self, reduction_factor: u16) -> &mut Self {
547        self.instruction.reduction_factor = Some(reduction_factor);
548        self
549    }
550    #[inline(always)]
551    pub fn adaptive_fee_control_factor(&mut self, adaptive_fee_control_factor: u32) -> &mut Self {
552        self.instruction.adaptive_fee_control_factor = Some(adaptive_fee_control_factor);
553        self
554    }
555    #[inline(always)]
556    pub fn max_volatility_accumulator(&mut self, max_volatility_accumulator: u32) -> &mut Self {
557        self.instruction.max_volatility_accumulator = Some(max_volatility_accumulator);
558        self
559    }
560    #[inline(always)]
561    pub fn tick_group_size(&mut self, tick_group_size: u16) -> &mut Self {
562        self.instruction.tick_group_size = Some(tick_group_size);
563        self
564    }
565    #[inline(always)]
566    pub fn major_swap_threshold_ticks(&mut self, major_swap_threshold_ticks: u16) -> &mut Self {
567        self.instruction.major_swap_threshold_ticks = Some(major_swap_threshold_ticks);
568        self
569    }
570    /// Add an additional account to the instruction.
571    #[inline(always)]
572    pub fn add_remaining_account(
573        &mut self,
574        account: &'b solana_account_info::AccountInfo<'a>,
575        is_writable: bool,
576        is_signer: bool,
577    ) -> &mut Self {
578        self.instruction
579            .__remaining_accounts
580            .push((account, is_writable, is_signer));
581        self
582    }
583    /// Add additional accounts to the instruction.
584    ///
585    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
586    /// and a `bool` indicating whether the account is a signer or not.
587    #[inline(always)]
588    pub fn add_remaining_accounts(
589        &mut self,
590        accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)],
591    ) -> &mut Self {
592        self.instruction
593            .__remaining_accounts
594            .extend_from_slice(accounts);
595        self
596    }
597    #[inline(always)]
598    pub fn invoke(&self) -> solana_program_entrypoint::ProgramResult {
599        self.invoke_signed(&[])
600    }
601    #[allow(clippy::clone_on_copy)]
602    #[allow(clippy::vec_init_then_push)]
603    pub fn invoke_signed(
604        &self,
605        signers_seeds: &[&[&[u8]]],
606    ) -> solana_program_entrypoint::ProgramResult {
607        let args = InitializeAdaptiveFeeTierInstructionArgs {
608            fee_tier_index: self
609                .instruction
610                .fee_tier_index
611                .clone()
612                .expect("fee_tier_index is not set"),
613            tick_spacing: self
614                .instruction
615                .tick_spacing
616                .clone()
617                .expect("tick_spacing is not set"),
618            initialize_pool_authority: self
619                .instruction
620                .initialize_pool_authority
621                .clone()
622                .expect("initialize_pool_authority is not set"),
623            delegated_fee_authority: self
624                .instruction
625                .delegated_fee_authority
626                .clone()
627                .expect("delegated_fee_authority is not set"),
628            default_base_fee_rate: self
629                .instruction
630                .default_base_fee_rate
631                .clone()
632                .expect("default_base_fee_rate is not set"),
633            filter_period: self
634                .instruction
635                .filter_period
636                .clone()
637                .expect("filter_period is not set"),
638            decay_period: self
639                .instruction
640                .decay_period
641                .clone()
642                .expect("decay_period is not set"),
643            reduction_factor: self
644                .instruction
645                .reduction_factor
646                .clone()
647                .expect("reduction_factor is not set"),
648            adaptive_fee_control_factor: self
649                .instruction
650                .adaptive_fee_control_factor
651                .clone()
652                .expect("adaptive_fee_control_factor is not set"),
653            max_volatility_accumulator: self
654                .instruction
655                .max_volatility_accumulator
656                .clone()
657                .expect("max_volatility_accumulator is not set"),
658            tick_group_size: self
659                .instruction
660                .tick_group_size
661                .clone()
662                .expect("tick_group_size is not set"),
663            major_swap_threshold_ticks: self
664                .instruction
665                .major_swap_threshold_ticks
666                .clone()
667                .expect("major_swap_threshold_ticks is not set"),
668        };
669        let instruction = InitializeAdaptiveFeeTierCpi {
670            __program: self.instruction.__program,
671
672            whirlpools_config: self
673                .instruction
674                .whirlpools_config
675                .expect("whirlpools_config is not set"),
676
677            adaptive_fee_tier: self
678                .instruction
679                .adaptive_fee_tier
680                .expect("adaptive_fee_tier is not set"),
681
682            funder: self.instruction.funder.expect("funder is not set"),
683
684            fee_authority: self
685                .instruction
686                .fee_authority
687                .expect("fee_authority is not set"),
688
689            system_program: self
690                .instruction
691                .system_program
692                .expect("system_program is not set"),
693            __args: args,
694        };
695        instruction.invoke_signed_with_remaining_accounts(
696            signers_seeds,
697            &self.instruction.__remaining_accounts,
698        )
699    }
700}
701
702#[derive(Clone, Debug)]
703struct InitializeAdaptiveFeeTierCpiBuilderInstruction<'a, 'b> {
704    __program: &'b solana_account_info::AccountInfo<'a>,
705    whirlpools_config: Option<&'b solana_account_info::AccountInfo<'a>>,
706    adaptive_fee_tier: Option<&'b solana_account_info::AccountInfo<'a>>,
707    funder: Option<&'b solana_account_info::AccountInfo<'a>>,
708    fee_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
709    system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
710    fee_tier_index: Option<u16>,
711    tick_spacing: Option<u16>,
712    initialize_pool_authority: Option<Pubkey>,
713    delegated_fee_authority: Option<Pubkey>,
714    default_base_fee_rate: Option<u16>,
715    filter_period: Option<u16>,
716    decay_period: Option<u16>,
717    reduction_factor: Option<u16>,
718    adaptive_fee_control_factor: Option<u32>,
719    max_volatility_accumulator: Option<u32>,
720    tick_group_size: Option<u16>,
721    major_swap_threshold_ticks: Option<u16>,
722    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
723    __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
724}