2

I experience a strange behavior of the SOL transfer.

I use Typescript @solana/web3.js client that do SOL transfer from local wallet filled with SOLs automatically at solana-test-validator start. Then the amount of 890880 is transfered to another account. My expectation is that the spent amount on this operation from my wallet is the transfered amount + fee (which is 5000 lamports for a signature). But the difference between account balance before and after transfer is not 5000+890880=895880 but it's 895860. It's like there in sum 20 lamports more in the network after transfer.

I ran some testing with solana-test-validator 1.14.10 and I've got test issues coming from balance differences from expected behavior. I cannot understand what's the issue. If it's some precision rounding of Typescript client or BN library or if it's some rounding trick in Solana/Cli?

I have a simple reproducer here: https://github.com/ochaloup/solana-transfer-reproducer

1 Answer 1

1

you may forget to consider other source of fees. Fees does not only take in consideration the number of signatures but also for instance the number of compute units which have been used, please see : https://docs.solana.com/transaction_fees

1
  • That's the good point and I thought if it's caused by that. But it does not seems so. I do not set any priority fee or changes default CUs. And when I transfer another amount of SOL (like 1 SOL) the balance matches the transferred amount plus fee for one signature. I tried a bit more and if I send the same amount but from account with smaller starting balance then again all sums matches.
    – chalda
    Commented Feb 8, 2023 at 11:35

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.