-1

All the Solana documentation I've read says that I have to pay rent for all the data accounts I use. So if I'm developing a Solana program and I want to use some data account to store my data, I need to have a positive lamports balance on that data account if I understand correctly.

What are the best practices for funding data accounts with lamports? Should I keep track of all my data accounts manually and add some lamports to each one?

Pacha
  • 1

1 Answers1

-1

The term "rent" is unfortunately confusing, because rent-paying accounts are no longer allowed on Solana. Instead, all accounts must have enough lamports to be rent-exempt, so you can think of it as an account opening fee.

Some programs allow you to recoup this account opening fee. For example, the SPL token program contains a CloseAccount instruction which allows you to delete an account and get back the lamports that were used to open the account.

All this to say, you must fund accounts with enough lamports on creation, and then you never need to worry about it again.

Jon C
  • 7,019
  • 10
  • 17