base & quote symbol
This commit is contained in:
parent
dcbb37fbb7
commit
ccad1015f3
|
@ -10,7 +10,7 @@ import ManualRefresh from './ManualRefresh'
|
|||
const MarketHeader = () => {
|
||||
// const oraclePrice = useOraclePrice()
|
||||
const marketConfig = useMangoStore((s) => s.selectedMarket.config)
|
||||
const baseSymbol = marketConfig.base_symbol;
|
||||
const baseSymbol = marketConfig.baseSymbol;
|
||||
const selectedMarketName = marketConfig.name;
|
||||
const previousMarketName: string = usePrevious(selectedMarketName)
|
||||
const marginAccount = useMangoStore((s) => s.selectedMarginAccount.current)
|
||||
|
|
|
@ -22,7 +22,7 @@ const MarketSelect = () => {
|
|||
<div className="border-r border-th-fgd-4 pr-4 text-th-fgd-4 text-xs">
|
||||
MARKETS
|
||||
</div>
|
||||
{groupConfig.perp_markets.map((s) => (
|
||||
{groupConfig.perpMarkets.map((s) => (
|
||||
<div
|
||||
className={`border-r border-th-fgd-4 cursor-pointer default-transition flex font-semibold px-4 text-xs hover:text-th-primary
|
||||
${
|
||||
|
@ -31,7 +31,7 @@ const MarketSelect = () => {
|
|||
: `text-th-fgd-3`
|
||||
}
|
||||
`}
|
||||
onClick={() => handleChange(s.base_symbol, 'perp')}
|
||||
onClick={() => handleChange(s.baseSymbol, 'perp')}
|
||||
key={s.key.toBase58()}
|
||||
>
|
||||
{s.name}
|
||||
|
@ -47,7 +47,7 @@ const MarketSelect = () => {
|
|||
: `text-th-fgd-3`
|
||||
}
|
||||
`}
|
||||
onClick={() => handleChange(s.base_symbol, 'spot')}
|
||||
onClick={() => handleChange(s.baseSymbol, 'spot')}
|
||||
key={s.key.toBase58()}
|
||||
>
|
||||
{s.name}
|
||||
|
|
|
@ -193,13 +193,13 @@ export default function Orderbook({ depth = 8 }) {
|
|||
className={`text-th-fgd-4 flex justify-between mb-2 text-xs`}
|
||||
>
|
||||
<div className={`text-left`}>
|
||||
Size ({marketConfig.base_symbol})
|
||||
Size ({marketConfig.baseSymbol})
|
||||
</div>
|
||||
<div className={`text-center`}>
|
||||
Price ({groupConfig.quote_symbol})
|
||||
Price ({groupConfig.quoteSymbol})
|
||||
</div>
|
||||
<div className={`text-right`}>
|
||||
Size ({marketConfig.base_symbol})
|
||||
Size ({marketConfig.baseSymbol})
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
|
|
|
@ -111,7 +111,7 @@ export default function TradeForm() {
|
|||
} else if (market instanceof PerpMarket) {
|
||||
const baseDecimals = getTokenBySymbol(
|
||||
groupConfig,
|
||||
marketConfig.base_symbol
|
||||
marketConfig.baseSymbol
|
||||
).decimals
|
||||
minOrderSize = new Big(market.contractSize)
|
||||
.div(new Big(10).pow(baseDecimals))
|
||||
|
@ -125,11 +125,11 @@ export default function TradeForm() {
|
|||
} else if (market instanceof PerpMarket) {
|
||||
const baseDecimals = getTokenBySymbol(
|
||||
groupConfig,
|
||||
marketConfig.base_symbol
|
||||
marketConfig.baseSymbol
|
||||
).decimals
|
||||
const quoteDecimals = getTokenBySymbol(
|
||||
groupConfig,
|
||||
groupConfig.quote_symbol
|
||||
groupConfig.quoteSymbol
|
||||
).decimals
|
||||
|
||||
const nativeToUi = new Big(10).pow(baseDecimals - quoteDecimals)
|
||||
|
@ -328,7 +328,7 @@ export default function TradeForm() {
|
|||
value={price}
|
||||
disabled={tradeType === 'Market'}
|
||||
prefix={'Price'}
|
||||
suffix={groupConfig.quote_symbol}
|
||||
suffix={groupConfig.quoteSymbol}
|
||||
className="rounded-r-none"
|
||||
wrapperClassName="w-3/5"
|
||||
/>
|
||||
|
@ -349,7 +349,7 @@ export default function TradeForm() {
|
|||
className="rounded-r-none"
|
||||
wrapperClassName="w-3/5"
|
||||
prefix={'Size'}
|
||||
suffix={marketConfig.base_symbol}
|
||||
suffix={marketConfig.baseSymbol}
|
||||
/>
|
||||
<StyledRightInput
|
||||
type="number"
|
||||
|
@ -359,7 +359,7 @@ export default function TradeForm() {
|
|||
value={quoteSize}
|
||||
className="rounded-l-none"
|
||||
wrapperClassName="w-2/5"
|
||||
suffix={groupConfig.quote_symbol}
|
||||
suffix={groupConfig.quoteSymbol}
|
||||
/>
|
||||
</Input.Group>
|
||||
{tradeType !== 'Market' ? (
|
||||
|
@ -391,7 +391,7 @@ export default function TradeForm() {
|
|||
baseSize > 0
|
||||
? 'Buy ' + baseSize
|
||||
: 'Set BUY bid >= ' + minOrderSize
|
||||
} ${marketConfig.base_symbol}`}
|
||||
} ${marketConfig.baseSymbol}`}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
|
@ -406,7 +406,7 @@ export default function TradeForm() {
|
|||
baseSize > 0
|
||||
? 'Sell ' + baseSize
|
||||
: 'Set SELL bid >= ' + minOrderSize
|
||||
} ${marketConfig.base_symbol}`}
|
||||
} ${marketConfig.baseSymbol}`}
|
||||
</Button>
|
||||
)
|
||||
) : (
|
||||
|
|
Loading…
Reference in New Issue