add/update copy

This commit is contained in:
saml33 2023-05-01 20:55:22 +10:00
commit e6e86bcf96
22 changed files with 365 additions and 146 deletions

View File

@ -3,6 +3,8 @@ import Modal from '../shared/Modal'
import { useTranslation } from 'next-i18next'
import { PerpMarket } from '@blockworks-foundation/mango-v4'
import Button from '@components/shared/Button'
import useOracleProvider from 'hooks/useOracleProvider'
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid'
// import Tooltip from '@components/shared/Tooltip'
interface PerpMarketDetailsModalProps {
@ -17,6 +19,9 @@ const PerpMarketDetailsModal = ({
market,
}: ModalCombinedProps) => {
const { t } = useTranslation(['common', 'trade'])
const { oracleProvider, oracleLinkPath } = useOracleProvider()
console.log(oracleProvider, oracleLinkPath)
return market ? (
<Modal isOpen={isOpen} onClose={onClose}>
@ -62,6 +67,22 @@ const PerpMarketDetailsModal = ({
{(100 * market.maxFunding.toNumber()).toFixed(2)}%
</p>
</div>
<div className="flex justify-between">
<p>{t('trade:oracle')}</p>
{oracleLinkPath ? (
<a
className="flex items-center"
href={oracleLinkPath}
target="_blank"
rel="noopener noreferrer"
>
<span className="mr-1.5">{oracleProvider}</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
) : (
<p className="text-th-fgd-2">{oracleProvider}</p>
)}
</div>
{/* Uncomment when insurance fund is ready */}
{/* <div className="flex justify-between">
<Tooltip

View File

@ -4,6 +4,8 @@ import { useTranslation } from 'next-i18next'
import useSelectedMarket from 'hooks/useSelectedMarket'
import { Serum3Market } from '@blockworks-foundation/mango-v4'
import Button from '@components/shared/Button'
import useOracleProvider from 'hooks/useOracleProvider'
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid'
// import useMangoGroup from 'hooks/useMangoGroup'
// import { useMemo } from 'react'
// import Tooltip from '@components/shared/Tooltip'
@ -23,6 +25,7 @@ const SpotMarketDetailsModal = ({
}: ModalCombinedProps) => {
const { t } = useTranslation(['common', 'trade'])
const { serumOrPerpMarket } = useSelectedMarket()
const { oracleProvider, oracleLinkPath } = useOracleProvider()
// const { group } = useMangoGroup()
// const [baseBank, quoteBank] = useMemo(() => {
@ -61,6 +64,22 @@ const SpotMarketDetailsModal = ({
<p>{t('trade:max-leverage')}</p>
<p className="font-mono text-th-fgd-2">5x</p>
</div>
<div className="flex justify-between">
<p>{t('trade:oracle')}</p>
{oracleLinkPath ? (
<a
className="flex items-center"
href={oracleLinkPath}
target="_blank"
rel="noopener noreferrer"
>
<span className="mr-1.5">{oracleProvider}</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
) : (
<p className="text-th-fgd-2">{oracleProvider}</p>
)}
</div>
{/* {baseMintInfo ? (
<div className="flex justify-between">
<Tooltip

View File

@ -7,7 +7,7 @@ import {
Area,
XAxis,
YAxis,
Tooltip,
Tooltip as RechartsTooltip,
ResponsiveContainer,
ReferenceLine,
} from 'recharts'
@ -29,6 +29,7 @@ import { AxisDomain } from 'recharts/types/util/types'
import { useTranslation } from 'next-i18next'
import FormatNumericValue from './FormatNumericValue'
import { ContentType } from 'recharts/types/component/Tooltip'
import Tooltip from './Tooltip'
dayjs.extend(relativeTime)
@ -48,6 +49,7 @@ interface DetailedAreaChartProps {
suffix?: string
tickFormat?: (x: number) => string
title?: string
tooltipContent?: string
xKey: string
yDecimals?: number
yKey: string
@ -78,6 +80,7 @@ const DetailedAreaChart: FunctionComponent<DetailedAreaChartProps> = ({
suffix = '',
tickFormat,
title,
tooltipContent,
xKey,
yDecimals,
yKey,
@ -135,6 +138,8 @@ const DetailedAreaChart: FunctionComponent<DetailedAreaChartProps> = ({
return 0
}
const titleClasses = `${small ? 'text-sm' : 'mb-0.5 text-base'} text-th-fgd-3`
return (
<FadeInFadeOut show={true}>
<ContentBox hideBorder hidePadding>
@ -160,13 +165,18 @@ const DetailedAreaChart: FunctionComponent<DetailedAreaChartProps> = ({
</IconButton>
) : null}
<div>
{tooltipContent ? (
<Tooltip content={tooltipContent}>
<p
className={`${
small ? 'text-sm' : 'mb-0.5 text-base'
} text-th-fgd-3`}
className={`${titleClasses}
tooltip-underline`}
>
{title}
</p>
</Tooltip>
) : (
<p className={titleClasses}>{title}</p>
)}
{mouseData ? (
<div>
<div
@ -301,7 +311,7 @@ const DetailedAreaChart: FunctionComponent<DetailedAreaChartProps> = ({
onMouseMove={handleMouseMove}
onMouseLeave={handleMouseLeave}
>
<Tooltip
<RechartsTooltip
cursor={{
strokeOpacity: 0.09,
}}

View File

@ -5,9 +5,13 @@ import { breakpoints } from '../../utils/theme'
import ContentBox from '../shared/ContentBox'
import MarketLogos from '@components/trade/MarketLogos'
import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements'
import { ChevronDownIcon } from '@heroicons/react/20/solid'
import {
ArrowTopRightOnSquareIcon,
ChevronDownIcon,
} from '@heroicons/react/20/solid'
// import Tooltip from '@components/shared/Tooltip'
import { Disclosure, Transition } from '@headlessui/react'
import { getOracleProvider } from 'hooks/useOracleProvider'
const PerpMarketSettingsTable = () => {
const { t } = useTranslation(['common', 'trade'])
@ -28,6 +32,7 @@ const PerpMarketSettingsTable = () => {
<Th className="text-right">{t('trade:max-leverage')}</Th>
<Th className="text-right">{t('fees')}</Th>
<Th className="text-right">{t('trade:funding-limits')}</Th>
<Th className="text-right">{t('trade:oracle')}</Th>
{/* Uncomment when insurance fund is ready */}
{/* <Th className="text-right">
<Tooltip
@ -56,6 +61,8 @@ const PerpMarketSettingsTable = () => {
publicKey,
} = market
const [oracleProvider, oracleLinkPath] = getOracleProvider(market)
return (
<TrBody key={publicKey.toString()}>
<Td>
@ -100,6 +107,23 @@ const PerpMarketSettingsTable = () => {
{(100 * maxFunding.toNumber()).toFixed(2)}%
</p>
</Td>
<Td>
{oracleLinkPath ? (
<a
className="flex items-center justify-end"
href={oracleLinkPath}
target="_blank"
rel="noopener noreferrer"
>
<span className="mr-1.5 font-body">
{oracleProvider}
</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
) : (
<p className="text-right font-body">{oracleProvider}</p>
)}
</Td>
{/* <Td>
<p className="text-right">
{groupInsuranceFund ? t('yes') : t('no')}
@ -112,7 +136,7 @@ const PerpMarketSettingsTable = () => {
</Table>
) : (
<div className="border-b border-th-bkg-3">
{perpMarkets.map((market) => {
{perpMarkets.map((market, i) => {
const {
name,
minOrderSize,
@ -126,12 +150,15 @@ const PerpMarketSettingsTable = () => {
maxFunding,
publicKey,
} = market
const [oracleProvider, oracleLinkPath] = getOracleProvider(market)
return (
<Disclosure key={publicKey.toString()}>
{({ open }) => (
<>
<Disclosure.Button
className={`w-full border-t border-th-bkg-3 p-4 text-left focus:outline-none`}
className={`w-full border-t border-th-bkg-3 p-4 text-left focus:outline-none ${
i === 0 ? 'border-t-0' : ''
}`}
>
<div className="flex items-center justify-between">
<div className="flex items-center">
@ -220,6 +247,26 @@ const PerpMarketSettingsTable = () => {
{(100 * maxFunding.toNumber()).toFixed(2)}%
</p>
</div>
<div className="col-span-1">
<p className="text-xs">{t('trade:oracle')}</p>
{oracleLinkPath ? (
<a
className="flex items-center"
href={oracleLinkPath}
target="_blank"
rel="noopener noreferrer"
>
<span className="mr-1.5 font-body">
{oracleProvider}
</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
) : (
<p className="text-right font-body">
{oracleProvider}
</p>
)}
</div>
{/* <div className="col-span-1">
<Tooltip
content={t('trade:tooltip-insured', {

View File

@ -34,12 +34,14 @@ const StatsPage = () => {
const tabsWithCount: [string, number][] = useMemo(() => {
return TABS.map((t) => [t, 0])
}, [])
return market ? (
return (
<div className="pb-20 md:pb-16">
{market ? (
<PerpStatsPage />
) : token ? (
<TokenPage />
) : (
<div className="pb-20 md:pb-16">
<>
<div className="border-b border-th-bkg-3">
<TabButtons
activeValue={activeTab}
@ -50,6 +52,8 @@ const StatsPage = () => {
/>
</div>
<TabContent activeTab={activeTab} />
</>
)}
</div>
)
}

View File

@ -1,5 +1,6 @@
import { Disclosure, Transition } from '@headlessui/react'
import {
ArrowTopRightOnSquareIcon,
ChevronDownIcon,
QuestionMarkCircleIcon,
} from '@heroicons/react/20/solid'
@ -14,9 +15,10 @@ import useJupiterMints from 'hooks/useJupiterMints'
import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements'
import useMangoGroup from 'hooks/useMangoGroup'
import useBanksWithBalances from 'hooks/useBanksWithBalances'
import { getOracleProvider } from 'hooks/useOracleProvider'
const TokenSettingsTable = () => {
const { t } = useTranslation(['common', 'activity', 'token'])
const { t } = useTranslation(['common', 'activity', 'token', 'trade'])
const { group } = useMangoGroup()
const { mangoTokens } = useJupiterMints()
const { width } = useViewport()
@ -42,6 +44,7 @@ const TokenSettingsTable = () => {
</Th>
<Th className="text-right">{t('borrow-fee')}</Th>
<Th className="text-right">{t('activity:liquidation-fee')}</Th>
<Th className="text-right">{t('trade:oracle')}</Th>
{/* Uncomment when insurance fund is ready */}
{/* <Th className="text-right">
<Tooltip
@ -65,6 +68,8 @@ const TokenSettingsTable = () => {
)?.logoURI
}
const [oracleProvider, oracleLinkPath] = getOracleProvider(bank)
// const mintInfo = group.mintInfosMapByMint.get(
// bank.mint.toString()
// )
@ -108,6 +113,23 @@ const TokenSettingsTable = () => {
{(bank.liquidationFee.toNumber() * 100).toFixed(2)}%
</p>
</Td>
<Td>
{oracleLinkPath ? (
<a
className="flex items-center justify-end"
href={oracleLinkPath}
target="_blank"
rel="noopener noreferrer"
>
<span className="mr-1.5 font-body">
{oracleProvider}
</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
) : (
<p className="text-right font-body">{oracleProvider}</p>
)}
</Td>
{/* <Td>
<p className="text-right">
{mintInfo?.groupInsuranceFund ? t('yes') : t('no')}
@ -129,6 +151,7 @@ const TokenSettingsTable = () => {
(t) => t.address === bank.mint.toString()
)?.logoURI
}
const [oracleProvider, oracleLinkPath] = getOracleProvider(bank)
// const mintInfo = group.mintInfosMapByMint.get(
// bank.mint.toString()
// )
@ -207,6 +230,26 @@ const TokenSettingsTable = () => {
%
</p>
</div>
<div className="col-span-1">
<p className="text-xs">{t('trade:oracle')}</p>
{oracleLinkPath ? (
<a
className="flex items-center"
href={oracleLinkPath}
target="_blank"
rel="noopener noreferrer"
>
<span className="mr-1.5 font-body">
{oracleProvider}
</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
) : (
<p className="text-right font-body">
{oracleProvider}
</p>
)}
</div>
</div>
</Disclosure.Panel>
</Transition>

View File

@ -154,6 +154,7 @@ const TokenStatsCharts = () => {
prefix="$"
tickFormat={(x) => `$${formatYAxis(x)}`}
title={t('token:token-fees-collected')}
tooltipContent={t('token:tooltip-token-fees-collected')}
xKey="date"
yKey={'feesCollected'}
/>

View File

@ -165,7 +165,7 @@ const CoingeckoStats = ({
<div className="col-span-1 border-y border-th-bkg-3 px-6 py-4 md:col-span-2">
<h2 className="text-base">{bank.name} Stats</h2>
</div>
<div className="col-span-1 border-r border-th-bkg-3 px-6 py-4">
<div className="col-span-1 px-6 py-4 md:border-r md:border-th-bkg-3">
<div className="flex justify-between pb-4">
<p>{t('token:market-cap')}</p>
<p className="font-mono text-th-fgd-2">

View File

@ -1,42 +1,29 @@
import {
Bank,
I80F48,
OracleProvider,
toUiDecimals,
toUiDecimalsForQuote,
} from '@blockworks-foundation/mango-v4'
import Tooltip from '@components/shared/Tooltip'
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid'
import { BN } from '@project-serum/anchor'
import { getOracleProvider } from 'hooks/useOracleProvider'
import { useTranslation } from 'next-i18next'
import { useMemo } from 'react'
import { formatCurrencyValue, formatNumericValue } from 'utils/numbers'
import { formatCurrencyValue } from 'utils/numbers'
const TokenParams = ({ bank }: { bank: Bank }) => {
const { t } = useTranslation(['common', 'activity', 'token'])
const [oracleProvider, oracleLinkPath] = useMemo(() => {
switch (bank.oracleProvider) {
case OracleProvider.Pyth:
return [
'Pyth',
`https://pyth.network/price-feeds/crypto-${bank.name.toLowerCase()}-usd`,
]
case OracleProvider.Switchboard:
return [
'Switchboard',
`https://switchboard.xyz/explorer/3/${bank.oracle.toString()}`,
]
case OracleProvider.Stub:
return ['Stub', '']
default:
return ['Unknown', '']
}
if (!bank) return ['Unavaliable', '']
return getOracleProvider(bank)
}, [bank])
return (
<div className="grid grid-cols-1 border-b border-th-bkg-3 md:grid-cols-2">
<div className="col-span-1 border-b border-th-bkg-3 px-6 py-4 md:col-span-2">
<h2 className="text-base">{bank.name} Paramaters</h2>
<h2 className="text-base">{`${bank.name} ${t('token:parameters')}`}</h2>
</div>
<div className="col-span-1 px-6 py-4 md:border-r md:border-th-bkg-3">
<div className="flex justify-between pb-4">
@ -76,8 +63,8 @@ const TokenParams = ({ bank }: { bank: Bank }) => {
</p>
</div>
<div className="flex justify-between border-t border-th-bkg-3 py-4">
<Tooltip content={t('token:tooltip-borrow-upkeep-fee')}>
<p className="tooltip-underline">{t('token:borrow-upkeep-fee')}</p>
<Tooltip content={t('token:tooltip-borrow-upkeep-rate')}>
<p className="tooltip-underline">{t('token:borrow-upkeep-rate')}</p>
</Tooltip>
<p className="font-mono text-th-fgd-2">
{(100 * bank.loanFeeRate.toNumber()).toFixed(2)}%
@ -116,14 +103,25 @@ const TokenParams = ({ bank }: { bank: Bank }) => {
</div>
<div className="col-span-1 px-6 pb-4 md:pt-4">
<div className="flex justify-between pb-4">
<Tooltip content={t('token:tooltip-net-borrow-period')}>
<p className="tooltip-underline">{t('token:net-borrow-period')}</p>
</Tooltip>
<p className="font-mono text-th-fgd-2">
{bank.netBorrowLimitWindowSizeTs.div(new BN(3600)).toNumber()}hrs
</p>
</div>
<div className="flex justify-between border-t border-th-bkg-3 py-4">
<Tooltip content={t('token:tooltip-net-borrows-in-period')}>
<p className="tooltip-underline">
{t('token:net-borrows-in-period')}
</p>
</Tooltip>
<p className="font-mono text-th-fgd-2">
{formatNumericValue(
toUiDecimalsForQuote(I80F48.fromI64(bank.netBorrowsInWindow))
{formatCurrencyValue(
toUiDecimalsForQuote(
I80F48.fromI64(bank.netBorrowsInWindow).toNumber() *
bank.uiPrice
)
)}
</p>
</div>
@ -134,7 +132,7 @@ const TokenParams = ({ bank }: { bank: Bank }) => {
</p>
</Tooltip>
<p className="font-mono text-th-fgd-2">
{formatNumericValue(
{formatCurrencyValue(
toUiDecimals(bank.netBorrowLimitPerWindowQuote, 6)
)}
</p>
@ -147,7 +145,7 @@ const TokenParams = ({ bank }: { bank: Bank }) => {
target="_blank"
rel="noopener noreferrer"
>
<p className="mr-1.5 text-th-fgd-2">{oracleProvider}</p>
<span className="mr-1.5">{oracleProvider}</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
</div>
@ -172,14 +170,6 @@ const TokenParams = ({ bank }: { bank: Bank }) => {
<span className="font-body text-th-fgd-4">Slots</span>
</p>
</div>
<div className="flex justify-between border-t border-th-bkg-3 py-4">
<Tooltip content={t('token:tooltip-insurance-rate-curve')}>
<p className="tooltip-underline">
{t('token:insurance-rate-curve')}
</p>
</Tooltip>
<p className="font-mono text-th-fgd-2">?</p>
</div>
</div>
</div>
)

View File

@ -7,11 +7,7 @@ import Tooltip from '@components/shared/Tooltip'
import { useTranslation } from 'next-i18next'
import mangoStore from '@store/mangoStore'
import { useEffect, useState } from 'react'
import {
PerpMarket,
Bank,
OracleProvider,
} from '@blockworks-foundation/mango-v4'
import { PerpMarket, Bank } from '@blockworks-foundation/mango-v4'
import { BorshAccountsCoder } from '@coral-xyz/anchor'
import {
floorToDecimal,
@ -21,6 +17,8 @@ import {
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
import relativeTime from 'dayjs/plugin/relativeTime'
import useOracleProvider from 'hooks/useOracleProvider'
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid'
const OraclePrice = ({
setChangePrice,
@ -38,10 +36,10 @@ const OraclePrice = ({
const connection = mangoStore((s) => s.connection)
const [price, setPrice] = useState(stalePrice)
const [oracleProviderName, setOracleProviderName] = useState('Unknown')
const [oracleLastUpdatedSlot, setOracleLastUpdatedSlot] = useState(0)
const [highestSlot, setHighestSlot] = useState(0)
const [isStale, setIsStale] = useState(false)
const { oracleProvider, oracleLinkPath } = useOracleProvider()
const { t } = useTranslation(['common', 'trade'])
@ -64,20 +62,6 @@ const OraclePrice = ({
decimals = group.getMintDecimals(baseBank.mint)
}
switch (marketOrBank.oracleProvider) {
case OracleProvider.Pyth:
setOracleProviderName('Pyth')
break
case OracleProvider.Switchboard:
setOracleProviderName('Switchboard')
break
case OracleProvider.Stub:
setOracleProviderName('Stub')
break
default:
setOracleProviderName('Unknown')
}
const coder = new BorshAccountsCoder(client.program.idl)
const subId = connection.onAccountChange(
marketOrBank.oracle,
@ -147,8 +131,21 @@ const OraclePrice = ({
placement="bottom"
content={
<>
<div>
{t('trade:price-provided-by')} {oracleProviderName}.
<div className="flex">
<span className="mr-1">{t('trade:price-provided-by')}</span>
{oracleLinkPath ? (
<a
href={oracleLinkPath}
target="_blank"
rel="noopener noreferrer"
className="flex items-center"
>
<span className="mr-1">{oracleProvider}</span>
<ArrowTopRightOnSquareIcon className="h-4 w-4" />
</a>
) : (
<span className="text-th-fgd-2">{oracleProvider}</span>
)}
</div>
<div className="mt-2">
{t('trade:last-updated')}{' '}

View File

@ -0,0 +1,62 @@
import {
Bank,
OracleProvider,
PerpMarket,
Serum3Market,
} from '@blockworks-foundation/mango-v4'
import mangoStore from '@store/mangoStore'
import { useMemo } from 'react'
import { formatTokenSymbol } from 'utils/tokens'
import useSelectedMarket from './useSelectedMarket'
export const getOracleProvider = (
marketOrBank: PerpMarket | Serum3Market | Bank
) => {
let marketOrBase: PerpMarket | Bank
let name: string
if (marketOrBank instanceof Bank) {
marketOrBase = marketOrBank
name = formatTokenSymbol(marketOrBank.name)
} else if (marketOrBank instanceof PerpMarket) {
marketOrBase = marketOrBank
name = marketOrBank.name.split('-')[0]
} else {
const group = mangoStore.getState().group
if (!group) return ['Unavailable', '']
const baseBank = group.getFirstBankByTokenIndex(marketOrBank.baseTokenIndex)
marketOrBase = baseBank
name = formatTokenSymbol(baseBank.name)
}
if (name === 'USDC') return ['N/A', '']
switch (marketOrBase.oracleProvider) {
case OracleProvider.Pyth:
return [
'Pyth',
`https://pyth.network/price-feeds/crypto-${name.toLowerCase()}-usd`,
]
case OracleProvider.Switchboard:
return [
'Switchboard',
`https://switchboard.xyz/explorer/3/${marketOrBase.oracle.toString()}`,
]
case OracleProvider.Stub:
return ['Stub', '']
default:
return ['Unknown', '']
}
}
const useOracleProvider = () => {
const { selectedMarket } = useSelectedMarket()
const [oracleProvider, oracleLinkPath] = useMemo(() => {
if (!selectedMarket) return ['', '']
return getOracleProvider(selectedMarket)
}, [selectedMarket])
return { oracleProvider, oracleLinkPath }
}
export default useOracleProvider

View File

@ -4,7 +4,7 @@
"borrowing": "Borrowing",
"borrows": "Borrows",
"borrow-rates": "Borrow Rates",
"borrow-upkeep-fee": "Borrow Upkeep Fee",
"borrow-upkeep-rate": "Borrow Upkeep Rate",
"chart-unavailable": "Chart Unavailable",
"circulating-supply": "Circulating Supply",
"deposit-borrow-scaling-start": "Deposit/Borrow Scaling Start",
@ -20,26 +20,30 @@
"market-cap": "Market Cap",
"max-supply": "Max Supply",
"net-borrow-limit-in-period": "Net Borrow Limit in Period",
"net-borrow-period": "Net Borrow Period",
"net-borrows-in-period": "Net Borrows in Period",
"no-borrowers": "No Borrowers...",
"no-depositors": "No Depositors...",
"oracle": "Oracle",
"oracle-confidence": "Oracle Confidence",
"oracle-staleness": "Oracle Staleness",
"parameters": "Parameters",
"token-details": "Token Details",
"token-fees-collected": "Token Fees Collected (M2M)",
"token-fees-collected": "Token Fees Collected",
"token-not-found": "Token Not Found",
"token-not-found-desc": "'{{token}}' is either not listed or we're having issues loading the data.",
"tooltip-borrow-upkeep-fee": "",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for opening new positions is scaled down. For borrows, the liability weight for opening new positions is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight increases health and liability weight reduces it. Initial health affects your ability to withdraw and open new positions and is reflected by the amount of free collateral in your account.",
"tooltip-insurance-rate-curve": "",
"tooltip-borrow-upkeep-rate": "The yearly rate paid to the DAO on open borrows. This is included in the displayed borrow interest rate.",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for deposits is scaled down. For borrows, the liability weight for borrows is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Initial health controls your ability to withdraw and open new positions and is shown as an account's free collateral.",
"tooltip-insurance-rate-curve": "Interest rates are dependent on token utilization. The more tokens that are lent out the higher the rate. The curve scales up and down with long term trends in utilization.",
"tooltip-liquidation-fee": "The fee paid to liqudators when {{symbol}} is liquidated.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your account health. Asset weight increases health and liability weight reduces it. Maintance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-limit-in-period": "",
"tooltip-net-borrows-in-period": "",
"tooltip-oracle-confidence": "How much variation from the true price is tolerated.",
"tooltip-oracle-staleness": "Price is considered valid when it is last udpated within {{slots}} slots.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your maintenance account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Maintenance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-period": "As a safety feature, the amount of new borrows is limited. The limit resets at regular periods. This is the amount of time between resets.",
"tooltip-net-borrow-limit-in-period": "Value of allowed net borrows. Once this value is reached, new borrows will be forbidden until the end of the period.",
"tooltip-net-borrows-in-period": "Current value of net borrows in this period.",
"tooltip-oracle-confidence": "Oracles work by aggregating multiple price sources. If these sources disagree too much, confidence will be low. If it's below this threshold, the price is considered invalid.",
"tooltip-oracle-staleness": "Price is considered valid when it is last updated within {{slots}} slots.",
"tooltip-token-fees-collected": "These fees accrue in every native token listed on Mango. The values in this chart are derived from the current market value.",
"top-borrowers": "Top {{symbol}} Borrowers",
"top-depositors": "Top {{symbol}} Depositors",
"total-supply": "Total Supply",

View File

@ -41,6 +41,7 @@
"notional": "Notional",
"notional-volume": "Notional Volume ($)",
"open-interest": "Open Interest",
"oracle": "Oracle",
"oracle-not-updated": "This oracle has not updated recently.",
"oracle-not-updated-warning": "Actions will fail for accounts with a position in this token.",
"oracle-price": "Oracle Price",
@ -54,7 +55,7 @@
"post": "Post",
"preview-sound": "Preview Sound",
"price-expect": "The price you receive may be worse than you expect and full execution is not guaranteed. Max slippage is 2.5% for your safety. The part of your position with slippage beyond 2.5% will not be closed.",
"price-provided-by": "This price is provided by",
"price-provided-by": "Oracle by",
"quote": "Quote",
"reduce-only": "Reduce Only",
"sells": "Sells",

View File

@ -4,7 +4,7 @@
"borrowing": "Borrowing",
"borrows": "Borrows",
"borrow-rates": "Borrow Rates",
"borrow-upkeep-fee": "Borrow Upkeep Fee",
"borrow-upkeep-rate": "Borrow Upkeep Rate",
"chart-unavailable": "Chart Unavailable",
"circulating-supply": "Circulating Supply",
"deposit-borrow-scaling-start": "Deposit/Borrow Scaling Start",
@ -20,26 +20,30 @@
"market-cap": "Market Cap",
"max-supply": "Max Supply",
"net-borrow-limit-in-period": "Net Borrow Limit in Period",
"net-borrow-period": "Net Borrow Period",
"net-borrows-in-period": "Net Borrows in Period",
"no-borrowers": "No Borrowers...",
"no-depositors": "No Depositors...",
"oracle": "Oracle",
"oracle-confidence": "Oracle Confidence",
"oracle-staleness": "Oracle Staleness",
"parameters": "Parameters",
"token-details": "Token Details",
"token-fees-collected": "Token Fees Collected (M2M)",
"token-fees-collected": "Token Fees Collected",
"token-not-found": "Token Not Found",
"token-not-found-desc": "'{{token}}' is either not listed or we're having issues loading the data.",
"tooltip-borrow-upkeep-fee": "",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for opening new positions is scaled down. For borrows, the liability weight for opening new positions is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight increases health and liability weight reduces it. Initial health affects your ability to withdraw and open new positions and is reflected by the amount of free collateral in your account.",
"tooltip-insurance-rate-curve": "",
"tooltip-borrow-upkeep-rate": "The yearly rate paid to the DAO on open borrows. This is included in the displayed borrow interest rate.",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for deposits is scaled down. For borrows, the liability weight for borrows is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Initial health controls your ability to withdraw and open new positions and is shown as an account's free collateral.",
"tooltip-insurance-rate-curve": "Interest rates are dependent on token utilization. The more tokens that are lent out the higher the rate. The curve scales up and down with long term trends in utilization.",
"tooltip-liquidation-fee": "The fee paid to liqudators when {{symbol}} is liquidated.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your account health. Asset weight increases health and liability weight reduces it. Maintance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-limit-in-period": "",
"tooltip-net-borrows-in-period": "",
"tooltip-oracle-confidence": "How much variation from the true price is tolerated.",
"tooltip-oracle-staleness": "Price is considered valid when it is last udpated within {{slots}} slots.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your maintenance account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Maintenance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-period": "As a safety feature, the amount of new borrows is limited. The limit resets at regular periods. This is the amount of time between resets.",
"tooltip-net-borrow-limit-in-period": "Value of allowed net borrows. Once this value is reached, new borrows will be forbidden until the end of the period.",
"tooltip-net-borrows-in-period": "Current value of net borrows in this period.",
"tooltip-oracle-confidence": "Oracles work by aggregating multiple price sources. If these sources disagree too much, confidence will be low. If it's below this threshold, the price is considered invalid.",
"tooltip-oracle-staleness": "Price is considered valid when it is last updated within {{slots}} slots.",
"tooltip-token-fees-collected": "These fees accrue in every native token listed on Mango. The values in this chart are derived from the current market value.",
"top-borrowers": "Top {{symbol}} Borrowers",
"top-depositors": "Top {{symbol}} Depositors",
"total-supply": "Total Supply",

View File

@ -41,6 +41,7 @@
"notional": "Notional",
"notional-volume": "Notional Volume ($)",
"open-interest": "Open Interest",
"oracle": "Oracle",
"oracle-not-updated": "This oracle has not updated recently.",
"oracle-not-updated-warning": "Actions will fail for accounts with a position in this token.",
"oracle-price": "Oracle Price",
@ -54,7 +55,7 @@
"post": "Post",
"preview-sound": "Preview Sound",
"price-expect": "The price you receive may be worse than you expect and full execution is not guaranteed. Max slippage is 2.5% for your safety. The part of your position with slippage beyond 2.5% will not be closed.",
"price-provided-by": "This price is provided by",
"price-provided-by": "Oracle by",
"quote": "Quote",
"reduce-only": "Reduce Only",
"sells": "Sells",

View File

@ -4,7 +4,7 @@
"borrowing": "Borrowing",
"borrows": "Borrows",
"borrow-rates": "Borrow Rates",
"borrow-upkeep-fee": "Borrow Upkeep Fee",
"borrow-upkeep-rate": "Borrow Upkeep Rate",
"chart-unavailable": "Chart Unavailable",
"circulating-supply": "Circulating Supply",
"deposit-borrow-scaling-start": "Deposit/Borrow Scaling Start",
@ -20,26 +20,30 @@
"market-cap": "Market Cap",
"max-supply": "Max Supply",
"net-borrow-limit-in-period": "Net Borrow Limit in Period",
"net-borrow-period": "Net Borrow Period",
"net-borrows-in-period": "Net Borrows in Period",
"no-borrowers": "No Borrowers...",
"no-depositors": "No Depositors...",
"oracle": "Oracle",
"oracle-confidence": "Oracle Confidence",
"oracle-staleness": "Oracle Staleness",
"parameters": "Parameters",
"token-details": "Token Details",
"token-fees-collected": "Token Fees Collected (M2M)",
"token-fees-collected": "Token Fees Collected",
"token-not-found": "Token Not Found",
"token-not-found-desc": "'{{token}}' is either not listed or we're having issues loading the data.",
"tooltip-borrow-upkeep-fee": "",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for opening new positions is scaled down. For borrows, the liability weight for opening new positions is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight increases health and liability weight reduces it. Initial health affects your ability to withdraw and open new positions and is reflected by the amount of free collateral in your account.",
"tooltip-insurance-rate-curve": "",
"tooltip-borrow-upkeep-rate": "The yearly rate paid to the DAO on open borrows. This is included in the displayed borrow interest rate.",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for deposits is scaled down. For borrows, the liability weight for borrows is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Initial health controls your ability to withdraw and open new positions and is shown as an account's free collateral.",
"tooltip-insurance-rate-curve": "Interest rates are dependent on token utilization. The more tokens that are lent out the higher the rate. The curve scales up and down with long term trends in utilization.",
"tooltip-liquidation-fee": "The fee paid to liqudators when {{symbol}} is liquidated.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your account health. Asset weight increases health and liability weight reduces it. Maintance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-limit-in-period": "",
"tooltip-net-borrows-in-period": "",
"tooltip-oracle-confidence": "How much variation from the true price is tolerated.",
"tooltip-oracle-staleness": "Price is considered valid when it is last udpated within {{slots}} slots.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your maintenance account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Maintenance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-period": "As a safety feature, the amount of new borrows is limited. The limit resets at regular periods. This is the amount of time between resets.",
"tooltip-net-borrow-limit-in-period": "Value of allowed net borrows. Once this value is reached, new borrows will be forbidden until the end of the period.",
"tooltip-net-borrows-in-period": "Current value of net borrows in this period.",
"tooltip-oracle-confidence": "Oracles work by aggregating multiple price sources. If these sources disagree too much, confidence will be low. If it's below this threshold, the price is considered invalid.",
"tooltip-oracle-staleness": "Price is considered valid when it is last updated within {{slots}} slots.",
"tooltip-token-fees-collected": "These fees accrue in every native token listed on Mango. The values in this chart are derived from the current market value.",
"top-borrowers": "Top {{symbol}} Borrowers",
"top-depositors": "Top {{symbol}} Depositors",
"total-supply": "Total Supply",

View File

@ -41,6 +41,7 @@
"notional": "Notional",
"notional-volume": "Notional Volume ($)",
"open-interest": "Open Interest",
"oracle": "Oracle",
"oracle-not-updated": "This oracle has not updated recently.",
"oracle-not-updated-warning": "Actions will fail for accounts with a position in this token.",
"oracle-price": "Oracle Price",
@ -54,7 +55,7 @@
"post": "Post",
"preview-sound": "Preview Sound",
"price-expect": "The price you receive may be worse than you expect and full execution is not guaranteed. Max slippage is 2.5% for your safety. The part of your position with slippage beyond 2.5% will not be closed.",
"price-provided-by": "This price is provided by",
"price-provided-by": "Oracle by",
"quote": "Quote",
"reduce-only": "Reduce Only",
"sells": "Sells",

View File

@ -4,7 +4,7 @@
"borrowing": "Borrowing",
"borrows": "Borrows",
"borrow-rates": "Borrow Rates",
"borrow-upkeep-fee": "Borrow Upkeep Fee",
"borrow-upkeep-rate": "Borrow Upkeep Rate",
"chart-unavailable": "Chart Unavailable",
"circulating-supply": "Circulating Supply",
"deposit-borrow-scaling-start": "Deposit/Borrow Scaling Start",
@ -20,26 +20,30 @@
"market-cap": "Market Cap",
"max-supply": "Max Supply",
"net-borrow-limit-in-period": "Net Borrow Limit in Period",
"net-borrow-period": "Net Borrow Period",
"net-borrows-in-period": "Net Borrows in Period",
"no-borrowers": "No Borrowers...",
"no-depositors": "No Depositors...",
"oracle": "Oracle",
"oracle-confidence": "Oracle Confidence",
"oracle-staleness": "Oracle Staleness",
"parameters": "Parameters",
"token-details": "Token Details",
"token-fees-collected": "Token Fees Collected (M2M)",
"token-fees-collected": "Token Fees Collected",
"token-not-found": "Token Not Found",
"token-not-found-desc": "'{{token}}' is either not listed or we're having issues loading the data.",
"tooltip-borrow-upkeep-fee": "",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for opening new positions is scaled down. For borrows, the liability weight for opening new positions is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight increases health and liability weight reduces it. Initial health affects your ability to withdraw and open new positions and is reflected by the amount of free collateral in your account.",
"tooltip-insurance-rate-curve": "",
"tooltip-borrow-upkeep-rate": "The yearly rate paid to the DAO on open borrows. This is included in the displayed borrow interest rate.",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for deposits is scaled down. For borrows, the liability weight for borrows is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Initial health controls your ability to withdraw and open new positions and is shown as an account's free collateral.",
"tooltip-insurance-rate-curve": "Interest rates are dependent on token utilization. The more tokens that are lent out the higher the rate. The curve scales up and down with long term trends in utilization.",
"tooltip-liquidation-fee": "The fee paid to liqudators when {{symbol}} is liquidated.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your account health. Asset weight increases health and liability weight reduces it. Maintance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-limit-in-period": "",
"tooltip-net-borrows-in-period": "",
"tooltip-oracle-confidence": "How much variation from the true price is tolerated.",
"tooltip-oracle-staleness": "Price is considered valid when it is last udpated within {{slots}} slots.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your maintenance account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Maintenance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-period": "As a safety feature, the amount of new borrows is limited. The limit resets at regular periods. This is the amount of time between resets.",
"tooltip-net-borrow-limit-in-period": "Value of allowed net borrows. Once this value is reached, new borrows will be forbidden until the end of the period.",
"tooltip-net-borrows-in-period": "Current value of net borrows in this period.",
"tooltip-oracle-confidence": "Oracles work by aggregating multiple price sources. If these sources disagree too much, confidence will be low. If it's below this threshold, the price is considered invalid.",
"tooltip-oracle-staleness": "Price is considered valid when it is last updated within {{slots}} slots.",
"tooltip-token-fees-collected": "These fees accrue in every native token listed on Mango. The values in this chart are derived from the current market value.",
"top-borrowers": "Top {{symbol}} Borrowers",
"top-depositors": "Top {{symbol}} Depositors",
"total-supply": "Total Supply",

View File

@ -41,6 +41,7 @@
"notional": "Notional",
"notional-volume": "Notional Volume ($)",
"open-interest": "Open Interest",
"oracle": "Oracle",
"oracle-not-updated": "This oracle has not updated recently.",
"oracle-not-updated-warning": "Actions will fail for accounts with a position in this token.",
"oracle-price": "Oracle Price",
@ -54,7 +55,7 @@
"post": "Post",
"preview-sound": "Preview Sound",
"price-expect": "The price you receive may be worse than you expect and full execution is not guaranteed. Max slippage is 2.5% for your safety. The part of your position with slippage beyond 2.5% will not be closed.",
"price-provided-by": "This price is provided by",
"price-provided-by": "Oracle by",
"quote": "Quote",
"reduce-only": "Reduce Only",
"sells": "Sells",

View File

@ -2,7 +2,7 @@
"all-time-high": "歷史高價",
"all-time-low": "歷史低價",
"borrow-rates": "借貸利率",
"borrow-upkeep-fee": "Borrow Upkeep Fee",
"borrow-upkeep-rate": "Borrow Upkeep Fee",
"borrowing": "借入",
"borrows": "借貸",
"chart-unavailable": "無法顯示圖表",
@ -20,26 +20,30 @@
"market-cap": "總市值",
"max-supply": "最大供應量",
"net-borrow-limit-in-period": "Net Borrow Limit in Period",
"net-borrow-period": "Net Borrow Period",
"net-borrows-in-period": "Net Borrows in Period",
"no-borrowers": "無借貸者...",
"no-depositors": "無存款者...",
"oracle": "Oracle",
"oracle-confidence": "Oracle Confidence",
"oracle-staleness": "Oracle Staleness",
"parameters": "Parameters",
"token-details": "幣種細節",
"token-fees-collected": "Token Fees Collected (M2M)",
"token-fees-collected": "Token Fees Collected",
"token-not-found": "查不到幣種",
"token-not-found-desc": "'{{token}}'未列入或我們在加載數據時出錯。",
"tooltip-borrow-upkeep-fee": "",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for opening new positions is scaled down. For borrows, the liability weight for opening new positions is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight increases health and liability weight reduces it. Initial health affects your ability to withdraw and open new positions and is reflected by the amount of free collateral in your account.",
"tooltip-insurance-rate-curve": "",
"tooltip-borrow-upkeep-rate": "The yearly rate paid to the DAO on open borrows. This is included in the displayed borrow interest rate.",
"tooltip-deposit-borrow-scaling-start": "This acts as a soft limit for deposits and borrows. For deposits, if this value is exceeded the asset weight for deposits is scaled down. For borrows, the liability weight for borrows is scaled up.",
"tooltip-init-asset-liability-weight": "The contribution a token has to your initial account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Initial health controls your ability to withdraw and open new positions and is shown as an account's free collateral.",
"tooltip-insurance-rate-curve": "Interest rates are dependent on token utilization. The more tokens that are lent out the higher the rate. The curve scales up and down with long term trends in utilization.",
"tooltip-liquidation-fee": "The fee paid to liqudators when {{symbol}} is liquidated.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your account health. Asset weight increases health and liability weight reduces it. Maintance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-limit-in-period": "",
"tooltip-net-borrows-in-period": "",
"tooltip-oracle-confidence": "How much variation from the true price is tolerated.",
"tooltip-oracle-staleness": "Price is considered valid when it is last udpated within {{slots}} slots.",
"tooltip-maint-asset-liability-weight": "The contribution a token has to your maintenance account health. Asset weight is applied to deposits that increase health and liability weight is applied to borrows that reduce it. Maintenance health is what's displayed on your account page. If this value reaches zero your account will be liquidated.",
"tooltip-net-borrow-period": "As a safety feature, the amount of new borrows is limited. The limit resets at regular periods. This is the amount of time between resets.",
"tooltip-net-borrow-limit-in-period": "Value of allowed net borrows. Once this value is reached, new borrows will be forbidden until the end of the period.",
"tooltip-net-borrows-in-period": "Current value of net borrows in this period.",
"tooltip-oracle-confidence": "Oracles work by aggregating multiple price sources. If these sources disagree too much, confidence will be low. If it's below this threshold, the price is considered invalid.",
"tooltip-oracle-staleness": "Price is considered valid when it is last updated within {{slots}} slots.",
"tooltip-token-fees-collected": "These fees accrue in every native token listed on Mango. The values in this chart are derived from the current market value.",
"top-borrowers": "頂級{{symbol}}借貸者",
"top-depositors": "頂級{{symbol}}存款者",
"total-supply": "總供應量",

View File

@ -41,6 +41,7 @@
"notional": "合約面值",
"notional-volume": "面值交易量($)",
"open-interest": "持倉量",
"oracle": "Oracle",
"oracle-not-updated": "This oracle has not updated recently.",
"oracle-not-updated-warning": "Actions will fail for accounts with a position in this token.",
"oracle-price": "預言機價格",
@ -54,7 +55,7 @@
"post": "Post",
"preview-sound": "聲音預覽",
"price-expect": "您收到的價格可能與您預期有差異,並且無法保證完全執行。為了您的安全,最大滑點保持為 2.5%。超過 2.5%滑點的部分不會被平倉。",
"price-provided-by": "This price is provided by",
"price-provided-by": "Oracle by",
"quote": "計價",
"reduce-only": "限減少",
"sells": "賣單",

View File

@ -142,8 +142,8 @@ export async function getNFTsByOwner(owner: PublicKey, connection: Connection) {
export const formatTokenSymbol = (symbol: string) => {
if (symbol.toLowerCase().includes('portal')) {
const truncSymbol = symbol.split(' ')[0]
return truncSymbol === 'WBTC' ? 'wBTC' : truncSymbol
const truncSymbol = symbol.split(' ')[0].toUpperCase()
return truncSymbol === 'WBTC' ? 'BTC' : truncSymbol
}
return symbol === 'MSOL' ? 'mSOL' : symbol
}