Skip to content

Commit

Permalink
since expected slippage could be negative we need to get its absolute…
Browse files Browse the repository at this point in the history
… value to actually check if it is greater than the max allowed depeg
  • Loading branch information
aaronmgdr committed Feb 7, 2024
1 parent b34439a commit d7e6fcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/src/utils/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function checkNotDangerousExchange(
quotedAmountToReceiveWithBuffer,
oracleMedianRate
)
if (expectedSlippage > depeggedPricePercentage) {
if (Math.abs(expectedSlippage) > depeggedPricePercentage) {
const check = await binaryPrompt(
`Warning ${
stableTokenInfo.symbol
Expand Down

0 comments on commit d7e6fcf

Please sign in to comment.