Search code examples
solanasolana-transaction-instruction

Solana split stake transaction fails with error "insufficient funds for instruction" when account has enough balance


I'm trying to split 0.1 SOL into a new account so that I can then deactivate the stake and withdraw, on devnet.
When trying to execute "split stake" operation I get an error "insufficient funds for instruction", despite that there are sufficient funds in both fee payer account (6 SOL) and stake account (4 SOL).

Program returned error: "insufficient funds for instruction"

This can be easily reproduced by simulating a similar instruction I ran in the past, this transaction on devnet using Transaction Inspector: https://explorer.solana.com/tx/3DvpdJ5JbwKAwUPPJzwtQHHXDhWmTSogp6GAD7t3N3S1ng9ZJHcPXLcmbyYmkkweB7JC9iWyLenNZFLm4MNA1c9b/inspect?cluster=devnet

Clicking on Transaction Simulation > Simulate, we can see the same error happens on 2nd instruction.

Already tried with higher amount (e.g. 1 SOL) and result is the same.

Any idea what might be the reason?
Thanks in advance!


Solution

  • I'm not sure if this is the case for you, but I find out what the problem is for me. They changed the behaviour of the stake split function so it now requires that if you split less than the full amount to a fresh account it needs rent exempt balance (feature here https://github.com/solana-labs/solana/issues/33300). So when you are calling the split function provide rentExempt value. Using 2282880 lamports should be enough.