tooltips updated

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-11-23 15:09:09 +03:00
parent 5587b163f8
commit 5b8e34e8d0
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
19 changed files with 146 additions and 104 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.8.30",
"version": "0.8.31",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -198,8 +198,8 @@ function App() {
<Route path="/" element={<Navigate to={chainExists ? `/${chains.at(0).name.toLowerCase()}/dashboard` : "/empty"} />} />
{chainExists &&
<Route path="/:network" element={<AvailableNetworkGuard allowedNetworks={chains.map(chain => chain.name.toLowerCase())} /> }>
<Route path="dashboard" element={<TreasuryDashboard chainId={addressChainId ? addressChainId : chainId} />} />
<Route path="bonds" element={<Bonds connect={tryConnectInjected} address={address} chainId={addressChainId ? addressChainId : chainId} />} />
<Route path="dashboard" element={<TreasuryDashboard config={config} chainId={addressChainId ? addressChainId : chainId} />} />
<Route path="bonds" element={<Bonds config={config} connect={tryConnectInjected} address={address} chainId={addressChainId ? addressChainId : chainId} />} />
<Route path="bonds/:id" element={<BondModalContainer config={config} connect={tryConnectInjected} address={address} chainId={addressChainId ? addressChainId : chainId} />} />
<Route path="stake" element={<StakeContainer config={config} connect={tryConnectInjected} address={address} chainId={addressChainId ? addressChainId : chainId} />} />
<Route path="bridge-in" element={<BridgeIn config={config} connect={tryConnectInjected} address={address} chainId={addressChainId ? addressChainId : chainId} />} />

View File

@ -185,7 +185,7 @@ const NavContent = ({ chainId, addressChainId, address }) => {
</AccordionDetails>
}
/>
<NavItem icon={StakeIcon} label={`(3, 3) Stake`} to={`/${chainName}/stake`} />
<NavItem icon={StakeIcon} label={<span>(3, 3) Stake<sup>1</sup></span>} to={`/${chainName}/stake`} />
<NavItem
defaultExpanded
icon={BondIcon}
@ -215,7 +215,7 @@ const NavContent = ({ chainId, addressChainId, address }) => {
>
{bond.displayName}
{bond.isSoldOut
? <Chip label="Sold Out" template="darkGray" />
? <Chip label="Sold Out" template="gray" />
: <BondDiscount discount={bond.discount} />
}
</Typography>
@ -228,7 +228,7 @@ const NavContent = ({ chainId, addressChainId, address }) => {
/>
<NavItem icon={ForkRightIcon} label={`${bridgeNumbers()} Bridge-In`} to={`/${chainName}/bridge-in`} />
<NavItem icon={RampLeftIcon} label={`${negativeBridgeNumbers()} Bridge-Out`} to={`/${chainName}/bridge-out`} />
<NavItem icon={RouteIcon} chipColor="warning" chip={signedExoduses > 0 ? signedExoduses : null} label="(1, 1) Ghost Exodus" to={`/${chainName}/exodus`} />
<NavItem icon={RouteIcon} chipColor="warning" chip={signedExoduses > 0 ? signedExoduses : null} label="(1, 1) Exodus" to={`/${chainName}/exodus`} />
<NavItem icon={HistoryIcon} chipColor="warning" chip={pendingTransactions} label="Transaction History" to={`/${chainName}/history`} />
{/* <NavItem icon={GavelIcon} label={`Governance`} to={`/${chainName}/governance`} /> */}

View File

@ -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 (
<Box>
@ -161,16 +163,17 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => {
<MetricCollection>
<Metric
label={`Bond Price`}
tooltip="Some description about what the bond price is"
tooltip={`Current discounted price at which ${symbol} can be acquired directly from the protocol on ${chain.name}.`}
metric={bond.isSoldOut ? ( "--" ) : ( <BondPrice price={bond.price.inUsd} /> )}
/>
/>
<Metric
label="Market Price"
label={`${symbol} Price`}
tooltip={`Weighted price of 1 ${symbol} across DEXs on ${chain.name}, excluding prices from other EVMs.`}
metric={<TokenPrice priceInUsd={bond.price.marketPriceInUsd} />}
/>
<Metric
label="Discount"
tooltip="Some description about what the discount is"
label="Bond Discount"
tooltip={`Discount rate at which the protocol offers ${symbol}. The discount dynamically increases through on-chain Dutch Auction mechanics.`}
metric={<BondDiscount discount={bond.discount} textOnly />}
/>
</MetricCollection>
@ -181,7 +184,7 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => {
<BondInputArea
chainId={chainId}
bond={bond}
config={config}
chain={chain}
connect={connect}
address={address}
slippage={slippage}

View File

@ -1,5 +1,5 @@
import { Box, Tab, Tabs, Typography, Container, useMediaQuery } from "@mui/material";
import { useEffect, useState } from "react";
import { useEffect, useState, useMemo } from "react";
import { useParams, useLocation } from "react-router-dom";
import ReactGA from "react-ga4";
@ -19,7 +19,7 @@ import { useTotalReserves } from "../../hooks/treasury";
import { useFtsoPrice } from "../../hooks/prices";
import { useTokenSymbol } from "../../hooks/tokens";
const Bonds = ({ chainId, address, 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 }) => {
>
<MetricCollection>
<Metric
label={`Treasury Balance`}
label={`Treasury Backing`}
metric={formatCurrency(totalReserves, 2)}
tooltip={`Total intrinsic treasury backing from pure Web3, non-freezable assets on ${chain.name} (wrapped ${chain.symbol} and Uni-V2 LP tokens), calculated as if ${ftsoSymbol} price fell to its ${chain.symbol}-denominated floor of $1 set at launch.`}
isLoading={false}
/>
<Metric
label={`${ftsoSymbol} price`}
label={`${ftsoSymbol} Price`}
metric={formatCurrency(ftsoPrice, 2)}
tooltip={`Weighted price of 1 ${ftsoSymbol} across DEXs on ${chain.name}, excluding prices from other EVMs.`}
isLoading={false}
/>
</MetricCollection>

View File

@ -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"

View File

@ -53,7 +53,7 @@ const BondSettingsModal = props => {
</Box>
<Box mt="32px">
<InputLabel htmlFor="recipient">Recipient Address</InputLabel>
<InputLabel htmlFor="recipient">Custom destination address</InputLabel>
<Box mt="8px">
<FormControl variant="outlined" color="primary" fullWidth>
<OutlinedInput
@ -67,7 +67,7 @@ const BondSettingsModal = props => {
</Box>
<Box mt="8px">
<Typography variant="body2" color="textSecondary">
Custom recipient address of bonded assets
Recipient address of bonded assets
</Typography>
</Box>
</Box>

View File

@ -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 }) => {
<Metric
metric={`${formatNumber(gatekeepedApy, 2)}%`}
label={`Stake\u00B2 APY`}
tooltip="some description to be added"
tooltip={`Gross annualized ${ftsoSymbol} (4, 4) Stake² yield, funded by GHOST Chain revenue. Includes (3, 3) Stake¹ APY.`}
/>
<Metric
metric={`${formatNumber(totalStaked ? totalStaked.toString() : "0", 2)} ${chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}`}
isLoading={!totalStaked}
label="Bridge Security Stake"
tooltip="some description to be added"
tooltip={`Total ${chainProperties.properties.tokenSymbol} securing the bridge, including validator, nominator, and pool stakes across the active validator set of ${chainProperties.name}.`}
/>
<Metric
label="Block Delay"
tooltip={`some description to be added ${blockDelayMetric ? blockDelayMetric.finalityDelay : "estimating..."}`}
tooltip={`Difference between the ${chain.name} block reported by your local RPC and the latest median ${chain.name} block agreed on by the active validator set of ${chainProperties.name}.`}
isLoading={!blockDelayMetric}
metric={blockDelayMetric?.text}
/>
@ -497,7 +501,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => {
id="from"
token={
<TokenStack
chainTokenNames={[nativeSymbol]}
chainTokenNames={[chain.symbol]}
tokens={[ghstSymbol]}
sx={{ fontSize: "25px", height: "30px" }}
/>

View File

@ -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}
/>
<BridgeOutSettingsModal
isOpen={settingsOpen}
@ -567,7 +571,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
setReceiver={setCustomReceiver}
allocation={allocation}
setAllocation={setAllocation}
nativeSymbol={nativeSymbol}
nativeSymbol={chain.symbol}
/>
<Box mt="15px" display="flex" flexDirection="column" justifyContent="space-between" alignItems="center">
@ -592,19 +596,19 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
<Metric
metric={`${formatNumber(gatekeepedApy, 2)}%`}
label={`Stake\u00B2 APY`}
tooltip="some description to be added"
tooltip={`Gross annualized ${ftsoSymbol} ${bridgeNumbers()} Stake² yield, funded by ${chainProperties.name} revenue. Includes (3, 3) Stake¹ APY.`}
/>
<Metric
metric={`${formatNumber(totalStaked ? totalStaked.toString() : "0", 2)} ${chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}`}
isLoading={!totalStaked}
label="Bridge Security Stake"
tooltip="some description to be added"
tooltip={`Total ${ghstSymbol} securing the bridge, including validator, nominator, and pool stakes across the active validator set of ${chainProperties.name}.`}
/>
<Metric
label="Bridge-Out Queue"
tooltip="some description to be added"
tooltip={`Number of ${negativeBridgeNumbers()} Bridge-Out transactions currently queued and scheduled for processing by the active validator set of ${chainProperties.name}.`}
isLoading={!Number.isFinite(counterForExodusRequests)}
metric={`${formatNumber(counterForExodusRequests)} (~10 mins)`}
/>
@ -666,7 +670,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
id="to"
token={
<TokenStack
chainTokenNames={[nativeSymbol]}
chainTokenNames={[chain.symbol]}
tokens={[ghstSymbol]}
sx={{ fontSize: "25px", height: "30px" }}
/>

View File

@ -113,11 +113,11 @@ export const BridgeOutSettingsModal = ({
</Box>
<Box mt="8px">
<InputLabel htmlFor="recipient">Destination address</InputLabel>
<InputLabel htmlFor="recipient">Custom destination address</InputLabel>
<Box mt="8px">
<BridgeGhostAddressCard isEvm receiver={receiver} setReceiver={setReceiver} />
<Typography mt="8px" variant="body2" color="textSecondary">
Custom recipient address of bridged assets
Recipient address of bridged-out assets
</Typography>
</Box>
</Box>

View File

@ -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 (
<Box minHeight="calc(100vh - 43px)">
<PageTitle name="Ghost Exodus" subtitle="(1, 1) Verify Exodus for a treasury-backed reward" />
<PageTitle name="Exodus" subtitle="(1, 1) Verify Exodus for a treasury-backed reward" />
<Container
style={{
paddingLeft: isSmallScreen || isVerySmallScreen ? "0" : "3.3rem",
@ -259,13 +260,13 @@ const Exodus = ({ chainId, address, config }) => {
<Metric
metric={formatCurrency(currentTwapPrice(10n ** BigInt(nativeMetadata.decimals)).mul(ftsoPrice), 2)}
label="Exodus Price"
tooltip="some description to be added"
tooltip={`Current discounted price at which ${ftsoSymbol} can be acquired directly from the protocol on ${nativeMetadata.name} for verifying (1, 1) Exodus transactions.`}
/>
<Metric
metric={formatCurrency(ftsoPrice, 2)}
label={`${ftsoSymbol} Price`}
tooltip="some description to be added"
tooltip={`Weighted price of 1 ${ftsoSymbol} across DEXs on ${nativeMetadata.name}, excluding prices from other EVMs.`}
/>
<Metric
@ -278,8 +279,8 @@ const Exodus = ({ chainId, address, config }) => {
{formatNumber(executionDiscount, 2)}%
</Typography>
}
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.`}
/>
</MetricCollection>

View File

@ -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 }) => {
<DataRow
title="GHOST Fee (Est.)"
tooltip="some description to be added."
balance={<Typography variant="body1">{formatNumber(estimatedFee, 2)}%</Typography>}
balance={bridgedAmount && estimatedReceived
? <Typography variant="body1">
{formatCurrency(bridgedAmount.sub(estimatedReceived), 5, chainProperties?.properties.tokenSymbol ?? "")}
</Typography>
: <Skeleton width="120px" />
}
/>
<DataRow

View File

@ -80,7 +80,7 @@ const HistoryItem = ({
return <Chip sx={{ width: width }} label={isVerySmallScreen ? "" : "Pending"} template={"gray"} />
}
return <Chip sx={{ width: width }} label={isVerySmallScreen ? "" : "Ready"} template={"success"} />
return <Chip sx={{ width: width }} label={isVerySmallScreen ? "" : "Finalized"} template={"success"} />
}, [item, currentTime, isVerySmallScreen, finalityDelay]);
const txHashMetadata = useMemo(() => {

View File

@ -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 (
<Stake
chainSymbol={chainSymbol}
chainSymbol={chain.symbol}
chainId={chainId}
address={address}
isOpened={isModalOpened}
@ -57,7 +59,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
return (
<Box>
<PageTitle name="Protocol Staking" subtitle={`(3, 3) Stake ${ftsoSymbol} to earn rebase yields backed by protocol revenue`} />
<PageTitle name="Protocol Staking" subtitle={`(3, 3) Stake¹ ${ftsoSymbol} to earn rebase yields backed by protocol revenue`} />
<Container
style={{
paddingLeft: isSmallScreen || isVerySmallScreen ? "0" : "3.3rem",
@ -83,7 +85,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
>
<Grid container spacing={1}>
<Grid item xs={isSmallScreen ? 12 : 4}>
<Apy stnkSymbol={stnkSymbol} distribute={epoch.distribute} chainId={chainId} />
<Apy chainName={chain.name} ftsoSymbol={ftsoSymbol} distribute={epoch.distribute} chainId={chainId} />
</Grid>
<Grid item xs={isSmallScreen ? 12 : 4}>
<TotalDeposit stnkSymbol={stnkSymbol} chainId={chainId} />
@ -94,7 +96,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
</Grid>
<Divider sx={{ marginTop: "30px" }} />
<ClaimsArea chainId={chainId} address={address} chainSymbol={chainSymbol} epoch={epoch} />
<ClaimsArea chainId={chainId} address={address} chainSymbol={chain.symbol} epoch={epoch} />
<Divider />
<Box mt="15px" display="flex" flexDirection="column" alignItems="center" justifyContent="center">
@ -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¹
</PrimaryButton>
<Box textAlign="center" mt="15px">
<StakeInfoText />
</Box>
</Box>
</Paper>
<FarmPools chainId={chainId} chainSymbol={chainSymbol} />
<FarmPools chainId={chainId} chainSymbol={chain.symbol} />
</Box>
</Container>
</Box>

View File

@ -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)}`;

View File

@ -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 }) => {
<Paper fullWidth enableBackground>
<Grid container spacing={2}>
<Grid item xs={xsCalculator}>
<TreasuryMarketCap ftsoSymbol={ftsoSymbol} chainId={chainId} />
<TreasuryMarketCap nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
</Grid>
<Grid item xs={xsCalculator}>
<FatsoPrice ftsoSymbol={ftsoSymbol} chainId={chainId} />
<FatsoPrice nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
</Grid>
<Grid item xs={xsCalculator}>
<GhostPrice ghstSymbol={ghstSymbol} ftsoSymbol={ftsoSymbol} chainId={chainId} />
</Grid>
<Grid item xs={xsCalculator}>
<CirculatingSupply stnkSymbol={stnkSymbol} chainId={chainId} />
<CirculatingSupply ftsoSymbol={ftsoSymbol} chainId={chainId} />
</Grid>
<Grid item xs={xsCalculator}>
<FatsoBacking ftsoSymbol={ftsoSymbol} chainId={chainId} />
<FatsoBacking nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
</Grid>
<Grid item xs={xsCalculator}>
<CurrentIndex ftsoSymbol={ftsoSymbol} chainId={chainId} />
<CurrentIndex nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
</Grid>
</Grid>
</Paper>
@ -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 (
<>
<PageTitle name="Protocol Overview" subtitle="Confirm protocol health by monitoring supply and reserves" />
@ -90,7 +100,7 @@ const TreasuryDashboard = ({ chainId }) => {
}}
>
<Box sx={{ mt: "15px" }}>
<MetricsDashboard chainId={chainId} />
<MetricsDashboard nativeMetadata={nativeMetadata} chainId={chainId} />
</Box>
</Container>
</>

View File

@ -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);

View File

@ -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.`}
/>

View File

@ -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,