We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d107d11 commit eee4be4Copy full SHA for eee4be4
src/lib/legacy.ts
@@ -357,9 +357,11 @@ export function getSellGlpToAmount(
357
358
// in the Vault contract, the token.usdgAmount is reduced before the fee basis points
359
// is calculated
360
+ const diff = fromToken.usdgAmount !== undefined ? fromToken.usdgAmount - usdgAmount : undefined;
361
+ const noNegativeDiff = diff !== undefined ? (diff > 0n ? diff : 0n) : undefined;
362
const feeBasisPoints = getFeeBasisPoints(
363
fromToken,
- fromToken?.usdgAmount !== undefined ? fromToken.usdgAmount - usdgAmount : undefined,
364
+ noNegativeDiff,
365
usdgAmount,
366
MINT_BURN_FEE_BASIS_POINTS,
367
TAX_BASIS_POINTS,
0 commit comments