Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big Swap Feedback #122

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cli/src/utils/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export async function checkNotDangerousExchange(
quotedAmountToReceiveWithBuffer,
oracleMedianRate
)
if (expectedSlippage > depeggedPricePercentage) {
if (Math.abs(expectedSlippage) > depeggedPricePercentage) {
nicolasbrugneaux marked this conversation as resolved.
Show resolved Hide resolved
const check = await binaryPrompt(
`Warning ${
stableTokenInfo.symbol
} price here (i.e. on-chain) is depegged by ${expectedSlippage}% which is >${depeggedPricePercentage}% from the oracle prices ${oracleMedianRate.toString()} (i.e. swap prices). Are you sure you want to continue?`,
} price here (i.e. on-chain) would be depegged by ${expectedSlippage}% from the oracle prices ${oracleMedianRate.toString()} (i.e. swap prices). Are you sure you want to continue?`,
true
)
return check
Expand Down
Loading