Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why lamportsPerSignature * 100 ? #424

Open
docongminh opened this issue Feb 16, 2022 · 3 comments
Open

Why lamportsPerSignature * 100 ? #424

docongminh opened this issue Feb 16, 2022 · 3 comments

Comments

@docongminh
Copy link

i found in this line to calculate the cost of transaction. I don't understand why we need multiple 100 for fee.
Screen Shot 2022-02-16 at 17 47 57

@Ashatanchik
Copy link

I also can't figure out why such a constant is chosen
did you manage to understand @docongminh ?

@cvhainb
Copy link

cvhainb commented Sep 4, 2022

This fee in this case is used to check the payer's balance.

@itayLev1
Copy link

Lamports are a sub unit of solana,
Its 1SOL / 100 = lamports (think of them as satoshis in Bitcoin)
the solana network works with lamports, but users are used to see the SOL amount.
this is why you converte from lamports to SOL ( lamportsPerSignature * 100 ) when displaying to user or calculating in sol.
In this case its used to calculate the fees.
notice that the first fees implementation (calculate cost to fund) are in lamports and then the next one converts them to sol I guess its in order to display them in UI or console or to calculate them in an env which uses the sol measurment instead of the Lamports used to comunicate with the network itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants