If I have an anchor program, how can I find out how much SOL it will cost me to deploy it? Afaik the raw binary size isn't accurate, as some padding is also added.

1 Answer 1


It'll depend on the version of the tools used. In 1.18, with https://github.com/solana-labs/solana/pull/34730, there won't be any padding included, so you can just calculate based on the size of the binary.

You'll need to pay for:

  • the program account, which is 36 bytes
  • the program data account, 45 bytes + the size of the program

So you'll need to add up solana rent 36 with solana rent <45+program size>

  • 2
    Thank you! Small note for future readers: The reason Jon didn't just write solana rent <36 + 45 + program size> is because the 36 and 45 + program size is because these two accounts are separate, meaning we need to add the rent-exempt minimum on top twice, once for each (which would only be added once if we did solana rent <36 + 45 + program size>)
    – Ahri
    Commented Jun 11 at 19:10

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.