Skip to content

Commit

Permalink
APT-1813: Max button now takes fees into the account #88
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Kosiak <kosiak.lukasz@gmail.com>
  • Loading branch information
lukozill and uHappyLogic authored Feb 21, 2025
1 parent 8119393 commit 113c693
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/stakingCalculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ const StakingCalculator: React.FC = () => {
}

const onMaxClick = () => {
setZilToStake(`${formatUnits(zilAvailable || 0n, 18)}`)
const allZil = formatUnits(zilAvailable || 0n, 18)
const roundedToNiceNumber = allZil.split(".")[0]
const availableMinusFees =
parseFloat(roundedToNiceNumber) - stakingTxCostInZill

setZilToStake(`${availableMinusFees}`)
}

const isPoolLiquid = () =>
Expand Down

0 comments on commit 113c693

Please sign in to comment.