From e281ebbb85018235d61f0d2886060e66ec6a2bd5 Mon Sep 17 00:00:00 2001 From: Dmitry Lobachevsky Date: Wed, 31 Jul 2024 15:34:10 +0200 Subject: [PATCH] feat(Fees): handle fees upcoming breaking changes --- .../src/components/Strategy/components/Fees.tsx | 16 ++++------------ .../TradingRecap/TradingTransactionOverview.tsx | 8 +++++++- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/libs/mstable/vault/src/components/Strategy/components/Fees.tsx b/libs/mstable/vault/src/components/Strategy/components/Fees.tsx index 594eb98e..e647ccb7 100644 --- a/libs/mstable/vault/src/components/Strategy/components/Fees.tsx +++ b/libs/mstable/vault/src/components/Strategy/components/Fees.tsx @@ -51,18 +51,9 @@ export const Fees = (props: StackProps) => { }, )} - {fees?.hasPoolEntryFee && ( - - {intl.formatMessage({ - defaultMessage: - 'Entry fees are collected during deposit. The entry fee is distributed to all token holders to pay for rebalancing costs after new deposits.', - id: 'uBC8fe', - })} - - )} - 0% + {fees?.exitFee} {intl.formatMessage({ defaultMessage: 'Exit Fee', @@ -72,11 +63,12 @@ export const Fees = (props: StackProps) => { {intl.formatMessage( { - defaultMessage: `The {symbol} Vault doesn't charge exit fee.`, - id: 'epCeiH', + defaultMessage: `The {symbol} Vault charges a {fee} exit fee.`, + id: '0/F4cj', }, { symbol: config.symbol, + fee: fees?.exitFee, }, )} diff --git a/libs/mstable/vault/src/components/TradingPanel/TradingRecap/TradingTransactionOverview.tsx b/libs/mstable/vault/src/components/TradingPanel/TradingRecap/TradingTransactionOverview.tsx index 7a677a7d..5f6c21ba 100644 --- a/libs/mstable/vault/src/components/TradingPanel/TradingRecap/TradingTransactionOverview.tsx +++ b/libs/mstable/vault/src/components/TradingPanel/TradingRecap/TradingTransactionOverview.tsx @@ -69,7 +69,10 @@ const useTradingTransactionOverview = () => { } = useVault(); const [{ slippage, minSlippage, isMaxSlippageLoading }] = useTradingPanelSettings(); - const { entryFee, hasPoolEntryFee } = usePoolFees({ address, chainId }); + const { entryFee, hasPoolEntryFee, exitFee } = usePoolFees({ + address, + chainId, + }); const { minDepositUSD } = usePoolManagerLogicData(address, chainId); const lockTime = useTradingPanelLockTime(); const isDeposit = useIsDepositTradingPanelType(); @@ -99,6 +102,7 @@ const useTradingTransactionOverview = () => { minWithdrawalUsd, isDisclosureOpen, toggleDisclosureSection, + exitFee, }; }; @@ -119,6 +123,7 @@ export const TradingTransactionOverview: FC = (props) => { minWithdrawalUsd, toggleDisclosureSection, isDisclosureOpen, + exitFee, } = useTradingTransactionOverview(); return ( @@ -152,6 +157,7 @@ export const TradingTransactionOverview: FC = (props) => { })} value={minReceivedText} /> + {!isDeposit && } {isDeposit && (