diff --git a/packages/web/components/place-limit-tool/index.tsx b/packages/web/components/place-limit-tool/index.tsx index ee0c14079a..57ed85b5b8 100644 --- a/packages/web/components/place-limit-tool/index.tsx +++ b/packages/web/components/place-limit-tool/index.tsx @@ -613,6 +613,7 @@ export const PlaceLimitTool: FunctionComponent = observer( inAmountFiat={swapState.paymentFiatValue} fromAsset={swapState.marketState.fromAsset} toAsset={swapState.marketState.toAsset} + isBeyondOppositePrice={swapState.priceState.isBeyondOppositePrice} /> type === "market" || priceState.isBeyondOppositePrice, - [type, priceState.isBeyondOppositePrice] + () => type === "market", + //|| priceState.isBeyondOppositePrice + // Disabled auto market placing but can be readded with the above conditional + [type] ); const account = accountStore.getWallet(osmosisChainId); diff --git a/packages/web/localizations/en.json b/packages/web/localizations/en.json index 47b840c954..7c4f0e855a 100644 --- a/packages/web/localizations/en.json +++ b/packages/web/localizations/en.json @@ -1250,11 +1250,11 @@ }, "aboveMarket": { "title": "Limit price above market price", - "description": "If you proceed, your order will be processed as a market order at market price." + "description": "If you proceed, your order may be filled at an undesirable price." }, "belowMarket": { "title": "Limit price below market price", - "description": "If you proceed, your order will be processed as a market order at market price." + "description": "If you proceed, your order may be filled at an undesirable price." }, "enterAnAmountTo": "Enter an amount to", "sell": "Sell", diff --git a/packages/web/modals/review-order.tsx b/packages/web/modals/review-order.tsx index dda3ae6ceb..ee49ff70b6 100644 --- a/packages/web/modals/review-order.tsx +++ b/packages/web/modals/review-order.tsx @@ -54,6 +54,7 @@ interface ReviewOrderProps { fromAsset?: ReturnType["fromAsset"]; toAsset?: ReturnType["toAsset"]; page?: EventPage; + isBeyondOppositePrice?: boolean; } export function ReviewOrder({ @@ -81,6 +82,7 @@ export function ReviewOrder({ toAsset, fromAsset, page, + isBeyondOppositePrice = false, }: ReviewOrderProps) { const { t } = useTranslation(); // const { isMobile } = useWindowSize(); @@ -192,7 +194,7 @@ export function ReviewOrder({ ); }, [gasAmount, isGasLoading, gasFeeError, t]); - + console.log(tab === "sell" && isBeyondOppositePrice); return (
- {percentAdjusted?.isNegative() ? ( + {(tab === "buy" && !isBeyondOppositePrice) || + (tab === "sell" && isBeyondOppositePrice) ? ( )} @@ -383,15 +387,45 @@ export function ReviewOrder({
-
+
- {orderType === "limit" - ? t("limitOrders.limit") - : t("limitOrders.market")} - + + {tab === "buy" + ? t(`limitOrders.aboveMarket.title`) + : t(`limitOrders.belowMarket.title`)} + + } + body={ + + {tab === "buy" + ? t(`limitOrders.aboveMarket.description`) + : t(`limitOrders.belowMarket.description`)} + + } + > +
+ {isBeyondOppositePrice && ( + + )} + {orderType === "limit" + ? t("limitOrders.limit") + : t("limitOrders.market")} +
+
} /> {slippageConfig && orderType === "market" && ( @@ -583,6 +617,28 @@ export function ReviewOrder({ Learn more
*/} + {isBeyondOppositePrice && ( +
+ +
+ + {tab === "buy" + ? t(`limitOrders.aboveMarket.title`) + : t(`limitOrders.belowMarket.title`)} + + + {tab === "buy" + ? t(`limitOrders.aboveMarket.description`) + : t(`limitOrders.belowMarket.description`)} + +
+
+ )} {!diffGteSlippage && (