You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we only compare the staker's selected stake amount against the balance and don't allow them to submit the form if they choose an amount they can't cover. However, this does not take into account the fees.
We recommend that we take the calculated fees (either based on the default fee rate or the user's selection of fee rate) into account and compare it against the balance before allowing the user to submit the staking form. An example of such a mechanism follows.
When the user loads up the form, they select a stake amount and we calculate the fee they would pay based on the default fee rate (currently mempool fastest). There are two cases:
amount + defaultFeeRateCalculatedFee > balance. The "preview" button is disabled and the user has two choices
a. Change the staking amount to something lower. In this case, no further action needs to be taken and the user can submit.
b. Press the "use custom" button to change the fee to something lower. If they go into custom mode, they can lower the fee rate, and if they lower it enough so that amount + calculatedFee <= balance, we allow them to submit.
amount + defaultFeeRateCalculatedFee <= balance. The "preview" button is enabled, and the user has two choices:
a. Submit the transaction
b. Press the "use custom" button to change the fee to something higher/lower. If they go to an amount that they can't cover, we don't allow them to submit.
The text was updated successfully, but these errors were encountered:
Currently, we only compare the staker's selected stake amount against the balance and don't allow them to submit the form if they choose an amount they can't cover. However, this does not take into account the fees.
We recommend that we take the calculated fees (either based on the default fee rate or the user's selection of fee rate) into account and compare it against the balance before allowing the user to submit the staking form. An example of such a mechanism follows.
When the user loads up the form, they select a stake amount and we calculate the fee they would pay based on the default fee rate (currently mempool
fastest
). There are two cases:amount + defaultFeeRateCalculatedFee > balance
. The "preview" button is disabled and the user has two choicesa. Change the staking amount to something lower. In this case, no further action needs to be taken and the user can submit.
b. Press the "use custom" button to change the fee to something lower. If they go into custom mode, they can lower the fee rate, and if they lower it enough so that
amount + calculatedFee <= balance
, we allow them to submit.amount + defaultFeeRateCalculatedFee <= balance
. The "preview" button is enabled, and the user has two choices:a. Submit the transaction
b. Press the "use custom" button to change the fee to something higher/lower. If they go to an amount that they can't cover, we don't allow them to submit.
The text was updated successfully, but these errors were encountered: