From f3b3439cca6d8ccd28caa72d5b14f9f452f3b2e5 Mon Sep 17 00:00:00 2001 From: deep-path <476044723@qq.com> Date: Mon, 18 Nov 2024 17:51:09 +0800 Subject: [PATCH] fix: fee change --- screens/Trading/components/TradingOperate.tsx | 11 ++++++----- store/helper.ts | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/screens/Trading/components/TradingOperate.tsx b/screens/Trading/components/TradingOperate.tsx index 4fe3cfe0..8a681118 100644 --- a/screens/Trading/components/TradingOperate.tsx +++ b/screens/Trading/components/TradingOperate.tsx @@ -314,12 +314,13 @@ const TradingOperate = () => { }, [longOutput, shortOutput]); const Fee = useMemo(() => { - console.log(ReduxcategoryAssets1, ReduxcategoryAssets2); return { - fee: (Number(longInput || shortInput) * config.open_position_fee_rate) / 10000, + fee: + (Number(longInput || shortInput) * config.open_position_fee_rate) / 10000 + + (estimateData?.fee ?? 0) / 10000, price: getAssetPrice(ReduxcategoryAssets1), }; - }, [longInput, shortInput, ReduxcategoryAssets1]); + }, [longInput, shortInput, ReduxcategoryAssets1, estimateData]); function getAssetPrice(categoryId) { return categoryId ? assets.data[categoryId["token_id"]].price?.usd : 0; @@ -509,10 +510,10 @@ const TradingOperate = () => {
{Fee.fee}
+{Fee.fee.toFixed(6)}
NEAR - (${Fee.fee * (Fee.price || 0)}) + (${(Fee.fee * (Fee.price || 0)).toFixed(6)})