Skip to content

Commit

Permalink
Merge pull request #304 from mstable/feat/handle-upcoming-fees-breaki…
Browse files Browse the repository at this point in the history
…ng-changes

feat(Fees): handle fees upcoming breaking changes
  • Loading branch information
dimlbc authored Aug 5, 2024
2 parents eb6e29f + e281ebb commit d2bada8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
16 changes: 4 additions & 12 deletions libs/mstable/vault/src/components/Strategy/components/Fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,9 @@ export const Fees = (props: StackProps) => {
},
)}
</Typography>
{fees?.hasPoolEntryFee && (
<Typography sx={{ typography: 'subtitle2', paddingBottom: 1 }}>
{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',
})}
</Typography>
)}
</Stack>
<Stack {...feeCardProps}>
<Typography {...rateChipProps}>0%</Typography>
<Typography {...rateChipProps}>{fees?.exitFee}</Typography>
<Typography variant="h5" gutterBottom>
{intl.formatMessage({
defaultMessage: 'Exit Fee',
Expand All @@ -72,11 +63,12 @@ export const Fees = (props: StackProps) => {
<Typography sx={{ typography: 'subtitle2', paddingBottom: 1 }}>
{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,
},
)}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -99,6 +102,7 @@ const useTradingTransactionOverview = () => {
minWithdrawalUsd,
isDisclosureOpen,
toggleDisclosureSection,
exitFee,
};
};

Expand All @@ -119,6 +123,7 @@ export const TradingTransactionOverview: FC<StackProps> = (props) => {
minWithdrawalUsd,
toggleDisclosureSection,
isDisclosureOpen,
exitFee,
} = useTradingTransactionOverview();

return (
Expand Down Expand Up @@ -152,6 +157,7 @@ export const TradingTransactionOverview: FC<StackProps> = (props) => {
})}
value={minReceivedText}
/>
{!isDeposit && <OverviewItem label="Exit Fee" value={exitFee} />}
{isDeposit && (
<OverviewItem
label="Insurance"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"*.{js,jsx,ts,tsx,mdx}": "eslint --fix"
},
"dependencies": {
"@dhedge/core-ui-kit": "^0.4.1",
"@dhedge/crypto-assets": "^0.2.6",
"@dhedge/core-ui-kit": "^0.4.6",
"@dhedge/crypto-assets": "^0.2.27",
"@emotion/react": "11.10.6",
"@emotion/styled": "11.10.6",
"@fontsource/plus-jakarta-sans": "^4.5.11",
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1983,10 +1983,10 @@
enabled "2.0.x"
kuler "^2.0.0"

"@dhedge/core-ui-kit@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@dhedge/core-ui-kit/-/core-ui-kit-0.4.1.tgz#838c56c905f1a110dcfd8a6b859992946d1985a9"
integrity sha512-MmxfFVUw8peC1ahhZKafmAMMKrdM9fFkzxqTDy8IeHuFmtOvFyN9A5j8o2eF3pXvM4cOXIE+9Ay73k9yf2A0WA==
"@dhedge/core-ui-kit@^0.4.6":
version "0.4.6"
resolved "https://registry.yarnpkg.com/@dhedge/core-ui-kit/-/core-ui-kit-0.4.6.tgz#7924edc15dee15c888ff0f2ff0f61ba2ef67e874"
integrity sha512-BiynKdaIjJqGZiQJ1h8Qn0dsD5ugJAGJJHsYpGxngG4qKIOX7gukbcFxYcMnbQDN90hWrew16MLQS932hfhD7Q==
dependencies:
"@wagmi/chains" "^0.2.25"
lodash.chunk "^4.2.0"
Expand All @@ -1995,10 +1995,10 @@
lodash.noop "^3.0.1"
lodash.uniqby "^4.7.0"

"@dhedge/crypto-assets@^0.2.6":
version "0.2.6"
resolved "https://registry.yarnpkg.com/@dhedge/crypto-assets/-/crypto-assets-0.2.6.tgz#1be6de4b6bdb1616b2ae2038e36a9d89adc2e677"
integrity sha512-NaJx+u1+eppejH9Lll3+jg7EB8dwyDUnotMFKQYUskmK4ofmE7yglpBdgyMtIn8nSx7MmKIAAllnmzTIwuXgtw==
"@dhedge/crypto-assets@^0.2.27":
version "0.2.27"
resolved "https://registry.yarnpkg.com/@dhedge/crypto-assets/-/crypto-assets-0.2.27.tgz#cb7dd92a4936a72d033d904bedc9505c94122fe2"
integrity sha512-SKBGfAAjoS8Fm4c/hXY+xqF8cpt2VBYV8fzjmBQQJ415uJjLTHC+CamvUbEr4g0iUKpjAWu8c2qzZ/a2kq6zKQ==

"@discoveryjs/json-ext@^0.5.3", "@discoveryjs/json-ext@^0.5.7":
version "0.5.7"
Expand Down

0 comments on commit d2bada8

Please sign in to comment.