fixes for ada perp mkt

This commit is contained in:
Tyler Shipe 2021-10-29 14:57:50 -04:00
parent eebec54d2e
commit 9aa9d152c9
4 changed files with 8 additions and 15 deletions

View File

@ -19,6 +19,7 @@ import {
SushiMonoIcon,
UniMonoIcon,
UsdtMonoIcon,
AdaMonoIcon,
} from './icons'
const symbolIcons = {
@ -39,6 +40,7 @@ const symbolIcons = {
SushiMonoIcon,
UniMonoIcon,
UsdtMonoIcon,
AdaMonoIcon,
}
export default function MarketMenuItem({ menuTitle = '', linksArray = [] }) {

View File

@ -142,7 +142,7 @@ export const ProfileIcon = ({ className }) => {
)
}
export const AaveMonoIcon = ({ className }) => {
export const AdaMonoIcon = ({ className }) => {
return (
<svg
className={`${className}`}

View File

@ -260,10 +260,7 @@ export default function AdvancedTradeForm({
if (market instanceof Market && market.minOrderSize) {
minOrderSize = market.minOrderSize.toString()
} else if (market instanceof PerpMarket) {
const baseDecimals = getTokenBySymbol(
groupConfig,
marketConfig.baseSymbol
).decimals
const baseDecimals = marketConfig.baseDecimals
minOrderSize = new Big(market.baseLotSize)
.div(new Big(10).pow(baseDecimals))
.toString()
@ -275,14 +272,8 @@ export default function AdvancedTradeForm({
if (market instanceof Market) {
tickSize = market.tickSize
} else if (isPerpMarket) {
const baseDecimals = getTokenBySymbol(
groupConfig,
marketConfig.baseSymbol
).decimals
const quoteDecimals = getTokenBySymbol(
groupConfig,
groupConfig.quoteSymbol
).decimals
const baseDecimals = marketConfig.baseDecimals
const quoteDecimals = marketConfig.quoteDecimals
const nativeToUi = new Big(10).pow(baseDecimals - quoteDecimals)
const lotsToNative = new Big(market.quoteLotSize).div(

View File

@ -53,7 +53,7 @@ export const ENDPOINTS: EndpointInfo[] = [
type ClusterType = 'mainnet' | 'devnet'
const CLUSTER = (process.env.NEXT_PUBLIC_CLUSTER as ClusterType) || 'mainnet'
const CLUSTER = (process.env.NEXT_PUBLIC_CLUSTER as ClusterType) || 'devnet'
const ENDPOINT = ENDPOINTS.find((e) => e.name === CLUSTER)
export const WEBSOCKET_CONNECTION = new Connection(
@ -61,7 +61,7 @@ export const WEBSOCKET_CONNECTION = new Connection(
'processed' as Commitment
)
const DEFAULT_MANGO_GROUP_NAME = process.env.NEXT_PUBLIC_GROUP || 'mainnet.1'
const DEFAULT_MANGO_GROUP_NAME = process.env.NEXT_PUBLIC_GROUP || 'devnet.2'
const DEFAULT_MANGO_GROUP_CONFIG = Config.ids().getGroup(
CLUSTER,
DEFAULT_MANGO_GROUP_NAME