I am trying to create an ATA using this but i get this error

payer = signer,
seeds = [rent_manager.key().as_ref()],
token::mint = pay_mint,
token::authority = rent_manager,
pub rent_manager_vault: Account<'info, TokenAccount>,

enter image description here

  • Please copy the logs and paste the text instead of an image.
    – Jacob Creech
    Sep 20, 2022 at 1:33

3 Answers 3


An associated token account by definition already uses its own set of seeds. Try removing the seeds constraint and see if that helps. And update to using the correct associated token constraints:

    payer = payer,
    associated_token::mint = mint,
    associated_token::authority = payer,
pub token: Account<'info, TokenAccount>,

The error was due to i was using wrong seeds for rent_manager_vault


To create an associated token account you need to pass ATA program ID and use the anchor_spl crate with associated_token.

use anchor_spl::{associated_token::AssociatedToken}


    payer = signer,
    associated_token::mint = pay_mint,
    associated_token::authority = rent_manager,
    rent_manager_vault: Account<'info, TokenAccount>,


    associated_token_program: Program<'info, AssociatedToken>,
  • This wont work as ATA is a PDA an it wont work with custom seeds
    – Pratik.js
    Sep 19, 2022 at 17:07
  • 1
    Oh yes makes sense
    – maddy
    Sep 19, 2022 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.