Skip to content

Commit

Permalink
chore: add allowed slippage on price checking confirmation (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesfracari authored Jan 29, 2024
1 parent 52b5264 commit d2f9976
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function PriceCheckerConfirmation({
buyToken: defaultValues?.tokenBuy.address,
})
.then((expectedOut) => {
setExpectedOut(expectedOut);
setExpectedOut(expectedOut * (100 - data.allowedSlippageInBps));
setLoadingExpectedOut(false);
})
.catch((error) => {
Expand All @@ -75,7 +75,7 @@ export function PriceCheckerConfirmation({
if (Object.keys(errors).length || expectedOutError) {
return (
<AlertCard style="error" title="Error">
Error validating the price checker. Please review the parameters
Error validating the price checker. Please review the parameters.
</AlertCard>
);
}
Expand All @@ -87,11 +87,11 @@ export function PriceCheckerConfirmation({
{formatNumber(defaultValues?.tokenSellAmount, 4)}{" "}
{defaultValues?.tokenSell.symbol} to{" "}
{formatNumber(expectedOutAmount || 0, 4)}{" "}
{defaultValues?.tokenBuy.symbol}{" "}
{defaultValues?.tokenBuy.symbol}
{". "}
</b>
without consider the allowed slippage. Note that this is an estimation
based on the current market situation. This value will change when the
order is executed.
Note that this is an estimation based on the current market situation
that can change on the order execution.
</span>
<Button
type="submit"
Expand Down

0 comments on commit d2f9976

Please sign in to comment.