Skip to main content

Questions tagged [rent]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11 votes
2 answers
3k views

How can I calculate the cost the deploy a progam to main net?

I want to deployed a program to main net would like to figure out before hand how much it will cost. For accounts I can just calculate it by counting the bytes to be rent exempt but how do I do that ...
Jonas H.'s user avatar
  • 7,209
6 votes
1 answer
158 views

Solana rent exempt account, period of exemption

Hey so we are all said to make rent-exempt accounts at creation time but is the rent exemption permanent? If not, how is the top-up handled after the exemption period? Like as soon as it ends you add ...
Nabeel Naveed's user avatar
5 votes
2 answers
1k views

How much rent is needed to create a new account?

When creating a new account on Solana, how do I calculate the amount of rent (SOL) needed to pay for and create the account?
DonnySolana's user avatar
5 votes
2 answers
115 views

How is Solana able to provide infinite-time storage for a fixed cost?

How can Solana store something forever for a fixed cost that is reclaimable if you close the account?
itsfarseen's user avatar
4 votes
2 answers
648 views

Storage costs on solana

Creating accounts to store data require 2 years worth of rent to be paid upfront, as per the size of the account. This is done to make accounts rent exempt. Also the storage rent per byte gets cheaper ...
Shubham Singh's user avatar
4 votes
1 answer
879 views

Is rent collected on Solana?

I have created a wallet account that holds my SOL balance and only sends and receives SOL. Will there be rent on this account? E2B5PspC2A3UVsfyQhrzhFBwb23RMEiMrFsG3Zoy6QfR (testnet) When I made a ...
Koichi's user avatar
  • 81
4 votes
2 answers
510 views

How do I solve this: `Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0`

I have this in my lib.rs file: #[derive(Accounts)] pub struct Initialize<'info> { #[account( init, payer = authority, space = 8 + Config::SIZE, seeds = ["config"....
Ademola's user avatar
  • 3,944
3 votes
2 answers
339 views

Anchor : Do you need to pass rent account when doing a init in a instruction

Hey so i seem to facing a weird situation where some of my init tx require rent to be passed in where as in other tx which use init, and rent is perfectly omitted without any issue not sure if its a ...
Nabeel Naveed's user avatar
3 votes
2 answers
402 views

How can I make token accounts rent exempt when I create them?

Hi I am struggling to understand how to make token accounts rent exempt. I have used the following code to create my token account for an SPL token lifted out of the Solana docs. I see that Solana is ...
colinwink's user avatar
3 votes
1 answer
297 views

Can you create accounts with less lamports than the rent-exempt minimum?

