From 5b8e34e8d001cd5eea98a05d52ca6f74fbc880d2 Mon Sep 17 00:00:00 2001 From: Uncle Fatso Date: Mon, 23 Nov 2026 15:09:09 +0300 Subject: [PATCH] tooltips updated Signed-off-by: Uncle Fatso --- package.json | 2 +- src/App.jsx | 4 +-- src/components/Sidebar/NavContent.jsx | 6 ++--- src/containers/Bond/BondModal.jsx | 27 ++++++++++--------- src/containers/Bond/Bonds.jsx | 18 ++++++++++--- .../Bond/components/BondInputArea.jsx | 13 +++------ .../Bond/components/BondSettingsModal.jsx | 4 +-- src/containers/Bridge/BridgeIn.jsx | 20 ++++++++------ src/containers/Bridge/BridgeOut.jsx | 22 ++++++++------- src/containers/Bridge/BridgeSettingsModal.jsx | 4 +-- src/containers/Exodus/Exodus.jsx | 13 ++++----- src/containers/History/BridgeInModal.jsx | 12 ++++----- src/containers/History/History.jsx | 2 +- src/containers/Stake/StakeContainer.jsx | 22 ++++++++------- src/containers/Stake/components/Metric.jsx | 13 ++++----- .../TreasuryDashboard/TreasuryDashboard.jsx | 26 ++++++++++++------ .../TreasuryDashboard/components/Metric.jsx | 16 +++++------ .../components/ProtocolDetails.jsx | 2 +- src/hooks/bonds/index.js | 24 ++++++++++++----- 19 files changed, 146 insertions(+), 104 deletions(-) diff --git a/package.json b/package.json index 511b137..2d8e9cd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.8.30", + "version": "0.8.31", "type": "module", "scripts": { "dev": "vite", diff --git a/src/App.jsx b/src/App.jsx index 7cff994..0c81439 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -198,8 +198,8 @@ function App() { } /> {chainExists && chain.name.toLowerCase())} /> }> - } /> - } /> + } /> + } /> } /> } /> } /> diff --git a/src/components/Sidebar/NavContent.jsx b/src/components/Sidebar/NavContent.jsx index 8f5c950..4a34202 100644 --- a/src/components/Sidebar/NavContent.jsx +++ b/src/components/Sidebar/NavContent.jsx @@ -185,7 +185,7 @@ const NavContent = ({ chainId, addressChainId, address }) => { } /> - + (3, 3) Stake1} to={`/${chainName}/stake`} /> { > {bond.displayName} {bond.isSoldOut - ? + ? : } @@ -228,7 +228,7 @@ const NavContent = ({ chainId, addressChainId, address }) => { /> - 0 ? signedExoduses : null} label="(1, 1) Ghost Exodus" to={`/${chainName}/exodus`} /> + 0 ? signedExoduses : null} label="(1, 1) Exodus" to={`/${chainName}/exodus`} /> {/* */} diff --git a/src/containers/Bond/BondModal.jsx b/src/containers/Bond/BondModal.jsx index 5c1a5ea..c5a9384 100644 --- a/src/containers/Bond/BondModal.jsx +++ b/src/containers/Bond/BondModal.jsx @@ -91,11 +91,13 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => { return () => window.removeEventListener("keydown", handleKeyDown); }, [network, navigate, isSettingsOpen]); - const chainSymbol = useMemo(() => { - const chainSymbol = config?.getClient()?.chain?.nativeCurrency?.symbol; - if (chainSymbol) return chainSymbol; - return "WTF"; - }, [config]); + const chain = useMemo(() => { + const client = config?.getClient(); + return { + symbol: client?.chain?.nativeCurrency?.symbol, + name: client?.chain?.name, + } + }, [config, chainId]); const preparedQuoteToken = useMemo(() => { return { @@ -105,7 +107,7 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => { name: bond.quoteToken.name, isNative: bond.quoteToken.quoteTokenAddress.toLowerCase() === WETH_ADDRESSES[chainId]?.toLowerCase(), } - }, [bond, chainSymbol, chainId]); + }, [bond, chain, chainId]); return ( @@ -161,16 +163,17 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => { )} - /> + /> } /> } /> @@ -181,7 +184,7 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => { { +const Bonds = ({ chainId, config, address, connect }) => { const location = useLocation(); const { network } = useParams(); @@ -29,6 +29,14 @@ const Bonds = ({ chainId, address, connect }) => { const isSmallScreen = useMediaQuery("(max-width: 650px)"); const isVerySmallScreen = useMediaQuery("(max-width: 379px)"); + const chain = useMemo(() => { + const client = config?.getClient(); + return { + symbol: client?.chain?.nativeCurrency?.symbol, + name: client?.chain?.name, + } + }, [config, chainId]); + useEffect(() => { ReactGA.send({ hitType: "pageview", page: location.pathname }); }, [location]); @@ -74,13 +82,15 @@ const Bonds = ({ chainId, address, connect }) => { > diff --git a/src/containers/Bond/components/BondInputArea.jsx b/src/containers/Bond/components/BondInputArea.jsx index 3ca4d44..ed8af52 100644 --- a/src/containers/Bond/components/BondInputArea.jsx +++ b/src/containers/Bond/components/BondInputArea.jsx @@ -26,7 +26,7 @@ import { useBalance, useTokenSymbol } from "../../../hooks/tokens"; const BondInputArea = ({ bond, - config, + chain, chainId, slippage, recipientAddress, @@ -43,11 +43,6 @@ const BondInputArea = ({ const { pathname } = useLocation(); const [previousPathname, setPreviousPathname] = useState(pathname); - const nativeSymbol = useMemo(() => { - const client = config?.getClient(); - return client?.chain?.nativeCurrency?.symbol; - }, [config]); - const [wethOption, setWethOpen] = useState(false); const [isWrappedToken, setIsWrappedToken] = useState(false); @@ -154,7 +149,7 @@ const BondInputArea = ({ spendAmountValue={parsedAmount} spendAmount={formatNumber(parsedAmount, formatDecimals)} receiveAmount={formatNumber(amountInBaseToken, formatDecimals)} - bondQuoteTokenName={selectedQuoteToken ? preparedQuoteToken.name : nativeSymbol} + bondQuoteTokenName={selectedQuoteToken ? preparedQuoteToken.name : chain.symbol} bondQuoteTokenIcons={preparedQuoteToken.icons} bondQuoteTokenChainNames={preparedQuoteToken.chainNames} isNative={selectedQuoteToken === undefined} @@ -178,13 +173,13 @@ const BondInputArea = ({ /> } tokenOnClick={preparedQuoteToken.isNative ? toggleQuoteToken : undefined} - tokenName={selectedQuoteToken ? preparedQuoteToken.name : nativeSymbol} + tokenName={selectedQuoteToken ? preparedQuoteToken.name : chain.symbol} info={ (!isSemiSmallScreen ? "Balance: " : "") + formatCurrency( balance, formatDecimals, - selectedQuoteToken ? preparedQuoteToken.name : nativeSymbol + selectedQuoteToken ? preparedQuoteToken.name : chain.symbol ) } endString="Max" diff --git a/src/containers/Bond/components/BondSettingsModal.jsx b/src/containers/Bond/components/BondSettingsModal.jsx index ed92c38..d6224f5 100644 --- a/src/containers/Bond/components/BondSettingsModal.jsx +++ b/src/containers/Bond/components/BondSettingsModal.jsx @@ -53,7 +53,7 @@ const BondSettingsModal = props => { - Recipient Address + Custom destination address { - Custom recipient address of bonded assets + Recipient address of bonded assets diff --git a/src/containers/Bridge/BridgeIn.jsx b/src/containers/Bridge/BridgeIn.jsx index a099d4a..ae049e6 100644 --- a/src/containers/Bridge/BridgeIn.jsx +++ b/src/containers/Bridge/BridgeIn.jsx @@ -110,6 +110,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => { const [customReceiver, setCustomReceiver] = useState(account ? account.address : ""); const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST"); + const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO"); const { balance: ghstBalance, refetch: ghstBalanceRefetch } = useBalance(chainId, "GHST", address); const { gatekeeperAddress } = useGatekeeperAddress(chainId); const { existentialDeposit } = useGatekeeperMinimum(chainId); @@ -307,10 +308,13 @@ const BridgeIn = ({ chainId, address, config, connect }) => { return { finalityDelay, text: `~${estimatedMins} mins` } }, [chainId, networkData]); - const nativeSymbol = useMemo(() => { + const chain = useMemo(() => { const client = config?.getClient(); - return client?.chain?.nativeCurrency?.symbol; - }, [config]); + return { + symbol: client?.chain?.nativeCurrency?.symbol, + name: client?.chain?.name, + } + }, [config, chainId]); const estimatedOutAmount = useMemo(() => { const hundredPercent = 1000000000; @@ -411,7 +415,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => { estimatedOutAmount={estimatedOutAmount} formatDecimals={formatDecimals} ghstSymbol={ghstSymbol} - nativeSymbol={nativeSymbol} + nativeSymbol={chain.symbol} externalSymbol={chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"} receiver={customReceiver ? customReceiver : receiver} sender={address} @@ -443,19 +447,19 @@ const BridgeIn = ({ chainId, address, config, connect }) => { @@ -497,7 +501,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => { id="from" token={ diff --git a/src/containers/Bridge/BridgeOut.jsx b/src/containers/Bridge/BridgeOut.jsx index 2a90f96..402f528 100644 --- a/src/containers/Bridge/BridgeOut.jsx +++ b/src/containers/Bridge/BridgeOut.jsx @@ -112,6 +112,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => { const { casperApi, client, account } = useUnstableProvider(); const { gatekeepedApy } = useGatekeeperApy(chainId); + const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO"); const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST"); const { balance: ghstBalance } = useBalance(chainId, "GHST", address); const { gatekeeperAddress } = useGatekeeperAddress(chainId); @@ -120,10 +121,13 @@ const BridgeOut = ({ chainId, address, config, connect }) => { const { data: formatDecimals } = useStorageValue(chainId, address, DECIMALS_PREFIX, "5"); - const nativeSymbol = useMemo(() => { + const chain = useMemo(() => { const client = config?.getClient(); - return client?.chain?.nativeCurrency?.symbol; - }, [config]); + return { + symbol: client?.chain?.nativeCurrency?.symbol, + name: client?.chain?.name, + } + }, [config, chainId]); const setFormatDecimals = useCallback((value) => { const valueNumber = Number(value); @@ -556,7 +560,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => { sender={account ? account.address : ""} startGhostExodus={startGhostExodus} allocation={allocation} - nativeSymbol={nativeSymbol} + nativeSymbol={chain.symbol} /> { setReceiver={setCustomReceiver} allocation={allocation} setAllocation={setAllocation} - nativeSymbol={nativeSymbol} + nativeSymbol={chain.symbol} /> @@ -592,19 +596,19 @@ const BridgeOut = ({ chainId, address, config, connect }) => { @@ -666,7 +670,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => { id="to" token={ diff --git a/src/containers/Bridge/BridgeSettingsModal.jsx b/src/containers/Bridge/BridgeSettingsModal.jsx index 19dadc3..4f52a13 100644 --- a/src/containers/Bridge/BridgeSettingsModal.jsx +++ b/src/containers/Bridge/BridgeSettingsModal.jsx @@ -113,11 +113,11 @@ export const BridgeOutSettingsModal = ({ - Destination address + Custom destination address - Custom recipient address of bridged assets + Recipient address of bridged-out assets diff --git a/src/containers/Exodus/Exodus.jsx b/src/containers/Exodus/Exodus.jsx index 03a07b7..14e3d21 100644 --- a/src/containers/Exodus/Exodus.jsx +++ b/src/containers/Exodus/Exodus.jsx @@ -93,11 +93,12 @@ const Exodus = ({ chainId, address, config }) => { const nativeMetadata = useMemo(() => { const client = config?.getClient(); return { + name: client?.chain.name, url: client?.chain?.blockExplorers?.default?.url, symbol: client?.chain?.nativeCurrency?.symbol, decimals: client?.chain?.nativeCurrency?.decimals, } - }, [config]); + }, [config, chainId]); const ftsoPrice = useFtsoPrice(chainId); const reservePrice = useReservePrice(chainId); @@ -229,7 +230,7 @@ const Exodus = ({ chainId, address, config }) => { return ( - + { { {formatNumber(executionDiscount, 2)}% } - label="Discount" - tooltip="some description to be added" + label="Exodus Discount" + tooltip={`Discount rate at which the protocol offers ${ftsoSymbol} in exchange for verifying (1, 1) Exodus transactions. The discount dynamically increases through on-chain Dutch Auction mechanics.`} /> diff --git a/src/containers/History/BridgeInModal.jsx b/src/containers/History/BridgeInModal.jsx index e782ae0..dfe4182 100644 --- a/src/containers/History/BridgeInModal.jsx +++ b/src/containers/History/BridgeInModal.jsx @@ -209,11 +209,6 @@ const BridgeInModal = ({ chainId, isOpen, close, config, historyRecord }) => { } }, [functionArgs, transferInfo, chainProperties]); - const estimatedFee = useMemo(() => { - if (!networkData) return null; - return networkData.incoming_share / 10000000; - }, [networkData]); - const estimatedReceived = useMemo(() => { if (!networkData || !chainProperties) return null; @@ -444,7 +439,12 @@ const BridgeInModal = ({ chainId, isOpen, close, config, historyRecord }) => { {formatNumber(estimatedFee, 2)}%} + balance={bridgedAmount && estimatedReceived + ? + {formatCurrency(bridgedAmount.sub(estimatedReceived), 5, chainProperties?.properties.tokenSymbol ?? "")} + + : + } /> } - return + return }, [item, currentTime, isVerySmallScreen, finalityDelay]); const txHashMetadata = useMemo(() => { diff --git a/src/containers/Stake/StakeContainer.jsx b/src/containers/Stake/StakeContainer.jsx index 5a62505..a92de5f 100644 --- a/src/containers/Stake/StakeContainer.jsx +++ b/src/containers/Stake/StakeContainer.jsx @@ -32,10 +32,12 @@ export const StakeContainer = ({ chainId, address, config, connect }) => { const { epoch, refetch: refetchEpoch } = useEpoch(chainId); - const chainSymbol = useMemo(() => { - const chainSymbol = config?.getClient()?.chain?.nativeCurrency?.symbol; - if (chainSymbol) return chainSymbol; - return "WTF"; + const chain = useMemo(() => { + const client = config?.getClient(); + return { + symbol: client?.chain?.nativeCurrency?.symbol, + name: client?.chain?.name, + } }, [config, chainId]) useEffect(() => { @@ -45,7 +47,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => { if (isModalOpened) { return ( { return ( - + { > - + @@ -94,7 +96,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => { - + @@ -103,14 +105,14 @@ export const StakeContainer = ({ chainId, address, config, connect }) => { onClick={() => handleModal(true)} sx={{ maxWidth: isSemiSmallScreen ? "100%" : "350px" }} > - Start staking + Start (3, 3) Stake¹ - + diff --git a/src/containers/Stake/components/Metric.jsx b/src/containers/Stake/components/Metric.jsx index ec09d93..a5e332d 100644 --- a/src/containers/Stake/components/Metric.jsx +++ b/src/containers/Stake/components/Metric.jsx @@ -1,5 +1,6 @@ import Metric from "../../../components/Metric/Metric"; import { formatCurrency, formatNumber } from "../../../helpers"; +import { bridgeNumbers } from "../../../constants"; import { useCurrentIndex } from "../../../hooks/staking"; import { useCirculatingSupply } from "../../../hooks/tokens"; @@ -12,8 +13,8 @@ export const CurrentIndex = props => { const _props = { ...props, - label: `Current Index`, - tooltip: `The current index indicates the amount of ${props.ftsoSymbol} a holder would possess if they had staked and maintained 1 ${props.ftsoSymbol} since its launch.`, + label: "Stake¹ Index", + tooltip: `A cumulative multiplier showing how much 1 ${props.ftsoSymbol} would have compounded if staked in (3, 3) Stake¹ since protocol launch.`, }; if (currentIndex) _props.metric = `${formatNumber(currentIndex, 2)}`; @@ -34,8 +35,8 @@ export const Apy = props => { const _props = { ...props, - label: "APY", - tooltip: `The annualized rate of return, accounting for compounding from ${props.stnkSymbol}’s exponential rebasing.`, + label: "Stake¹ APY", + tooltip: `Annualized (3, 3) Stake¹ yield for ${props.ftsoSymbol} based on the protocol's current rebase rate, funded by protocol revenue on ${props.chainName}.` }; if (apy) _props.metric = `${formatNumber(apy, 2)}${apy === Infinity ? "" : "%"}`; @@ -51,8 +52,8 @@ export const TotalDeposit = props => { const _props = { ...props, - label: "Total Deposit", - tooltip: `Total reserves of native coins, LP tokens, and other assets in the ghostDAO treasury backing the entire circulating supply of ${props.stnkSymbol}.`, + label: "Total Stake¹", + tooltip: `Market value of all ${props.ftsoSymbol} staked into (3, 3) Stake¹ on ${props.chainName}, including tokens still in warmup or in ${bridgeNumbers()} Bridge-In.` }; if (deposit) _props.metric = `${formatCurrency(deposit, 2)}`; diff --git a/src/containers/TreasuryDashboard/TreasuryDashboard.jsx b/src/containers/TreasuryDashboard/TreasuryDashboard.jsx index 35c0170..4951877 100644 --- a/src/containers/TreasuryDashboard/TreasuryDashboard.jsx +++ b/src/containers/TreasuryDashboard/TreasuryDashboard.jsx @@ -20,7 +20,7 @@ import SafariFooter from "../../components/SafariFooter/SafariFooter"; import { useTokenSymbol } from "../../hooks/tokens"; -const MetricsDashboard = ({ chainId }) => { +const MetricsDashboard = ({ chainId, nativeMetadata }) => { const theme = useTheme(); const isMobileScreen = useMediaQuery("(max-width: 885px)"); const isVeryMobileScreen = useMediaQuery("(max-width: 560px)"); @@ -40,22 +40,22 @@ const MetricsDashboard = ({ chainId }) => { - + - + - + - + - + @@ -70,7 +70,7 @@ const MetricsDashboard = ({ chainId }) => { ); }; -const TreasuryDashboard = ({ chainId }) => { +const TreasuryDashboard = ({ chainId, config }) => { const isSmallScreen = useMediaQuery("(max-width: 650px)"); const isVerySmallScreen = useMediaQuery("(max-width: 379px)"); @@ -80,6 +80,16 @@ const TreasuryDashboard = ({ chainId }) => { ReactGA.send({ hitType: "pageview", page: location.pathname }); }, [location]); + const nativeMetadata = useMemo(() => { + const client = config?.getClient(); + return { + chainName: client?.chain?.name, + url: client?.chain?.blockExplorers?.default?.url, + symbol: client?.chain?.nativeCurrency?.symbol, + decimals: client?.chain?.nativeCurrency?.decimals, + } + }, [config]); + return ( <> @@ -90,7 +100,7 @@ const TreasuryDashboard = ({ chainId }) => { }} > - + diff --git a/src/containers/TreasuryDashboard/components/Metric.jsx b/src/containers/TreasuryDashboard/components/Metric.jsx index 0f4ada0..53a7528 100644 --- a/src/containers/TreasuryDashboard/components/Metric.jsx +++ b/src/containers/TreasuryDashboard/components/Metric.jsx @@ -14,8 +14,8 @@ export const CurrentIndex = props => { const _props = { ...props, - label: `Current Index`, - tooltip: `The current index indicates the amount of ${props.ftsoSymbol} a holder would possess if they had staked and maintained 1 ${props.ftsoSymbol} since its launch.`, + label: "Stake¹ Index", + tooltip: `Cumulative multiplier showing how much 1 ${props.ftsoSymbol} would have compounded through continuous (3, 3) Stake¹ since launch on ${props.nativeMetadata.chainName}.`, }; if (currentIndex) _props.metric = `${formatNumber(currentIndex, 2)} ${props.ftsoSymbol}`; @@ -32,7 +32,7 @@ export const GhostPrice = props => { const _props = { ...props, label: `${props.ghstSymbol} Price`, - tooltip: `1 ${props.ghstSymbol} = 1 ${props.ftsoSymbol} x Current Index`, + tooltip: `Synthetic price of 1 ${props.ghstSymbol}, derived by multiplying the price of 1 ${props.ftsoSymbol} by (3, 3) Stake¹ Index.`, }; if (ghstPrice) _props.metric = formatCurrency(ghstPrice, 2); @@ -47,7 +47,7 @@ export const FatsoPrice = props => { const _props = { ...props, label: `${props.ftsoSymbol} Price`, - tooltip: `Weighted ${props.ftsoSymbol} Price Across V2 DEXs on the chosen EVM Chain`, + tooltip: `Weighted price of 1 ${props.ftsoSymbol} across DEXs on ${props.nativeMetadata.chainName}, excluding prices from other EVMs.`, }; if (ftsoPrice) _props.metric = formatCurrency(ftsoPrice, 2); @@ -62,8 +62,8 @@ export const CirculatingSupply = props => { const _props = { ...props, - label: `Circulating / Total`, - tooltip: `Circulating supply refers to the amount of ${props.stnkSymbol} in circulation, excluding those held by the protocol in its treasury. However, ${props.stnkSymbol} allocated to Protocol-Owned Liquidity is considered part of the circulating supply.`, + label: `Stake¹ / Total`, + tooltip: `(3, 3) Stake¹ supply is all staked ${props.ftsoSymbol}. Total supply is all ${props.ftsoSymbol} ever minted. The delta is unstaked ${props.ftsoSymbol} in user wallets and DEX liquidity pools, including Protocol Owned Liquidity (POL).` }; if (circulatingSupply && totalSupply) _props.metric = `${formatNumber(circulatingSupply, 0)}/${formatNumber(totalSupply, 0)}`; @@ -84,7 +84,7 @@ export const FatsoBacking = props => { const _props = { ...props, label: `Backing per ${props.ftsoSymbol}`, - tooltip: `The total amount of native coins, LP tokens, and other assets held by the ghostDAO treasury to support the value of each ${props.ftsoSymbol} in circulation.` + tooltip: `Intrinsic treasury backing per 1 ${props.ftsoSymbol} from pure Web3, non-freezable assets on ${props.nativeMetadata.chainName} (wrapped ${props.nativeMetadata.symbol} and Uni-V2 LP tokens), calculated as if ${props.ftsoSymbol} price fell to its ${props.nativeMetadata.symbol}-denominated floor of $1 set at launch.`, }; if (backing) _props.metric = formatCurrency(backing, 2); @@ -101,7 +101,7 @@ export const TreasuryMarketCap = props => { const _props = { ...props, label: `Market Cap`, - tooltip: `Market Cap = ${props.ftsoSymbol} Price × ${props.ftsoSymbol} Total Supply` + tooltip: `Market capitalization of ${props.ftsoSymbol} on ${props.nativeMetadata.chainName}, excluding market cap estimates from other EVMs.` }; if (marketCap) _props.metric = formatCurrency(marketCap, 2); diff --git a/src/containers/TreasuryDashboard/components/ProtocolDetails.jsx b/src/containers/TreasuryDashboard/components/ProtocolDetails.jsx index faa9052..e37a3f8 100644 --- a/src/containers/TreasuryDashboard/components/ProtocolDetails.jsx +++ b/src/containers/TreasuryDashboard/components/ProtocolDetails.jsx @@ -110,7 +110,7 @@ const ProtocolDetails = ({ chainId, isMobileScreen, theme, }) => { isMobileScreen={isMobileScreen} theme={theme} url={`/${networkName.toLowerCase()}/stake`} - name="(3, 3) Stake" + name="(3, 3) Stake¹" sideName={`${formatNumber(apyInner, 2)}% APY`} description={`Staking enables (3, 3) coordination by aligning long-term incentives, sustainably backed by (1, 1) Bonds, LP fees, and Farming. Stake ${ftsoSymbol} to earn rewards and unlock ${bridgeNumbers()} Stake\u00B2.`} /> diff --git a/src/hooks/bonds/index.js b/src/hooks/bonds/index.js index c6a86ae..e64500a 100644 --- a/src/hooks/bonds/index.js +++ b/src/hooks/bonds/index.js @@ -6,6 +6,7 @@ import { BOND_DEPOSITORY_ADDRESSES, DAO_TREASURY_ADDRESSES, BONDING_CALCULATOR_ADDRESSES, + WETH_ADDRESSES, } from "../../constants/addresses"; import { abi as BondAbi } from "../../abi/GhostBondDepository.json"; import { abi as TreasuryAbi } from "../../abi/GhostTreasury.json"; @@ -27,6 +28,8 @@ import { DecimalBigNumber } from "../../helpers/DecimalBigNumber"; import { shorten } from "../../helpers"; import { tokenNameConverter } from "../../helpers/tokenConverter"; +const LP_SYMBOLS = ["UNI-V2", "SLP", "CAKE-LP"]; + export const useLiveBonds = (chainId, chainName) => { const { data: liveIndexesRaw, refetch: refetchLiveMarkets } = useReadContract({ abi: BondAbi, @@ -256,7 +259,10 @@ export const useNotes = (chainId, address) => { }); const quoteTokenNames = useMemo( - () => markets?.map((m) => m.result?.at(3)).filter(Boolean), + () => markets?.map((m) => { + const address = m.result?.at(3); + return address ? address : WETH_ADDRESSES[chainId]; + }), [markets] ); @@ -264,13 +270,19 @@ export const useNotes = (chainId, address) => { const notes = indexesFor ? indexesFor.map((noteIndex, index) => { const id = Number(noteIndex); - const quoteTokenAddress = markets?.at(index).result?.at(3) ? markets.at(index).result.at(3) : ""; - const quoteTokenSymbol = quoteTokenSymbols?.at(index)?.result ? quoteTokenSymbols.at(index).result : ""; + const quoteTokenAddress = quoteTokenNames?.at(index); + const quoteTokenSymbol = quoteTokenSymbols?.at(index)?.result + ? quoteTokenSymbols.at(index).result + : ""; const tokenIcos = getTokenIcons(chainId, quoteTokenAddress); - const isEmptyIcon = tokenIcos.length === 1 && tokenIcos.at(0) === ''; - const quoteTokenIcons = isEmptyIcon ? ["WETH"] : tokenIcos; - const chainNames = isEmptyIcon ? [] : getChainTokenNames(chainId, quoteTokenAddress) + const isEmptyIcon = tokenIcos.length === 1 && tokenIcos.at(0) === ""; + const isLpToken = LP_SYMBOLS.includes(quoteTokenSymbol); + + const chainNames = isEmptyIcon ? [] : getChainTokenNames(chainId, quoteTokenAddress); + const quoteTokenIcons = isEmptyIcon + ? (isLpToken ? ["WETH", "FTSO"] : ["WETH"]) + : tokenIcos; return { id,