tooltips updated
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
5587b163f8
commit
5b8e34e8d0
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.8.30",
|
"version": "0.8.31",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -198,8 +198,8 @@ function App() {
|
|||||||
<Route path="/" element={<Navigate to={chainExists ? `/${chains.at(0).name.toLowerCase()}/dashboard` : "/empty"} />} />
|
<Route path="/" element={<Navigate to={chainExists ? `/${chains.at(0).name.toLowerCase()}/dashboard` : "/empty"} />} />
|
||||||
{chainExists &&
|
{chainExists &&
|
||||||
<Route path="/:network" element={<AvailableNetworkGuard allowedNetworks={chains.map(chain => chain.name.toLowerCase())} /> }>
|
<Route path="/:network" element={<AvailableNetworkGuard allowedNetworks={chains.map(chain => chain.name.toLowerCase())} /> }>
|
||||||
<Route path="dashboard" element={<TreasuryDashboard chainId={addressChainId ? addressChainId : chainId} />} />
|
<Route path="dashboard" element={<TreasuryDashboard config={config} chainId={addressChainId ? addressChainId : chainId} />} />
|
||||||
<Route path="bonds" element={<Bonds connect={tryConnectInjected} address={address} 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="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="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} />} />
|
<Route path="bridge-in" element={<BridgeIn config={config} connect={tryConnectInjected} address={address} chainId={addressChainId ? addressChainId : chainId} />} />
|
||||||
|
|||||||
@ -185,7 +185,7 @@ const NavContent = ({ chainId, addressChainId, address }) => {
|
|||||||
</AccordionDetails>
|
</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
|
<NavItem
|
||||||
defaultExpanded
|
defaultExpanded
|
||||||
icon={BondIcon}
|
icon={BondIcon}
|
||||||
@ -215,7 +215,7 @@ const NavContent = ({ chainId, addressChainId, address }) => {
|
|||||||
>
|
>
|
||||||
{bond.displayName}
|
{bond.displayName}
|
||||||
{bond.isSoldOut
|
{bond.isSoldOut
|
||||||
? <Chip label="Sold Out" template="darkGray" />
|
? <Chip label="Sold Out" template="gray" />
|
||||||
: <BondDiscount discount={bond.discount} />
|
: <BondDiscount discount={bond.discount} />
|
||||||
}
|
}
|
||||||
</Typography>
|
</Typography>
|
||||||
@ -228,7 +228,7 @@ const NavContent = ({ chainId, addressChainId, address }) => {
|
|||||||
/>
|
/>
|
||||||
<NavItem icon={ForkRightIcon} label={`${bridgeNumbers()} Bridge-In`} to={`/${chainName}/bridge-in`} />
|
<NavItem icon={ForkRightIcon} label={`${bridgeNumbers()} Bridge-In`} to={`/${chainName}/bridge-in`} />
|
||||||
<NavItem icon={RampLeftIcon} label={`${negativeBridgeNumbers()} Bridge-Out`} to={`/${chainName}/bridge-out`} />
|
<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={HistoryIcon} chipColor="warning" chip={pendingTransactions} label="Transaction History" to={`/${chainName}/history`} />
|
||||||
{/* <NavItem icon={GavelIcon} label={`Governance`} to={`/${chainName}/governance`} /> */}
|
{/* <NavItem icon={GavelIcon} label={`Governance`} to={`/${chainName}/governance`} /> */}
|
||||||
|
|
||||||
|
|||||||
@ -91,11 +91,13 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => {
|
|||||||
return () => window.removeEventListener("keydown", handleKeyDown);
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
||||||
}, [network, navigate, isSettingsOpen]);
|
}, [network, navigate, isSettingsOpen]);
|
||||||
|
|
||||||
const chainSymbol = useMemo(() => {
|
const chain = useMemo(() => {
|
||||||
const chainSymbol = config?.getClient()?.chain?.nativeCurrency?.symbol;
|
const client = config?.getClient();
|
||||||
if (chainSymbol) return chainSymbol;
|
return {
|
||||||
return "WTF";
|
symbol: client?.chain?.nativeCurrency?.symbol,
|
||||||
}, [config]);
|
name: client?.chain?.name,
|
||||||
|
}
|
||||||
|
}, [config, chainId]);
|
||||||
|
|
||||||
const preparedQuoteToken = useMemo(() => {
|
const preparedQuoteToken = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
@ -105,7 +107,7 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => {
|
|||||||
name: bond.quoteToken.name,
|
name: bond.quoteToken.name,
|
||||||
isNative: bond.quoteToken.quoteTokenAddress.toLowerCase() === WETH_ADDRESSES[chainId]?.toLowerCase(),
|
isNative: bond.quoteToken.quoteTokenAddress.toLowerCase() === WETH_ADDRESSES[chainId]?.toLowerCase(),
|
||||||
}
|
}
|
||||||
}, [bond, chainSymbol, chainId]);
|
}, [bond, chain, chainId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
@ -161,16 +163,17 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => {
|
|||||||
<MetricCollection>
|
<MetricCollection>
|
||||||
<Metric
|
<Metric
|
||||||
label={`Bond Price`}
|
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={bond.isSoldOut ? ( "--" ) : ( <BondPrice price={bond.price.inUsd} /> )}
|
||||||
/>
|
/>
|
||||||
<Metric
|
<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={<TokenPrice priceInUsd={bond.price.marketPriceInUsd} />}
|
||||||
/>
|
/>
|
||||||
<Metric
|
<Metric
|
||||||
label="Discount"
|
label="Bond Discount"
|
||||||
tooltip="Some description about what the discount is"
|
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 />}
|
metric={<BondDiscount discount={bond.discount} textOnly />}
|
||||||
/>
|
/>
|
||||||
</MetricCollection>
|
</MetricCollection>
|
||||||
@ -181,7 +184,7 @@ export const BondModal = ({ bond, chainId, address, config, connect }) => {
|
|||||||
<BondInputArea
|
<BondInputArea
|
||||||
chainId={chainId}
|
chainId={chainId}
|
||||||
bond={bond}
|
bond={bond}
|
||||||
config={config}
|
chain={chain}
|
||||||
connect={connect}
|
connect={connect}
|
||||||
address={address}
|
address={address}
|
||||||
slippage={slippage}
|
slippage={slippage}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Box, Tab, Tabs, Typography, Container, useMediaQuery } from "@mui/material";
|
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 { useParams, useLocation } from "react-router-dom";
|
||||||
import ReactGA from "react-ga4";
|
import ReactGA from "react-ga4";
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ import { useTotalReserves } from "../../hooks/treasury";
|
|||||||
import { useFtsoPrice } from "../../hooks/prices";
|
import { useFtsoPrice } from "../../hooks/prices";
|
||||||
import { useTokenSymbol } from "../../hooks/tokens";
|
import { useTokenSymbol } from "../../hooks/tokens";
|
||||||
|
|
||||||
const Bonds = ({ chainId, address, connect }) => {
|
const Bonds = ({ chainId, config, address, connect }) => {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { network } = useParams();
|
const { network } = useParams();
|
||||||
|
|
||||||
@ -29,6 +29,14 @@ const Bonds = ({ chainId, address, connect }) => {
|
|||||||
const isSmallScreen = useMediaQuery("(max-width: 650px)");
|
const isSmallScreen = useMediaQuery("(max-width: 650px)");
|
||||||
const isVerySmallScreen = useMediaQuery("(max-width: 379px)");
|
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(() => {
|
useEffect(() => {
|
||||||
ReactGA.send({ hitType: "pageview", page: location.pathname });
|
ReactGA.send({ hitType: "pageview", page: location.pathname });
|
||||||
}, [location]);
|
}, [location]);
|
||||||
@ -74,13 +82,15 @@ const Bonds = ({ chainId, address, connect }) => {
|
|||||||
>
|
>
|
||||||
<MetricCollection>
|
<MetricCollection>
|
||||||
<Metric
|
<Metric
|
||||||
label={`Treasury Balance`}
|
label={`Treasury Backing`}
|
||||||
metric={formatCurrency(totalReserves, 2)}
|
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}
|
isLoading={false}
|
||||||
/>
|
/>
|
||||||
<Metric
|
<Metric
|
||||||
label={`${ftsoSymbol} price`}
|
label={`${ftsoSymbol} Price`}
|
||||||
metric={formatCurrency(ftsoPrice, 2)}
|
metric={formatCurrency(ftsoPrice, 2)}
|
||||||
|
tooltip={`Weighted price of 1 ${ftsoSymbol} across DEXs on ${chain.name}, excluding prices from other EVMs.`}
|
||||||
isLoading={false}
|
isLoading={false}
|
||||||
/>
|
/>
|
||||||
</MetricCollection>
|
</MetricCollection>
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import { useBalance, useTokenSymbol } from "../../../hooks/tokens";
|
|||||||
|
|
||||||
const BondInputArea = ({
|
const BondInputArea = ({
|
||||||
bond,
|
bond,
|
||||||
config,
|
chain,
|
||||||
chainId,
|
chainId,
|
||||||
slippage,
|
slippage,
|
||||||
recipientAddress,
|
recipientAddress,
|
||||||
@ -43,11 +43,6 @@ const BondInputArea = ({
|
|||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const [previousPathname, setPreviousPathname] = useState(pathname);
|
const [previousPathname, setPreviousPathname] = useState(pathname);
|
||||||
|
|
||||||
const nativeSymbol = useMemo(() => {
|
|
||||||
const client = config?.getClient();
|
|
||||||
return client?.chain?.nativeCurrency?.symbol;
|
|
||||||
}, [config]);
|
|
||||||
|
|
||||||
const [wethOption, setWethOpen] = useState(false);
|
const [wethOption, setWethOpen] = useState(false);
|
||||||
const [isWrappedToken, setIsWrappedToken] = useState(false);
|
const [isWrappedToken, setIsWrappedToken] = useState(false);
|
||||||
|
|
||||||
@ -154,7 +149,7 @@ const BondInputArea = ({
|
|||||||
spendAmountValue={parsedAmount}
|
spendAmountValue={parsedAmount}
|
||||||
spendAmount={formatNumber(parsedAmount, formatDecimals)}
|
spendAmount={formatNumber(parsedAmount, formatDecimals)}
|
||||||
receiveAmount={formatNumber(amountInBaseToken, formatDecimals)}
|
receiveAmount={formatNumber(amountInBaseToken, formatDecimals)}
|
||||||
bondQuoteTokenName={selectedQuoteToken ? preparedQuoteToken.name : nativeSymbol}
|
bondQuoteTokenName={selectedQuoteToken ? preparedQuoteToken.name : chain.symbol}
|
||||||
bondQuoteTokenIcons={preparedQuoteToken.icons}
|
bondQuoteTokenIcons={preparedQuoteToken.icons}
|
||||||
bondQuoteTokenChainNames={preparedQuoteToken.chainNames}
|
bondQuoteTokenChainNames={preparedQuoteToken.chainNames}
|
||||||
isNative={selectedQuoteToken === undefined}
|
isNative={selectedQuoteToken === undefined}
|
||||||
@ -178,13 +173,13 @@ const BondInputArea = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
tokenOnClick={preparedQuoteToken.isNative ? toggleQuoteToken : undefined}
|
tokenOnClick={preparedQuoteToken.isNative ? toggleQuoteToken : undefined}
|
||||||
tokenName={selectedQuoteToken ? preparedQuoteToken.name : nativeSymbol}
|
tokenName={selectedQuoteToken ? preparedQuoteToken.name : chain.symbol}
|
||||||
info={
|
info={
|
||||||
(!isSemiSmallScreen ? "Balance: " : "") +
|
(!isSemiSmallScreen ? "Balance: " : "") +
|
||||||
formatCurrency(
|
formatCurrency(
|
||||||
balance,
|
balance,
|
||||||
formatDecimals,
|
formatDecimals,
|
||||||
selectedQuoteToken ? preparedQuoteToken.name : nativeSymbol
|
selectedQuoteToken ? preparedQuoteToken.name : chain.symbol
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
endString="Max"
|
endString="Max"
|
||||||
|
|||||||
@ -53,7 +53,7 @@ const BondSettingsModal = props => {
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box mt="32px">
|
<Box mt="32px">
|
||||||
<InputLabel htmlFor="recipient">Recipient Address</InputLabel>
|
<InputLabel htmlFor="recipient">Custom destination address</InputLabel>
|
||||||
<Box mt="8px">
|
<Box mt="8px">
|
||||||
<FormControl variant="outlined" color="primary" fullWidth>
|
<FormControl variant="outlined" color="primary" fullWidth>
|
||||||
<OutlinedInput
|
<OutlinedInput
|
||||||
@ -67,7 +67,7 @@ const BondSettingsModal = props => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Box mt="8px">
|
<Box mt="8px">
|
||||||
<Typography variant="body2" color="textSecondary">
|
<Typography variant="body2" color="textSecondary">
|
||||||
Custom recipient address of bonded assets
|
Recipient address of bonded assets
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -110,6 +110,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => {
|
|||||||
const [customReceiver, setCustomReceiver] = useState(account ? account.address : "");
|
const [customReceiver, setCustomReceiver] = useState(account ? account.address : "");
|
||||||
|
|
||||||
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
||||||
|
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
|
||||||
const { balance: ghstBalance, refetch: ghstBalanceRefetch } = useBalance(chainId, "GHST", address);
|
const { balance: ghstBalance, refetch: ghstBalanceRefetch } = useBalance(chainId, "GHST", address);
|
||||||
const { gatekeeperAddress } = useGatekeeperAddress(chainId);
|
const { gatekeeperAddress } = useGatekeeperAddress(chainId);
|
||||||
const { existentialDeposit } = useGatekeeperMinimum(chainId);
|
const { existentialDeposit } = useGatekeeperMinimum(chainId);
|
||||||
@ -307,10 +308,13 @@ const BridgeIn = ({ chainId, address, config, connect }) => {
|
|||||||
return { finalityDelay, text: `~${estimatedMins} mins` }
|
return { finalityDelay, text: `~${estimatedMins} mins` }
|
||||||
}, [chainId, networkData]);
|
}, [chainId, networkData]);
|
||||||
|
|
||||||
const nativeSymbol = useMemo(() => {
|
const chain = useMemo(() => {
|
||||||
const client = config?.getClient();
|
const client = config?.getClient();
|
||||||
return client?.chain?.nativeCurrency?.symbol;
|
return {
|
||||||
}, [config]);
|
symbol: client?.chain?.nativeCurrency?.symbol,
|
||||||
|
name: client?.chain?.name,
|
||||||
|
}
|
||||||
|
}, [config, chainId]);
|
||||||
|
|
||||||
const estimatedOutAmount = useMemo(() => {
|
const estimatedOutAmount = useMemo(() => {
|
||||||
const hundredPercent = 1000000000;
|
const hundredPercent = 1000000000;
|
||||||
@ -411,7 +415,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => {
|
|||||||
estimatedOutAmount={estimatedOutAmount}
|
estimatedOutAmount={estimatedOutAmount}
|
||||||
formatDecimals={formatDecimals}
|
formatDecimals={formatDecimals}
|
||||||
ghstSymbol={ghstSymbol}
|
ghstSymbol={ghstSymbol}
|
||||||
nativeSymbol={nativeSymbol}
|
nativeSymbol={chain.symbol}
|
||||||
externalSymbol={chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}
|
externalSymbol={chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}
|
||||||
receiver={customReceiver ? customReceiver : receiver}
|
receiver={customReceiver ? customReceiver : receiver}
|
||||||
sender={address}
|
sender={address}
|
||||||
@ -443,19 +447,19 @@ const BridgeIn = ({ chainId, address, config, connect }) => {
|
|||||||
<Metric
|
<Metric
|
||||||
metric={`${formatNumber(gatekeepedApy, 2)}%`}
|
metric={`${formatNumber(gatekeepedApy, 2)}%`}
|
||||||
label={`Stake\u00B2 APY`}
|
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
|
||||||
metric={`${formatNumber(totalStaked ? totalStaked.toString() : "0", 2)} ${chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}`}
|
metric={`${formatNumber(totalStaked ? totalStaked.toString() : "0", 2)} ${chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}`}
|
||||||
isLoading={!totalStaked}
|
isLoading={!totalStaked}
|
||||||
label="Bridge Security Stake"
|
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
|
<Metric
|
||||||
label="Block Delay"
|
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}
|
isLoading={!blockDelayMetric}
|
||||||
metric={blockDelayMetric?.text}
|
metric={blockDelayMetric?.text}
|
||||||
/>
|
/>
|
||||||
@ -497,7 +501,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => {
|
|||||||
id="from"
|
id="from"
|
||||||
token={
|
token={
|
||||||
<TokenStack
|
<TokenStack
|
||||||
chainTokenNames={[nativeSymbol]}
|
chainTokenNames={[chain.symbol]}
|
||||||
tokens={[ghstSymbol]}
|
tokens={[ghstSymbol]}
|
||||||
sx={{ fontSize: "25px", height: "30px" }}
|
sx={{ fontSize: "25px", height: "30px" }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -112,6 +112,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
|
|||||||
|
|
||||||
const { casperApi, client, account } = useUnstableProvider();
|
const { casperApi, client, account } = useUnstableProvider();
|
||||||
const { gatekeepedApy } = useGatekeeperApy(chainId);
|
const { gatekeepedApy } = useGatekeeperApy(chainId);
|
||||||
|
const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO");
|
||||||
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST");
|
||||||
const { balance: ghstBalance } = useBalance(chainId, "GHST", address);
|
const { balance: ghstBalance } = useBalance(chainId, "GHST", address);
|
||||||
const { gatekeeperAddress } = useGatekeeperAddress(chainId);
|
const { gatekeeperAddress } = useGatekeeperAddress(chainId);
|
||||||
@ -120,10 +121,13 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
|
|||||||
|
|
||||||
const { data: formatDecimals } = useStorageValue(chainId, address, DECIMALS_PREFIX, "5");
|
const { data: formatDecimals } = useStorageValue(chainId, address, DECIMALS_PREFIX, "5");
|
||||||
|
|
||||||
const nativeSymbol = useMemo(() => {
|
const chain = useMemo(() => {
|
||||||
const client = config?.getClient();
|
const client = config?.getClient();
|
||||||
return client?.chain?.nativeCurrency?.symbol;
|
return {
|
||||||
}, [config]);
|
symbol: client?.chain?.nativeCurrency?.symbol,
|
||||||
|
name: client?.chain?.name,
|
||||||
|
}
|
||||||
|
}, [config, chainId]);
|
||||||
|
|
||||||
const setFormatDecimals = useCallback((value) => {
|
const setFormatDecimals = useCallback((value) => {
|
||||||
const valueNumber = Number(value);
|
const valueNumber = Number(value);
|
||||||
@ -556,7 +560,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
|
|||||||
sender={account ? account.address : ""}
|
sender={account ? account.address : ""}
|
||||||
startGhostExodus={startGhostExodus}
|
startGhostExodus={startGhostExodus}
|
||||||
allocation={allocation}
|
allocation={allocation}
|
||||||
nativeSymbol={nativeSymbol}
|
nativeSymbol={chain.symbol}
|
||||||
/>
|
/>
|
||||||
<BridgeOutSettingsModal
|
<BridgeOutSettingsModal
|
||||||
isOpen={settingsOpen}
|
isOpen={settingsOpen}
|
||||||
@ -567,7 +571,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
|
|||||||
setReceiver={setCustomReceiver}
|
setReceiver={setCustomReceiver}
|
||||||
allocation={allocation}
|
allocation={allocation}
|
||||||
setAllocation={setAllocation}
|
setAllocation={setAllocation}
|
||||||
nativeSymbol={nativeSymbol}
|
nativeSymbol={chain.symbol}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Box mt="15px" display="flex" flexDirection="column" justifyContent="space-between" alignItems="center">
|
<Box mt="15px" display="flex" flexDirection="column" justifyContent="space-between" alignItems="center">
|
||||||
@ -592,19 +596,19 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
|
|||||||
<Metric
|
<Metric
|
||||||
metric={`${formatNumber(gatekeepedApy, 2)}%`}
|
metric={`${formatNumber(gatekeepedApy, 2)}%`}
|
||||||
label={`Stake\u00B2 APY`}
|
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
|
||||||
metric={`${formatNumber(totalStaked ? totalStaked.toString() : "0", 2)} ${chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}`}
|
metric={`${formatNumber(totalStaked ? totalStaked.toString() : "0", 2)} ${chainProperties ? chainProperties.properties.tokenSymbol : "CSPR"}`}
|
||||||
isLoading={!totalStaked}
|
isLoading={!totalStaked}
|
||||||
label="Bridge Security Stake"
|
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
|
<Metric
|
||||||
label="Bridge-Out Queue"
|
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)}
|
isLoading={!Number.isFinite(counterForExodusRequests)}
|
||||||
metric={`${formatNumber(counterForExodusRequests)} (~10 mins)`}
|
metric={`${formatNumber(counterForExodusRequests)} (~10 mins)`}
|
||||||
/>
|
/>
|
||||||
@ -666,7 +670,7 @@ const BridgeOut = ({ chainId, address, config, connect }) => {
|
|||||||
id="to"
|
id="to"
|
||||||
token={
|
token={
|
||||||
<TokenStack
|
<TokenStack
|
||||||
chainTokenNames={[nativeSymbol]}
|
chainTokenNames={[chain.symbol]}
|
||||||
tokens={[ghstSymbol]}
|
tokens={[ghstSymbol]}
|
||||||
sx={{ fontSize: "25px", height: "30px" }}
|
sx={{ fontSize: "25px", height: "30px" }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -113,11 +113,11 @@ export const BridgeOutSettingsModal = ({
|
|||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Box mt="8px">
|
<Box mt="8px">
|
||||||
<InputLabel htmlFor="recipient">Destination address</InputLabel>
|
<InputLabel htmlFor="recipient">Custom destination address</InputLabel>
|
||||||
<Box mt="8px">
|
<Box mt="8px">
|
||||||
<BridgeGhostAddressCard isEvm receiver={receiver} setReceiver={setReceiver} />
|
<BridgeGhostAddressCard isEvm receiver={receiver} setReceiver={setReceiver} />
|
||||||
<Typography mt="8px" variant="body2" color="textSecondary">
|
<Typography mt="8px" variant="body2" color="textSecondary">
|
||||||
Custom recipient address of bridged assets
|
Recipient address of bridged-out assets
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -93,11 +93,12 @@ const Exodus = ({ chainId, address, config }) => {
|
|||||||
const nativeMetadata = useMemo(() => {
|
const nativeMetadata = useMemo(() => {
|
||||||
const client = config?.getClient();
|
const client = config?.getClient();
|
||||||
return {
|
return {
|
||||||
|
name: client?.chain.name,
|
||||||
url: client?.chain?.blockExplorers?.default?.url,
|
url: client?.chain?.blockExplorers?.default?.url,
|
||||||
symbol: client?.chain?.nativeCurrency?.symbol,
|
symbol: client?.chain?.nativeCurrency?.symbol,
|
||||||
decimals: client?.chain?.nativeCurrency?.decimals,
|
decimals: client?.chain?.nativeCurrency?.decimals,
|
||||||
}
|
}
|
||||||
}, [config]);
|
}, [config, chainId]);
|
||||||
|
|
||||||
const ftsoPrice = useFtsoPrice(chainId);
|
const ftsoPrice = useFtsoPrice(chainId);
|
||||||
const reservePrice = useReservePrice(chainId);
|
const reservePrice = useReservePrice(chainId);
|
||||||
@ -229,7 +230,7 @@ const Exodus = ({ chainId, address, config }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box minHeight="calc(100vh - 43px)">
|
<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
|
<Container
|
||||||
style={{
|
style={{
|
||||||
paddingLeft: isSmallScreen || isVerySmallScreen ? "0" : "3.3rem",
|
paddingLeft: isSmallScreen || isVerySmallScreen ? "0" : "3.3rem",
|
||||||
@ -259,13 +260,13 @@ const Exodus = ({ chainId, address, config }) => {
|
|||||||
<Metric
|
<Metric
|
||||||
metric={formatCurrency(currentTwapPrice(10n ** BigInt(nativeMetadata.decimals)).mul(ftsoPrice), 2)}
|
metric={formatCurrency(currentTwapPrice(10n ** BigInt(nativeMetadata.decimals)).mul(ftsoPrice), 2)}
|
||||||
label="Exodus Price"
|
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
|
||||||
metric={formatCurrency(ftsoPrice, 2)}
|
metric={formatCurrency(ftsoPrice, 2)}
|
||||||
label={`${ftsoSymbol} Price`}
|
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
|
<Metric
|
||||||
@ -278,8 +279,8 @@ const Exodus = ({ chainId, address, config }) => {
|
|||||||
{formatNumber(executionDiscount, 2)}%
|
{formatNumber(executionDiscount, 2)}%
|
||||||
</Typography>
|
</Typography>
|
||||||
}
|
}
|
||||||
label="Discount"
|
label="Exodus Discount"
|
||||||
tooltip="some description to be added"
|
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>
|
</MetricCollection>
|
||||||
|
|
||||||
|
|||||||
@ -209,11 +209,6 @@ const BridgeInModal = ({ chainId, isOpen, close, config, historyRecord }) => {
|
|||||||
}
|
}
|
||||||
}, [functionArgs, transferInfo, chainProperties]);
|
}, [functionArgs, transferInfo, chainProperties]);
|
||||||
|
|
||||||
const estimatedFee = useMemo(() => {
|
|
||||||
if (!networkData) return null;
|
|
||||||
return networkData.incoming_share / 10000000;
|
|
||||||
}, [networkData]);
|
|
||||||
|
|
||||||
const estimatedReceived = useMemo(() => {
|
const estimatedReceived = useMemo(() => {
|
||||||
if (!networkData || !chainProperties) return null;
|
if (!networkData || !chainProperties) return null;
|
||||||
|
|
||||||
@ -444,7 +439,12 @@ const BridgeInModal = ({ chainId, isOpen, close, config, historyRecord }) => {
|
|||||||
<DataRow
|
<DataRow
|
||||||
title="GHOST Fee (Est.)"
|
title="GHOST Fee (Est.)"
|
||||||
tooltip="some description to be added."
|
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
|
<DataRow
|
||||||
|
|||||||
@ -80,7 +80,7 @@ const HistoryItem = ({
|
|||||||
return <Chip sx={{ width: width }} label={isVerySmallScreen ? "" : "Pending"} template={"gray"} />
|
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]);
|
}, [item, currentTime, isVerySmallScreen, finalityDelay]);
|
||||||
|
|
||||||
const txHashMetadata = useMemo(() => {
|
const txHashMetadata = useMemo(() => {
|
||||||
|
|||||||
@ -32,10 +32,12 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
|
|||||||
|
|
||||||
const { epoch, refetch: refetchEpoch } = useEpoch(chainId);
|
const { epoch, refetch: refetchEpoch } = useEpoch(chainId);
|
||||||
|
|
||||||
const chainSymbol = useMemo(() => {
|
const chain = useMemo(() => {
|
||||||
const chainSymbol = config?.getClient()?.chain?.nativeCurrency?.symbol;
|
const client = config?.getClient();
|
||||||
if (chainSymbol) return chainSymbol;
|
return {
|
||||||
return "WTF";
|
symbol: client?.chain?.nativeCurrency?.symbol,
|
||||||
|
name: client?.chain?.name,
|
||||||
|
}
|
||||||
}, [config, chainId])
|
}, [config, chainId])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -45,7 +47,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
|
|||||||
if (isModalOpened) {
|
if (isModalOpened) {
|
||||||
return (
|
return (
|
||||||
<Stake
|
<Stake
|
||||||
chainSymbol={chainSymbol}
|
chainSymbol={chain.symbol}
|
||||||
chainId={chainId}
|
chainId={chainId}
|
||||||
address={address}
|
address={address}
|
||||||
isOpened={isModalOpened}
|
isOpened={isModalOpened}
|
||||||
@ -57,7 +59,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<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
|
<Container
|
||||||
style={{
|
style={{
|
||||||
paddingLeft: isSmallScreen || isVerySmallScreen ? "0" : "3.3rem",
|
paddingLeft: isSmallScreen || isVerySmallScreen ? "0" : "3.3rem",
|
||||||
@ -83,7 +85,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
|
|||||||
>
|
>
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
<Grid item xs={isSmallScreen ? 12 : 4}>
|
<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>
|
||||||
<Grid item xs={isSmallScreen ? 12 : 4}>
|
<Grid item xs={isSmallScreen ? 12 : 4}>
|
||||||
<TotalDeposit stnkSymbol={stnkSymbol} chainId={chainId} />
|
<TotalDeposit stnkSymbol={stnkSymbol} chainId={chainId} />
|
||||||
@ -94,7 +96,7 @@ export const StakeContainer = ({ chainId, address, config, connect }) => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Divider sx={{ marginTop: "30px" }} />
|
<Divider sx={{ marginTop: "30px" }} />
|
||||||
<ClaimsArea chainId={chainId} address={address} chainSymbol={chainSymbol} epoch={epoch} />
|
<ClaimsArea chainId={chainId} address={address} chainSymbol={chain.symbol} epoch={epoch} />
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<Box mt="15px" display="flex" flexDirection="column" alignItems="center" justifyContent="center">
|
<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)}
|
onClick={() => handleModal(true)}
|
||||||
sx={{ maxWidth: isSemiSmallScreen ? "100%" : "350px" }}
|
sx={{ maxWidth: isSemiSmallScreen ? "100%" : "350px" }}
|
||||||
>
|
>
|
||||||
Start staking
|
Start (3, 3) Stake¹
|
||||||
</PrimaryButton>
|
</PrimaryButton>
|
||||||
<Box textAlign="center" mt="15px">
|
<Box textAlign="center" mt="15px">
|
||||||
<StakeInfoText />
|
<StakeInfoText />
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
<FarmPools chainId={chainId} chainSymbol={chainSymbol} />
|
<FarmPools chainId={chainId} chainSymbol={chain.symbol} />
|
||||||
</Box>
|
</Box>
|
||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import Metric from "../../../components/Metric/Metric";
|
import Metric from "../../../components/Metric/Metric";
|
||||||
import { formatCurrency, formatNumber } from "../../../helpers";
|
import { formatCurrency, formatNumber } from "../../../helpers";
|
||||||
|
import { bridgeNumbers } from "../../../constants";
|
||||||
|
|
||||||
import { useCurrentIndex } from "../../../hooks/staking";
|
import { useCurrentIndex } from "../../../hooks/staking";
|
||||||
import { useCirculatingSupply } from "../../../hooks/tokens";
|
import { useCirculatingSupply } from "../../../hooks/tokens";
|
||||||
@ -12,8 +13,8 @@ export const CurrentIndex = props => {
|
|||||||
|
|
||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: `Current Index`,
|
label: "Stake¹ 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.`,
|
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)}`;
|
if (currentIndex) _props.metric = `${formatNumber(currentIndex, 2)}`;
|
||||||
@ -34,8 +35,8 @@ export const Apy = props => {
|
|||||||
|
|
||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: "APY",
|
label: "Stake¹ APY",
|
||||||
tooltip: `The annualized rate of return, accounting for compounding from ${props.stnkSymbol}’s exponential rebasing.`,
|
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 ? "" : "%"}`;
|
if (apy) _props.metric = `${formatNumber(apy, 2)}${apy === Infinity ? "" : "%"}`;
|
||||||
@ -51,8 +52,8 @@ export const TotalDeposit = props => {
|
|||||||
|
|
||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: "Total Deposit",
|
label: "Total Stake¹",
|
||||||
tooltip: `Total reserves of native coins, LP tokens, and other assets in the ghostDAO treasury backing the entire circulating supply of ${props.stnkSymbol}.`,
|
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)}`;
|
if (deposit) _props.metric = `${formatCurrency(deposit, 2)}`;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import SafariFooter from "../../components/SafariFooter/SafariFooter";
|
|||||||
|
|
||||||
import { useTokenSymbol } from "../../hooks/tokens";
|
import { useTokenSymbol } from "../../hooks/tokens";
|
||||||
|
|
||||||
const MetricsDashboard = ({ chainId }) => {
|
const MetricsDashboard = ({ chainId, nativeMetadata }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const isMobileScreen = useMediaQuery("(max-width: 885px)");
|
const isMobileScreen = useMediaQuery("(max-width: 885px)");
|
||||||
const isVeryMobileScreen = useMediaQuery("(max-width: 560px)");
|
const isVeryMobileScreen = useMediaQuery("(max-width: 560px)");
|
||||||
@ -40,22 +40,22 @@ const MetricsDashboard = ({ chainId }) => {
|
|||||||
<Paper fullWidth enableBackground>
|
<Paper fullWidth enableBackground>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
<Grid item xs={xsCalculator}>
|
<Grid item xs={xsCalculator}>
|
||||||
<TreasuryMarketCap ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
<TreasuryMarketCap nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={xsCalculator}>
|
<Grid item xs={xsCalculator}>
|
||||||
<FatsoPrice ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
<FatsoPrice nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={xsCalculator}>
|
<Grid item xs={xsCalculator}>
|
||||||
<GhostPrice ghstSymbol={ghstSymbol} ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
<GhostPrice ghstSymbol={ghstSymbol} ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={xsCalculator}>
|
<Grid item xs={xsCalculator}>
|
||||||
<CirculatingSupply stnkSymbol={stnkSymbol} chainId={chainId} />
|
<CirculatingSupply ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={xsCalculator}>
|
<Grid item xs={xsCalculator}>
|
||||||
<FatsoBacking ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
<FatsoBacking nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={xsCalculator}>
|
<Grid item xs={xsCalculator}>
|
||||||
<CurrentIndex ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
<CurrentIndex nativeMetadata={nativeMetadata} ftsoSymbol={ftsoSymbol} chainId={chainId} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Paper>
|
</Paper>
|
||||||
@ -70,7 +70,7 @@ const MetricsDashboard = ({ chainId }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const TreasuryDashboard = ({ chainId }) => {
|
const TreasuryDashboard = ({ chainId, config }) => {
|
||||||
const isSmallScreen = useMediaQuery("(max-width: 650px)");
|
const isSmallScreen = useMediaQuery("(max-width: 650px)");
|
||||||
const isVerySmallScreen = useMediaQuery("(max-width: 379px)");
|
const isVerySmallScreen = useMediaQuery("(max-width: 379px)");
|
||||||
|
|
||||||
@ -80,6 +80,16 @@ const TreasuryDashboard = ({ chainId }) => {
|
|||||||
ReactGA.send({ hitType: "pageview", page: location.pathname });
|
ReactGA.send({ hitType: "pageview", page: location.pathname });
|
||||||
}, [location]);
|
}, [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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<PageTitle name="Protocol Overview" subtitle="Confirm protocol health by monitoring supply and reserves" />
|
<PageTitle name="Protocol Overview" subtitle="Confirm protocol health by monitoring supply and reserves" />
|
||||||
@ -90,7 +100,7 @@ const TreasuryDashboard = ({ chainId }) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={{ mt: "15px" }}>
|
<Box sx={{ mt: "15px" }}>
|
||||||
<MetricsDashboard chainId={chainId} />
|
<MetricsDashboard nativeMetadata={nativeMetadata} chainId={chainId} />
|
||||||
</Box>
|
</Box>
|
||||||
</Container>
|
</Container>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -14,8 +14,8 @@ export const CurrentIndex = props => {
|
|||||||
|
|
||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: `Current Index`,
|
label: "Stake¹ 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.`,
|
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}`;
|
if (currentIndex) _props.metric = `${formatNumber(currentIndex, 2)} ${props.ftsoSymbol}`;
|
||||||
@ -32,7 +32,7 @@ export const GhostPrice = props => {
|
|||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: `${props.ghstSymbol} Price`,
|
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);
|
if (ghstPrice) _props.metric = formatCurrency(ghstPrice, 2);
|
||||||
@ -47,7 +47,7 @@ export const FatsoPrice = props => {
|
|||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: `${props.ftsoSymbol} Price`,
|
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);
|
if (ftsoPrice) _props.metric = formatCurrency(ftsoPrice, 2);
|
||||||
@ -62,8 +62,8 @@ export const CirculatingSupply = props => {
|
|||||||
|
|
||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: `Circulating / Total`,
|
label: `Stake¹ / 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.`,
|
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)}`;
|
if (circulatingSupply && totalSupply) _props.metric = `${formatNumber(circulatingSupply, 0)}/${formatNumber(totalSupply, 0)}`;
|
||||||
@ -84,7 +84,7 @@ export const FatsoBacking = props => {
|
|||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: `Backing per ${props.ftsoSymbol}`,
|
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);
|
if (backing) _props.metric = formatCurrency(backing, 2);
|
||||||
@ -101,7 +101,7 @@ export const TreasuryMarketCap = props => {
|
|||||||
const _props = {
|
const _props = {
|
||||||
...props,
|
...props,
|
||||||
label: `Market Cap`,
|
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);
|
if (marketCap) _props.metric = formatCurrency(marketCap, 2);
|
||||||
|
|||||||
@ -110,7 +110,7 @@ const ProtocolDetails = ({ chainId, isMobileScreen, theme, }) => {
|
|||||||
isMobileScreen={isMobileScreen}
|
isMobileScreen={isMobileScreen}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
url={`/${networkName.toLowerCase()}/stake`}
|
url={`/${networkName.toLowerCase()}/stake`}
|
||||||
name="(3, 3) Stake"
|
name="(3, 3) Stake¹"
|
||||||
sideName={`${formatNumber(apyInner, 2)}% APY`}
|
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.`}
|
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.`}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import {
|
|||||||
BOND_DEPOSITORY_ADDRESSES,
|
BOND_DEPOSITORY_ADDRESSES,
|
||||||
DAO_TREASURY_ADDRESSES,
|
DAO_TREASURY_ADDRESSES,
|
||||||
BONDING_CALCULATOR_ADDRESSES,
|
BONDING_CALCULATOR_ADDRESSES,
|
||||||
|
WETH_ADDRESSES,
|
||||||
} from "../../constants/addresses";
|
} from "../../constants/addresses";
|
||||||
import { abi as BondAbi } from "../../abi/GhostBondDepository.json";
|
import { abi as BondAbi } from "../../abi/GhostBondDepository.json";
|
||||||
import { abi as TreasuryAbi } from "../../abi/GhostTreasury.json";
|
import { abi as TreasuryAbi } from "../../abi/GhostTreasury.json";
|
||||||
@ -27,6 +28,8 @@ import { DecimalBigNumber } from "../../helpers/DecimalBigNumber";
|
|||||||
import { shorten } from "../../helpers";
|
import { shorten } from "../../helpers";
|
||||||
import { tokenNameConverter } from "../../helpers/tokenConverter";
|
import { tokenNameConverter } from "../../helpers/tokenConverter";
|
||||||
|
|
||||||
|
const LP_SYMBOLS = ["UNI-V2", "SLP", "CAKE-LP"];
|
||||||
|
|
||||||
export const useLiveBonds = (chainId, chainName) => {
|
export const useLiveBonds = (chainId, chainName) => {
|
||||||
const { data: liveIndexesRaw, refetch: refetchLiveMarkets } = useReadContract({
|
const { data: liveIndexesRaw, refetch: refetchLiveMarkets } = useReadContract({
|
||||||
abi: BondAbi,
|
abi: BondAbi,
|
||||||
@ -256,7 +259,10 @@ export const useNotes = (chainId, address) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const quoteTokenNames = useMemo(
|
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]
|
[markets]
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -264,13 +270,19 @@ export const useNotes = (chainId, address) => {
|
|||||||
|
|
||||||
const notes = indexesFor ? indexesFor.map((noteIndex, index) => {
|
const notes = indexesFor ? indexesFor.map((noteIndex, index) => {
|
||||||
const id = Number(noteIndex);
|
const id = Number(noteIndex);
|
||||||
const quoteTokenAddress = markets?.at(index).result?.at(3) ? markets.at(index).result.at(3) : "";
|
const quoteTokenAddress = quoteTokenNames?.at(index);
|
||||||
const quoteTokenSymbol = quoteTokenSymbols?.at(index)?.result ? quoteTokenSymbols.at(index).result : "";
|
const quoteTokenSymbol = quoteTokenSymbols?.at(index)?.result
|
||||||
|
? quoteTokenSymbols.at(index).result
|
||||||
|
: "";
|
||||||
|
|
||||||
const tokenIcos = getTokenIcons(chainId, quoteTokenAddress);
|
const tokenIcos = getTokenIcons(chainId, quoteTokenAddress);
|
||||||
const isEmptyIcon = tokenIcos.length === 1 && tokenIcos.at(0) === '';
|
const isEmptyIcon = tokenIcos.length === 1 && tokenIcos.at(0) === "";
|
||||||
const quoteTokenIcons = isEmptyIcon ? ["WETH"] : tokenIcos;
|
const isLpToken = LP_SYMBOLS.includes(quoteTokenSymbol);
|
||||||
const chainNames = isEmptyIcon ? [] : getChainTokenNames(chainId, quoteTokenAddress)
|
|
||||||
|
const chainNames = isEmptyIcon ? [] : getChainTokenNames(chainId, quoteTokenAddress);
|
||||||
|
const quoteTokenIcons = isEmptyIcon
|
||||||
|
? (isLpToken ? ["WETH", "FTSO"] : ["WETH"])
|
||||||
|
: tokenIcos;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user