1

I want to have a treasury of usdc for my program. Can a program have its own associated token account, and if so, how does it transfer usdc in and out of the treasury (in Rust)?

Thanks

1
  • why dont you want PDA as an associated token account. You can easily do whatever u specified by making the PDA as a token account and making the program as the authority. Jul 16, 2022 at 4:28

2 Answers 2

5

No. Programs have no way to sign for instructions that require authority, which includes many SPL Token operations. This use case is precisely why PDAs exist.

2

Programs cannot have an ATA. For this use case, a pool token account can be initialized whose authority is set to a PDA signer. This way, the signer account can sign spl-token transfers out of the pool treasury.

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.