+
{selectedMarket?.name === market.name ? (
{market.name}
@@ -472,15 +470,15 @@ const OpenOrders = () => {
)}
-
-
+
+
{' at '}
-
+
{
const { t } = useTranslation(['common', 'trade'])
@@ -98,218 +94,203 @@ const PerpPositions = () => {
<>
{mangoAccount && openPerpPositions.length ? (
showTableView ? (
- <>
-
-
-
-
- {t('market')} |
- {t('trade:size')} |
- {t('trade:avg-entry-price')} |
-
-
-
-
- {t('trade:est-liq-price')}
-
-
-
- |
- {t('trade:unrealized-pnl')} |
- {!isUnownedAccount ? | : null}
-
-
-
- {openPerpPositions.map((position, index) => {
- const market = group.getPerpMarketByMarketIndex(
- position.marketIndex
- )
- const basePosition = position.getBasePositionUi(market)
- const floorBasePosition = floorToDecimal(
- basePosition,
- getDecimalCount(market.minOrderSize)
- ).toNumber()
- const isSelectedMarket =
- selectedMarket instanceof PerpMarket &&
- selectedMarket.perpMarketIndex === position.marketIndex
+
+
+
+
+ {t('market')} |
+ {t('trade:size')} |
+ {t('trade:avg-entry-price')} |
+
+
+
+
+ {t('trade:est-liq-price')}
+
+
+
+ |
+ {t('trade:unrealized-pnl')} |
+ {!isUnownedAccount ? | : null}
+
+
+
+ {openPerpPositions.map((position, index) => {
+ const market = group.getPerpMarketByMarketIndex(
+ position.marketIndex
+ )
+ const basePosition = position.getBasePositionUi(market)
+ const floorBasePosition = floorToDecimal(
+ basePosition,
+ getDecimalCount(market.minOrderSize)
+ ).toNumber()
+ const isSelectedMarket =
+ selectedMarket instanceof PerpMarket &&
+ selectedMarket.perpMarketIndex === position.marketIndex
- if (!basePosition) return null
+ if (!basePosition) return null
- const isLong = basePosition > 0
- const avgEntryPrice =
- position.getAverageEntryPriceUi(market)
- const unsettledPnl = position.getUnsettledPnlUi(market)
- const totalPnl =
- position.cumulativePnlOverPositionLifetimeUi(market)
- const unrealizedPnl = position.getUnRealizedPnlUi(market)
- const realizedPnl = position.getRealizedPnlUi()
- const roe =
- (unrealizedPnl /
- (Math.abs(basePosition) * avgEntryPrice)) *
- 100
- const estLiqPrice = position.getLiquidationPriceUi(
- group,
- mangoAccount
- )
+ const isLong = basePosition > 0
+ const avgEntryPrice = position.getAverageEntryPriceUi(market)
+ const unsettledPnl = position.getUnsettledPnlUi(market)
+ const totalPnl =
+ position.cumulativePnlOverPositionLifetimeUi(market)
+ const unrealizedPnl = position.getUnRealizedPnlUi(market)
+ const realizedPnl = position.getRealizedPnlUi()
+ const roe =
+ (unrealizedPnl / (Math.abs(basePosition) * avgEntryPrice)) *
+ 100
+ const estLiqPrice = position.getLiquidationPriceUi(
+ group,
+ mangoAccount
+ )
- return (
-
-
-
- |
-
- {isSelectedMarket ? (
-
-
- handlePositionClick(floorBasePosition, market)
- }
- >
-
-
-
-
- ) : (
-
+ return (
+
+
+
+ |
+
+ {isSelectedMarket ? (
+
+
+ handlePositionClick(floorBasePosition, market)
+ }
+ >
-
-
- )}
- |
-
+
+
+
+ ) : (
- |
-
- {estLiqPrice ? (
-
- ) : (
- '–'
- )}
- |
-
-
-
- }
- delay={100}
- >
- = 0
- ? 'text-th-up'
- : 'text-th-down'
- }`}
- >
-
-
-
+ )}
+ |
+
+
+
+
+
+ |
+
+ {estLiqPrice ? (
+
+ ) : (
+ '–'
+ )}
+ |
+
+
+
+ }
+ delay={100}
+ >
= 0 ? 'text-th-up' : 'text-th-down'
- }
+ className={`tooltip-underline ${
+ unrealizedPnl >= 0
+ ? 'text-th-up'
+ : 'text-th-down'
+ }`}
>
- %{' '}
-
- (ROE)
-
+
+ = 0 ? 'text-th-up' : 'text-th-down'}
+ >
+
+ %{' '}
+
+ (ROE)
+
+
+
+ |
+ {!isUnownedAccount ? (
+
+
+
+
+ handleShowShare(openPerpPositions[index])
+ }
+ disabled={!group || !basePosition}
+ >
+
+
|
- {!isUnownedAccount ? (
-
-
-
-
- handleShowShare(openPerpPositions[index])
- }
- disabled={!group || !basePosition}
- >
-
-
-
- |
- ) : null}
-
- )
- })}
- |
-
-
- {showMarketCloseModal && positionToClose ? (
-
- ) : null}
- >
+ ) : null}
+
+ )
+ })}
+
+
+
) : (
{openPerpPositions.map((position, i) => {
@@ -349,50 +330,44 @@ const PerpPositions = () => {
i === 0 ? 'border-t-0' : ''
}`}
>
-
-
-
-
- {market.name}
-
- {side === 'buy' ? (
-
- ) : side === 'sell' ? (
-
- ) : null}
-
-
-
- {' '}
-
- {market.name.split('-')[0]}
+
+
+
+
+
+ {market.name}
-
- |
- 0
- ? 'text-th-up'
- : 'text-th-down'
- }`}
- >
-
-
+
+
+
+ {' '}
+
+ {market.name.split('-')[0]}
+
+
+ |
+ 0
+ ? 'text-th-up'
+ : 'text-th-down'
+ }`}
+ >
+
+
+
{
disabled={!group || !basePosition}
>
-
+
{t('trade:tweet-position')}
@@ -601,6 +576,13 @@ const PerpPositions = () => {
position={positionToShare!}
/>
) : null}
+ {showMarketCloseModal && positionToClose ? (
+
+ ) : null}
>
)
}
diff --git a/components/trade/Slippage.tsx b/components/trade/Slippage.tsx
index 5e396e43..68143b06 100644
--- a/components/trade/Slippage.tsx
+++ b/components/trade/Slippage.tsx
@@ -37,7 +37,7 @@ const Slippage = () => {
{t('trade:est-slippage')}
{t('trade:order-value')}
-
+
{orderValue ? : '–'}
diff --git a/hooks/useJupiterMints.ts b/hooks/useJupiterMints.ts
index c12ca6e1..6e57aa52 100644
--- a/hooks/useJupiterMints.ts
+++ b/hooks/useJupiterMints.ts
@@ -1,5 +1,4 @@
import { Group } from '@blockworks-foundation/mango-v4'
-import { WRAPPED_SOL_MINT } from '@project-serum/serum/lib/token-instructions'
import { CLUSTER } from '@store/mangoStore'
import { useQuery } from '@tanstack/react-query'
import useMangoGroup from 'hooks/useMangoGroup'
@@ -41,17 +40,6 @@ const useJupiterMints = (): {
}
)
- if (res?.data?.mangoTokens.length) {
- const findSol = res.data.mangoTokens.find(
- (t) => t.address === WRAPPED_SOL_MINT.toString()
- )
- if (findSol) {
- if (findSol.logoURI !== '/icons/sol.svg') {
- findSol.logoURI = '/icons/sol.svg'
- }
- }
- }
-
return {
mangoTokens: res?.data?.mangoTokens || [],
jupiterTokens: res?.data?.jupiterTokens || [],
diff --git a/public/icons/btc.svg b/public/icons/btc.svg
index 9a4133f3..8256e323 100644
--- a/public/icons/btc.svg
+++ b/public/icons/btc.svg
@@ -1,4 +1,3 @@
diff --git a/public/icons/sol.svg b/public/icons/sol.svg
index 64796e63..ecbb3400 100644
--- a/public/icons/sol.svg
+++ b/public/icons/sol.svg
@@ -1,26 +1,19 @@
diff --git a/public/locales/en/governance.json b/public/locales/en/governance.json
index 2318cc9e..dc833087 100644
--- a/public/locales/en/governance.json
+++ b/public/locales/en/governance.json
@@ -107,5 +107,6 @@
"create-switch-oracle": "Create switchboard oracle for",
"estimated-oracle-cost": "Estimated cost with funding oracle for ~6 months 2.8 SOL",
"create-oracle": "Create oracle",
- "tier": "Tier"
+ "tier": "Tier",
+ "on-boarding-description-1": "If you want to use delegated tokens go to vote view and select wallet in top right corner."
}
\ No newline at end of file
diff --git a/public/locales/en/trade.json b/public/locales/en/trade.json
index f6e01aca..cbcc9b54 100644
--- a/public/locales/en/trade.json
+++ b/public/locales/en/trade.json
@@ -92,7 +92,7 @@
"total-pnl": "Total PnL",
"trade-sounds-tooltip": "Play a sound alert for every new trade",
"trades": "Trades",
- "tweet-position": "Share to Twitter",
+ "tweet-position": "Tweet",
"unrealized-pnl": "Unrealized PnL",
"unsettled": "Unsettled",
"volume-alert": "Volume Alert",
diff --git a/public/locales/es/governance.json b/public/locales/es/governance.json
index 2318cc9e..dc833087 100644
--- a/public/locales/es/governance.json
+++ b/public/locales/es/governance.json
@@ -107,5 +107,6 @@
"create-switch-oracle": "Create switchboard oracle for",
"estimated-oracle-cost": "Estimated cost with funding oracle for ~6 months 2.8 SOL",
"create-oracle": "Create oracle",
- "tier": "Tier"
+ "tier": "Tier",
+ "on-boarding-description-1": "If you want to use delegated tokens go to vote view and select wallet in top right corner."
}
\ No newline at end of file
diff --git a/public/locales/es/trade.json b/public/locales/es/trade.json
index f6e01aca..cbcc9b54 100644
--- a/public/locales/es/trade.json
+++ b/public/locales/es/trade.json
@@ -92,7 +92,7 @@
"total-pnl": "Total PnL",
"trade-sounds-tooltip": "Play a sound alert for every new trade",
"trades": "Trades",
- "tweet-position": "Share to Twitter",
+ "tweet-position": "Tweet",
"unrealized-pnl": "Unrealized PnL",
"unsettled": "Unsettled",
"volume-alert": "Volume Alert",
diff --git a/public/locales/ru/governance.json b/public/locales/ru/governance.json
index 2318cc9e..dc833087 100644
--- a/public/locales/ru/governance.json
+++ b/public/locales/ru/governance.json
@@ -107,5 +107,6 @@
"create-switch-oracle": "Create switchboard oracle for",
"estimated-oracle-cost": "Estimated cost with funding oracle for ~6 months 2.8 SOL",
"create-oracle": "Create oracle",
- "tier": "Tier"
+ "tier": "Tier",
+ "on-boarding-description-1": "If you want to use delegated tokens go to vote view and select wallet in top right corner."
}
\ No newline at end of file
diff --git a/public/locales/ru/trade.json b/public/locales/ru/trade.json
index f6e01aca..cbcc9b54 100644
--- a/public/locales/ru/trade.json
+++ b/public/locales/ru/trade.json
@@ -92,7 +92,7 @@
"total-pnl": "Total PnL",
"trade-sounds-tooltip": "Play a sound alert for every new trade",
"trades": "Trades",
- "tweet-position": "Share to Twitter",
+ "tweet-position": "Tweet",
"unrealized-pnl": "Unrealized PnL",
"unsettled": "Unsettled",
"volume-alert": "Volume Alert",
diff --git a/public/locales/zh/governance.json b/public/locales/zh/governance.json
index 2318cc9e..dc833087 100644
--- a/public/locales/zh/governance.json
+++ b/public/locales/zh/governance.json
@@ -107,5 +107,6 @@
"create-switch-oracle": "Create switchboard oracle for",
"estimated-oracle-cost": "Estimated cost with funding oracle for ~6 months 2.8 SOL",
"create-oracle": "Create oracle",
- "tier": "Tier"
+ "tier": "Tier",
+ "on-boarding-description-1": "If you want to use delegated tokens go to vote view and select wallet in top right corner."
}
\ No newline at end of file
diff --git a/public/locales/zh/trade.json b/public/locales/zh/trade.json
index f6e01aca..cbcc9b54 100644
--- a/public/locales/zh/trade.json
+++ b/public/locales/zh/trade.json
@@ -92,7 +92,7 @@
"total-pnl": "Total PnL",
"trade-sounds-tooltip": "Play a sound alert for every new trade",
"trades": "Trades",
- "tweet-position": "Share to Twitter",
+ "tweet-position": "Tweet",
"unrealized-pnl": "Unrealized PnL",
"unsettled": "Unsettled",
"volume-alert": "Volume Alert",
diff --git a/public/locales/zh_tw/governance.json b/public/locales/zh_tw/governance.json
index 2318cc9e..dc833087 100644
--- a/public/locales/zh_tw/governance.json
+++ b/public/locales/zh_tw/governance.json
@@ -107,5 +107,6 @@
"create-switch-oracle": "Create switchboard oracle for",
"estimated-oracle-cost": "Estimated cost with funding oracle for ~6 months 2.8 SOL",
"create-oracle": "Create oracle",
- "tier": "Tier"
+ "tier": "Tier",
+ "on-boarding-description-1": "If you want to use delegated tokens go to vote view and select wallet in top right corner."
}
\ No newline at end of file
diff --git a/public/locales/zh_tw/trade.json b/public/locales/zh_tw/trade.json
index f6e01aca..cbcc9b54 100644
--- a/public/locales/zh_tw/trade.json
+++ b/public/locales/zh_tw/trade.json
@@ -92,7 +92,7 @@
"total-pnl": "Total PnL",
"trade-sounds-tooltip": "Play a sound alert for every new trade",
"trades": "Trades",
- "tweet-position": "Share to Twitter",
+ "tweet-position": "Tweet",
"unrealized-pnl": "Unrealized PnL",
"unsettled": "Unsettled",
"volume-alert": "Volume Alert",
diff --git a/store/mangoStore.ts b/store/mangoStore.ts
index 852008b1..95d8da6d 100644
--- a/store/mangoStore.ts
+++ b/store/mangoStore.ts
@@ -279,7 +279,7 @@ const mangoStore = create()(
if (typeof window !== 'undefined' && CLUSTER === 'mainnet-beta') {
const urlFromLocalStorage = localStorage.getItem(RPC_PROVIDER_KEY)
rpcUrl = urlFromLocalStorage
- ? JSON.parse(urlFromLocalStorage).value
+ ? JSON.parse(urlFromLocalStorage)
: ENDPOINT.url
}