fix trade page title price

This commit is contained in:
saml33 2023-04-26 12:29:37 +10:00
parent 724680ea11
commit f84a0c87c5
1 changed files with 7 additions and 3 deletions

View File

@ -81,7 +81,7 @@ function MyApp({ Component, pageProps }: AppProps) {
/> />
<meta <meta
name="description" name="description"
content="Mango Markets - Decentralised, cross-margin trading up to 10x leverage with lightning speed and near-zero fees." content="A magical new way to interact with DeFi. Groundbreaking safety features designed to keep your funds secure."
/> />
<link <link
rel="apple-touch-icon" rel="apple-touch-icon"
@ -140,12 +140,16 @@ const PageTitle = () => {
if (selectedMarket instanceof PerpMarket) { if (selectedMarket instanceof PerpMarket) {
return [selectedMarket, selectedMarket.uiPrice] return [selectedMarket, selectedMarket.uiPrice]
} else { } else {
const price = group.getFirstBankByTokenIndex( const baseBank = group.getFirstBankByTokenIndex(
selectedMarket.baseTokenIndex selectedMarket.baseTokenIndex
).uiPrice )
const quoteBank = group.getFirstBankByTokenIndex(
selectedMarket.quoteTokenIndex
)
const market = group.getSerum3ExternalMarket( const market = group.getSerum3ExternalMarket(
selectedMarket.serumMarketExternal selectedMarket.serumMarketExternal
) )
const price = baseBank.uiPrice / quoteBank.uiPrice
return [market, price] return [market, price]
} }
}, [selectedMarket, group]) }, [selectedMarket, group])