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