From d2f9976779f96ddc9a59dd981999915094cffc96 Mon Sep 17 00:00:00 2001
From: Pedro Yves Fracari <55461956+yvesfracari@users.noreply.github.com>
Date: Mon, 29 Jan 2024 12:06:41 -0300
Subject: [PATCH] chore: add allowed slippage on price checking confirmation
(#579)
---
.../SingleOrderForm/PriceCheckerConfirmation.tsx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/apps/cow-tools/src/app/milkman/(components)/SingleOrderForm/PriceCheckerConfirmation.tsx b/apps/cow-tools/src/app/milkman/(components)/SingleOrderForm/PriceCheckerConfirmation.tsx
index 812ca8639..e4f9939e3 100644
--- a/apps/cow-tools/src/app/milkman/(components)/SingleOrderForm/PriceCheckerConfirmation.tsx
+++ b/apps/cow-tools/src/app/milkman/(components)/SingleOrderForm/PriceCheckerConfirmation.tsx
@@ -53,7 +53,7 @@ export function PriceCheckerConfirmation({
buyToken: defaultValues?.tokenBuy.address,
})
.then((expectedOut) => {
- setExpectedOut(expectedOut);
+ setExpectedOut(expectedOut * (100 - data.allowedSlippageInBps));
setLoadingExpectedOut(false);
})
.catch((error) => {
@@ -75,7 +75,7 @@ export function PriceCheckerConfirmation({
if (Object.keys(errors).length || expectedOutError) {
return (
- Error validating the price checker. Please review the parameters
+ Error validating the price checker. Please review the parameters.
);
}
@@ -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}
+ {". "}
- 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.