Set up the AMM pool. You must create an AmmState PDA that will store the mint addresses and fees.
Most importantly, you must initialize two Token Vaults (Token Accounts) that are owned by the AmmState PDA. Because the PDA owns the vaults, only your program can transfer funds out of them during a swap.
You will use the token::authority constraint to assign ownership of the vaults to the PDA:
#[account(
init,
payer = maker,
associated_token::mint = mint_a,
associated_token::authority = amm_state, // The PDA owns this!
)]
pub vault_a: Account<'info, TokenAccount>,
Implement the Context and the initialization logic.