Skip to content

Commit

Permalink
fix: bigint rounding error when withdrawing
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveVodrazka committed Sep 30, 2024
1 parent 491faa4 commit b5a78a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Yield/handleAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const calculateTokens = (
const NUM_PRECISSION = 1_000_000;

const percentageWithPrecission =
(BigInt(amount * NUM_PRECISSION) * 10n ** BigInt(pool.digits)) /
(BigInt(Math.round(amount * NUM_PRECISSION)) * 10n ** BigInt(pool.digits)) /
pool.valueBase;

const tokens =
Expand Down

0 comments on commit b5a78a6

Please sign in to comment.