Accounts on Solana are considered rent-exempt if they hold at least the cost of their rent for 2 years (based on the size of the account's data). Is it possible to create an account that's not rent-...
Joe C's user avatar
  • 1,116
3 votes
1 answer
34 views

What if the rent exemption price goes up?

Given that new Solana accounts must be credited - at creation time - with enough SOL to be "rent-exempt", the balance of an account isn't allowed to go below its corresponding minimum "...
Iaroslav's user avatar
  • 199
2 votes
2 answers
44 views

How to determine how much will be paid back/paid extra when reallocing

Say we have the following definition for an instruction and we know that my_acc previously took up 200 bytes and is now being realloced to 100. How can we find out how many lamports will be paid to ...
McBain's user avatar
  • 5,384
2 votes
1 answer
115 views

How can I retrieve the rent balance on an address from the native node RPC?

Is there an endpoint in the JSON RPC API which can give me back the rent balance for a given address? https://docs.solana.com/api/http#getaccountinfo
sibabtcs's user avatar
2 votes
3 answers
5k views

How do I close a Solana Account?

We can easily close PDAs to redeem their rent to their owner, however what I'm wondering is can the same be done for a normal, on-curve Solana account? From what I can see once you've sent the minimum ...
McBain's user avatar
  • 5,384
2 votes
1 answer
368 views

What dataLength to use for getMinimumBalanceForRentExemption() for a SOL account?

According to the Solana documentation the minimum balance/amount to be send to new SOL account can be calculated using getMinimumBalanceForRentExemption() getMinimumBalanceForRentExemption() takes a ...
mahnunchik's user avatar
2 votes
1 answer
175 views

Does minimum balance for rent exempt change over time

I am building a wallet where I have multiple accounts. I would like to know what the rent exempt line is at all times. So that when transfers are being made, they don't end up failing because they go ...
Nissen41's user avatar
2 votes
1 answer
206 views

Rent in PDA derived account

If I write a solana program which creates PDAs based on a seed and user's public key, do I need to fund all such accounts with lamports beforehand so that my clients can store data in it without ...
felix's user avatar
  • 300
2 votes
1 answer
153 views

How can I find out how much SOL I will need to deploy an anchor program?

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.
McBain's user avatar
  • 5,384
2 votes
1 answer
309 views

Cost of logging vs storing data in Solana programs?

The Way Ethereum stores data through Events I want to do the same on Solana but not sure How do the compare the cost of storing it in logs or in Solana programs? Are there any other cheaper ways to ...
Ajay Yadav's user avatar
2 votes
1 answer
38 views

Can the state of removed Programs be recovered after they failed to pay rent?

From the docs on rent: Accounts that do not maintain their rent exempt status, or have a balance high enough to pay rent, are removed from the network in a process known as garbage collection. What ...
Paul Razvan Berg's user avatar
2 votes
1 answer
103 views

How to proceed when a program rent expires

When creating a program, it is generally rent-exempt, which allows it to run for 2 years. After this time the SOL of that account is finished and the Garbage collection closes it. So, to avoid this, ...
cris.sol's user avatar
  • 292
2 votes
1 answer
183 views

How do i figure out that how many rents should i pay?

How do i figure out that how many rents should i pay? If i use the rpc api named "getMinimumBalanceForRentExemption" , I really don`t know "account data length"
pengten's user avatar
  • 21
1 vote
2 answers
275 views

transfer token with rent exempt on solana network

Does anyone know how to transfer token on solana without paying rent which is equivalent to ~0.002 sol?
oofblock_0000's user avatar
1 vote
3 answers
707 views

Can anyone close non-rent-exempt accounts?

This statement from Alchemy's tutorial has caught my attention (emphasis mine): To reclaim Solana storage fees, developers and everyday Solana users can close accounts to receive their storage fees ...
Paul Razvan Berg's user avatar
1 vote
1 answer
87 views

Determining rent epoch

Is there a way to determine preferably on chain when the rent for an account was last paid? If not, is there a way to do so off-chain?
qubitz's user avatar
  • 220
1 vote
1 answer
154 views

PDA rent exemption collection to transaction fee payer error on account close

In a transaction, I’m trying to close an ATA and a PDA. The ATA is closed by calling close_account from the SPL Token 2022 crate / On Chain Program, and the rent exemption can be sent without any ...
Vincent Berthier's user avatar
1 vote
1 answer
73 views

Which accounts can a program close?

Suppose I use the function close, which closes an arbitrary account, pub fn close(ctx: Context<Close>) -> ProgramResult { let dest_starting_lamports = ctx.accounts.destination....
qubitz's user avatar
  • 220
1 vote
3 answers
359 views

Solana rent and garbage collection

I'm working on a project that can be seen as a centralized exchange. We already have support for Solana deposits/withdrawals and I now I'm adding support for token deposit/withdrawals, but with this, ...
gumminho's user avatar
1 vote
1 answer
43 views

Is Solana a bad choice to track inexpensive assets on-chain?

I'm interested in using NFTs to track assets that valued at around $3 USD As I understand it, each NFT requires: Token Metadata account Master edition account Associated token account A token mint ...
Sandy Soto's user avatar
1 vote
2 answers
890 views

What is the rent exemption minimum for a SystemProgram account created by a SOL transfer

Trying to figure out the exact lamports needed to make a "wallet" (account created by a SOL transfer) rent exempt. There are lots of contradictory information on this topic, some sources say ...
jac0xb.sol's user avatar
1 vote
1 answer
22 views

What impact does rent exemption have on validators' economics?

I understand that rent is only collected on legacy accounts that were created in the past, before it was enforced that all accounts be rent-exempt by depositing 2 years of rent. While the rent went ...
AllBlooming's user avatar
  • 2,309
1 vote
1 answer
132 views

Do I need to fund a wallet to keep a token account rent free?

Let’s say I create a new empty wallet. Let’s call this wallet A. In wallet B I have SOL and a Spl token. From wallet B I send to wallet A some of the SPL tokens and I pay SOL to initiate the token ...
Gsuz's user avatar
  • 15
1 vote
1 answer
46 views

rent handling in storage

How does this "collecting rent" work exactly(or used to work)? Does it iterate over all the accounts that are not rent exempt per every epoch? in this link, i saw this line: requires the ...
Sepehr Mirnasrollahi's user avatar
1 vote
2 answers
94 views

Solana Rent Sysvar empty

I'm creating a local cluster with solana version 1.9.29, then I upgrade to solana 1.13.6 by restarting whole validators. I'm facing issue that Rent Sysvar account is empty so any programs using rent ...
Ngọc Bạch Văn's user avatar
1 vote
1 answer
404 views

Custom program error code 0x0 while sending a transaction

While trying to create a transaction containing as instructions the creation of a mint account, initialize mint instruction and ATA creation), it gives me the custom program error code 0x0 while ...
ASCorreia's user avatar
  • 318
1 vote
2 answers
586 views

How to find the exact number of bytes to allocate for a Solana Account in Rust

I want to create wallet account via Rust program by using payer & mint account, in that case how to predict the number of bytes to allocate for the new account data so that I can pay less rent ? ...
Souvagya's user avatar
  • 131
1 vote
1 answer
33 views

Do I have to pay when deploy a project with one code account and one store data account

I'm new to the Solana network. I wonder do I need to pay rent for each account I deploy on Solana network. for example, if I have a project with one account store execute code and one project to store ...
Dũng Đàm's user avatar
1 vote
0 answers
15 views

Solana Rent Calculation [duplicate]

Could someone please provide guidance or a code example on how to calculate rent for Solana accounts? Specifically, I'm interested in understanding how to determine the rent due for each account based ...
Naomi Yoko's user avatar
0 votes
3 answers
78 views

Is it a waste to implement HashMap via PDAs when the value type is only a bool?

When writing smart contracts for EVM chains, I can define a mapping(address => bool). When it comes to Solana, I think I can only use PDAs to achieve the same thing? Is my understanding correct? If ...
Yan's user avatar
  • 419
0 votes
1 answer
93 views

What's rent?. What's estimated become exempt?

I,d like to know what’s rent?. How to calculate it?. Does it work now?. Does it exist now?. When to become rent exempt?. I use Solflare and I’ve an account with more or less 200 Solana and I do ...
Gus's user avatar
  • 21
0 votes
1 answer
143 views

How is delegated stake balance calculated?

I created my staking account with 1 + 0.00228288 (rent-exempt) SOL. So that my initial delegated stake was exactly 1 SOL. After 6 epochs, my balance is 1.004707281. And my delegated stake is 1....
Dante Alighieri's user avatar
0 votes
1 answer
135 views

Reducing rent costs

I feel like for some base accounts, I’m getting charged 0.002 sol, which is like $0.20 to store a simple data field on a PDA. Especially for multiple data fields I want to store, this number added ...
AceGravity's user avatar
0 votes
1 answer
25 views

How does SOL accounting work in non-rent-exempt programs?

I wonder how does one reason about SOL accounting in non-rent-exempt Programs? It seems to me that static analysis of a Program's balance is impossible besides just assuming that it changes on each ...
Paul Razvan Berg's user avatar
0 votes
2 answers
171 views

Paying rent for accounts when initialising as the developer

I am trying to work out a gasless solution for transactions. Currently partially signing a transaction with the octane core Sdk works for normal transactions but for transactions with instructions ...
Anish De's user avatar
0 votes
0 answers
9 views

Economic viability of social dApps with Solana

I've been diving into the web3 scene lately, starting with the Ethereum ecosystem. But since I'm a Rust developer first and foremost, Solana was an obvious choice to look into. I like it so far, ...
noob's user avatar
  • 1
0 votes
0 answers
129 views

Embedded wallets, USDC and account rental

I'm evaluating Solana as an option to support Generate an embedded, user owned, wallet per sign-up (BYO as secondary option). Only deal with USDC in and between these wallets, i.e. no customer ...
uxcxdx's user avatar
  • 101
0 votes
0 answers
255 views

Send SPL-tokens to unfunded account + set fee payer

I'm trying to create a seamless process for my clients via paying for the transaction fees when initiating a tokenswap (token A to token B) via jupiter. In this scenario, the user doesn't have any sol ...
Franny's user avatar
  • 1
0 votes
0 answers
352 views

Solana rent account questoin

I have a question. If I hold solana token on my wallet - do I need to pay a rent for my account on chain ? I've red official documentation and I see that there is a garbage collector in solana chain ...
Andriy Vasyltsiv's user avatar
0 votes
1 answer
71 views

Build fails when using rent_exempt = skip in account initialization

I want to skip rent exemption when initializing PDA account with anchor. Sol will be transfer to PDA right after initialization so there is no need to pay extra sol for rent when PDA is initialized. ...
Void's user avatar
  • 416
0 votes
3 answers
344 views

How does Solana's Rent Fee work? What is it exactly? And why 2 years?

I've been reading about this "rent fee" feature on Solana. What is this exactly and how does it work? Coming from BTC and ETH. Why do I need to pay "rent" on Solana?
Patoshi パトシ's user avatar