| 17 | minimum_amount_out: u64, |
| 18 | )] |
| 19 | pub struct DcaCreate<'info> { |
| 20 | #[account(address = anchor_spl::associated_token::ID)] |
| 21 | pub associated_token_program: Program<'info, AssociatedToken>, |
| 22 | |
| 23 | #[account(mut)] |
| 24 | pub authority: Signer<'info>, |
| 25 | |
| 26 | #[account( |
| 27 | mut, |
| 28 | associated_token::authority = authority, |
| 29 | associated_token::mint = a_mint, |
| 30 | )] |
| 31 | pub authority_a_vault: Box<Account<'info, TokenAccount>>, |
| 32 | |
| 33 | /// CHECK: |
| 34 | pub a_mint: Box<Account<'info, Mint>>, |
| 35 | |
| 36 | #[account( |
| 37 | init_if_needed, |
| 38 | payer = authority, |
| 39 | associated_token::authority = authority, |
| 40 | associated_token::mint = b_mint, |
| 41 | )] |
| 42 | pub authority_b_vault: Box<Account<'info, TokenAccount>>, |
| 43 | |
| 44 | /// CHECK: |
| 45 | pub b_mint: Box<Account<'info, Mint>>, |
| 46 | |
| 47 | #[account( |
| 48 | init, |
| 49 | seeds = [ |
| 50 | SEED_DCA, |
| 51 | authority.key().as_ref(), |
| 52 | a_mint.key().as_ref(), |
| 53 | b_mint.key().as_ref() |
| 54 | ], |
| 55 | bump, |
| 56 | payer = authority, |
| 57 | space = 8 + size_of::<Dca>(), |
| 58 | )] |
| 59 | pub dca: Box<Account<'info, Dca>>, |
| 60 | |
| 61 | #[account( |
| 62 | init_if_needed, |
| 63 | payer = authority, |
| 64 | associated_token::mint = a_mint, |
| 65 | associated_token::authority = dca |
| 66 | )] |
| 67 | pub dca_a_vault: Box<Account<'info, TokenAccount>>, |
| 68 | |
| 69 | #[account( |
| 70 | init_if_needed, |
| 71 | payer = authority, |
| 72 | associated_token::mint = b_mint, |
| 73 | associated_token::authority = dca |
| 74 | )] |
| 75 | pub dca_b_vault: Box<Account<'info, TokenAccount>>, |
| 76 |
nothing calls this directly
no outgoing calls
no test coverage detected