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
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
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.
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.