From dd9ca458747f35cfaf4f4b8080a2dfbff11427fa Mon Sep 17 00:00:00 2001 From: leifu Date: Wed, 9 Aug 2023 15:56:00 +0300 Subject: [PATCH 1/3] fix(app): staking UI reset issue (#912) --- packages/app/src/state/futures/hooks.ts | 7 ++++--- packages/app/src/state/staking/actions.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/app/src/state/futures/hooks.ts b/packages/app/src/state/futures/hooks.ts index d21cba097..08eb2408c 100644 --- a/packages/app/src/state/futures/hooks.ts +++ b/packages/app/src/state/futures/hooks.ts @@ -179,12 +179,13 @@ export const useFetchStakeMigrateData = () => { useFetchAction(fetchStakeMigrateData, { dependencies: [networkId, wallet], - disabled: !wallet || !networkSupportsStaking, }) + useFetchAction(() => fetchFuturesFees({ start, end }), { - dependencies: [networkId, wallet, start, end], - disabled: !wallet || !networkSupportsStaking, + dependencies: [networkId, start, end], + disabled: !networkSupportsStaking, }) + useFetchAction(() => fetchFuturesFeesForAccount({ start, end }), { dependencies: [networkId, wallet, start, end], disabled: !wallet || !networkSupportsStaking, diff --git a/packages/app/src/state/staking/actions.ts b/packages/app/src/state/staking/actions.ts index a6f4283cb..2934deddf 100644 --- a/packages/app/src/state/staking/actions.ts +++ b/packages/app/src/state/staking/actions.ts @@ -215,7 +215,7 @@ export const fetchEstimatedRewards = createAsyncThunk( 'staking/fetchMigrateData', async (_, { dispatch }) => { - await dispatch(fetchStakingData()) + dispatch(fetchStakingData()) dispatch(fetchStakingV2Data()) dispatch(fetchEscrowData()) dispatch(fetchEscrowV2Data()) From 8d74512dbfa512dd3107043329770fd8a60cd061 Mon Sep 17 00:00:00 2001 From: pldespaigne <5858657+pldespaigne@users.noreply.github.com> Date: Wed, 9 Aug 2023 18:11:45 +0200 Subject: [PATCH 2/3] feat(app): updated position table (#2720) * add market price & merge columns * refactor table css * fix errors * fix errors 2 * fix rebase error * remove label * use ColoredPrice * fix border --- .../FuturesPositionsTable.tsx | 91 +++++++------- .../MobileTrade/UserTabs/PositionsTab.tsx | 34 ++++- .../futures/UserInfo/PositionsTable.tsx | 117 ++++++++++-------- .../futures/UserInfo/TableMarketDetails.tsx | 45 ++++--- packages/app/src/translations/en.json | 3 +- 5 files changed, 176 insertions(+), 114 deletions(-) diff --git a/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx b/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx index fc6792997..ce3aca356 100644 --- a/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx +++ b/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx @@ -1,4 +1,6 @@ +import { ZERO_WEI } from '@kwenta/sdk/constants' import { FuturesMarginType } from '@kwenta/sdk/types' +import { formatDollars } from '@kwenta/sdk/utils' import Link from 'next/link' import { useRouter } from 'next/router' import { FC, useMemo } from 'react' @@ -6,6 +8,7 @@ import { useTranslation } from 'react-i18next' import styled from 'styled-components' import ChangePercent from 'components/ChangePercent' +import ColoredPrice from 'components/ColoredPrice' import Currency from 'components/Currency' import { FlexDivRowCentered } from 'components/layout/flex' import MarketBadge from 'components/MarketBadge' @@ -19,8 +22,10 @@ import useNetworkSwitcher from 'hooks/useNetworkSwitcher' import PositionType from 'sections/futures/PositionType' import { AppFuturesMarginType } from 'state/futures/common/types' import { selectCrossMarginActivePositions } from 'state/futures/crossMargin/selectors' +import { selectMarkPrices } from 'state/futures/selectors' import { selectSmartMarginActivePositions } from 'state/futures/smartMargin/selectors' import { useAppSelector } from 'state/hooks' +import { selectOffchainPricesInfo } from 'state/prices/selectors' import { getSynthDescription } from 'utils/futures' import MobilePositionRow from './MobilePositionRow' @@ -44,19 +49,24 @@ const FuturesPositionsTable: FC = ({ const crossMarginPositions = useAppSelector(selectCrossMarginActivePositions) const smartMarginPositions = useAppSelector(selectSmartMarginActivePositions) + const pricesInfo = useAppSelector(selectOffchainPricesInfo) + const markPrices = useAppSelector(selectMarkPrices) let data = useMemo(() => { const positions = accountType === FuturesMarginType.SMART_MARGIN ? smartMarginPositions : crossMarginPositions return positions.map((position) => { const description = getSynthDescription(position.market.asset, t) - + const priceInfo = pricesInfo[position.market.asset] + const marketPrice = markPrices[position.market.marketKey] ?? ZERO_WEI return { ...position, description, + marketPrice, + priceInfo, } }) - }, [accountType, crossMarginPositions, smartMarginPositions, t]) + }, [accountType, crossMarginPositions, markPrices, pricesInfo, smartMarginPositions, t]) return ( <> @@ -101,15 +111,23 @@ const FuturesPositionsTable: FC = ({ - - {cellProps.row.original.market.marketName} - - - {cellProps.row.original.description} + + + {cellProps.row.original.market.marketName} + + + + + {formatDollars(cellProps.row.original.marketPrice, { + suggestDecimals: true, + })} + + + ) }, @@ -154,31 +172,21 @@ const FuturesPositionsTable: FC = ({ undefined ? ( {NO_VALUE} ) : ( - + + + + ) }, size: 125, }, - { - header: () => ( - - {t('dashboard.overview.futures-positions-table.liquidationPrice')} - - ), - accessorKey: 'liquidationPrice', - cell: (cellProps) => { - return ( - - ) - }, - size: 115, - }, { header: () => ( {t('dashboard.overview.futures-positions-table.pnl')} @@ -186,12 +194,12 @@ const FuturesPositionsTable: FC = ({ accessorKey: 'pnl', cell: (cellProps) => { return ( - +
-
+ ) }, size: 125, @@ -290,9 +298,15 @@ const FuturesPositionsTable: FC = ({ ) } -const PnlContainer = styled.div` +const MarketContainer = styled.div` + display: flex; + flex-direction: row; +` + +const CellContainer = styled.div` display: flex; flex-direction: column; + row-gap: 4px; ` const StyledCurrencyIcon = styled(Currency.Icon)` @@ -328,13 +342,6 @@ const StyledText = styled.div` font-family: ${(props) => props.theme.fonts.bold}; ` -const MarketContainer = styled.div` - display: grid; - grid-template-rows: auto auto; - grid-template-columns: auto auto; - align-items: center; -` - const OpenPositionsHeader = styled.div` display: flex; justify-content: space-between; diff --git a/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx b/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx index ca8d92900..e1e724207 100644 --- a/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx +++ b/packages/app/src/sections/futures/MobileTrade/UserTabs/PositionsTab.tsx @@ -1,10 +1,13 @@ +import { ZERO_WEI } from '@kwenta/sdk/constants' import { FuturesMarginType, FuturesMarketKey, PositionSide } from '@kwenta/sdk/types' +import { formatDollars } from '@kwenta/sdk/utils' import Router from 'next/router' import { useCallback, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' import { FuturesPositionTablePositionActive } from 'types/futures' +import ColoredPrice from 'components/ColoredPrice' import Currency from 'components/Currency' import { FlexDiv, FlexDivRow, FlexDivRowCentered } from 'components/layout/flex' import Pill from 'components/Pill' @@ -21,8 +24,10 @@ import EditPositionButton from 'sections/futures/UserInfo/EditPositionButton' import { setShowPositionModal } from 'state/app/reducer' import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' import { selectCrossMarginActivePositions } from 'state/futures/crossMargin/selectors' +import { selectMarkPrices } from 'state/futures/selectors' import { selectSmartMarginActivePositions } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' +import { selectOffchainPricesInfo } from 'state/prices/selectors' import media from 'styles/media' const PositionsTab = () => { @@ -35,6 +40,8 @@ const PositionsTab = () => { const crossMarginPositions = useAppSelector(selectCrossMarginActivePositions) const smartMarginPositions = useAppSelector(selectSmartMarginActivePositions) const currentMarket = useAppSelector(selectMarketAsset) + const markPrices = useAppSelector(selectMarkPrices) + const pricesInfo = useAppSelector(selectOffchainPricesInfo) const accountType = useAppSelector(selectFuturesType) const [showShareModal, setShowShareModal] = useState(false) const [sharePosition, setSharePosition] = useState( @@ -44,8 +51,21 @@ const PositionsTab = () => { let data = useMemo(() => { const positions = accountType === FuturesMarginType.SMART_MARGIN ? smartMarginPositions : crossMarginPositions - return positions.sort((a) => (a.market.asset === currentMarket ? -1 : 1)) - }, [accountType, smartMarginPositions, crossMarginPositions, currentMarket]) + return positions + .map((p) => ({ + ...p, + marketPrice: markPrices[p.market.marketKey] ?? ZERO_WEI, + priceInfo: pricesInfo[p.market.asset], + })) + .sort((a) => (a.market.asset === currentMarket ? -1 : 1)) + }, [ + accountType, + smartMarginPositions, + crossMarginPositions, + markPrices, + pricesInfo, + currentMarket, + ]) const handleOpenPositionCloseModal = useCallback( (marketKey: FuturesMarketKey) => () => { @@ -88,10 +108,12 @@ const PositionsTab = () => {
{row.market.marketName} - - {accountType === FuturesMarginType.CROSS_MARGIN - ? 'Cross Margin' - : 'Smart Margin'} + + + {formatDollars(row.marketPrice, { + suggestDecimals: true, + })} +
diff --git a/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx b/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx index 65b1816bf..3f87d2b90 100644 --- a/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx +++ b/packages/app/src/sections/futures/UserInfo/PositionsTable.tsx @@ -1,3 +1,4 @@ +import { ZERO_WEI } from '@kwenta/sdk/constants' import { FuturesMarginType } from '@kwenta/sdk/types' import { getDisplayAsset, formatPercent } from '@kwenta/sdk/utils' import { useRouter } from 'next/router' @@ -22,8 +23,10 @@ import PositionType from 'sections/futures/PositionType' import { setShowPositionModal } from 'state/app/reducer' import { selectFuturesType, selectMarketAsset } from 'state/futures/common/selectors' import { selectCrossMarginActivePositions } from 'state/futures/crossMargin/selectors' +import { selectMarkPrices } from 'state/futures/selectors' import { selectSmartMarginActivePositions } from 'state/futures/smartMargin/selectors' import { useAppDispatch, useAppSelector } from 'state/hooks' +import { selectOffchainPricesInfo } from 'state/prices/selectors' import { FOOTER_HEIGHT } from 'styles/common' import media from 'styles/media' @@ -47,6 +50,8 @@ const PositionsTable: FC = memo(({ positions }: Props) => { const isL2 = useIsL2() const currentMarket = useAppSelector(selectMarketAsset) + const markPrices = useAppSelector(selectMarkPrices) + const pricesInfo = useAppSelector(selectOffchainPricesInfo) const accountType = useAppSelector(selectFuturesType) const [showShareModal, setShowShareModal] = useState(false) const [sharePosition, setSharePosition] = useState( @@ -54,8 +59,14 @@ const PositionsTable: FC = memo(({ positions }: Props) => { ) let data = useMemo(() => { - return positions.sort((a) => (a.market.asset === currentMarket ? -1 : 1)) - }, [positions, currentMarket]) + return positions + .map((p) => ({ + ...p, + marketPrice: markPrices[p.market.marketKey] ?? ZERO_WEI, + priceInfo: pricesInfo[p.market.asset], + })) + .sort((a) => (a.market.asset === currentMarket ? -1 : 1)) + }, [positions, markPrices, pricesInfo, currentMarket]) const handleOpenShareModal = useCallback((share: FuturesPositionTablePositionActive) => { setSharePosition(share) @@ -64,19 +75,19 @@ const PositionsTable: FC = memo(({ positions }: Props) => { if (!isL2) return ( - + {t('common.l2-cta')}
{t('homepage.l2.cta-buttons.switch-l2')}
-
+ ) if (!data.length) return ( - + {t('dashboard.overview.futures-positions-table.no-result')} - + ) if (lessThanWidth('xl')) { @@ -89,20 +100,18 @@ const PositionsTable: FC = memo(({ positions }: Props) => { return ( <> - -
Market
-
Side
-
Size
-
Avg. Entry
-
Liq. Price
-
Market Margin
-
uP&L
-
Funding
-
TP/SL
-
Actions
-
- + +
Market
+
Side
+
Size
+
Avg. Entry/Liq. Price
+
Market Margin
+
uP&L
+
Funding
+
TP/SL
+
Actions
+
{data.map((row) => ( @@ -114,6 +123,8 @@ const PositionsTable: FC = memo(({ positions }: Props) => { @@ -151,19 +162,19 @@ const PositionsTable: FC = memo(({ positions }: Props) => { {!row.activePosition.details?.avgEntryPrice ? ( {NO_VALUE} ) : ( - + + + + )} - - - @@ -278,6 +289,14 @@ const SelectedPositionsTable = memo(() => { export default SelectedPositionsTable +const EmptyTableContainer = styled.div` + height: 100%; + display: flex; + align-items: center; + justify-content: center; + border-top: ${(props) => props.theme.colors.selectedTheme.border}; +` + const TableContainer = styled.div` overflow: auto; border-top: ${(props) => props.theme.colors.selectedTheme.border}; @@ -285,36 +304,36 @@ const TableContainer = styled.div` ${media.lessThan('xl')` height: 100%; `} + display: grid; + grid-template-columns: 2fr 1fr 2fr 2fr 2fr 2fr 2fr 2fr 2fr; + align-content: flex-start; ` -const PositionRowDesktop = styled.div` - display: grid; - grid-template-columns: 75px 60px minmax(130px, 1fr) 1fr 1fr 1.3fr 1fr 1fr 1fr 64px; - grid-gap: 10px; +const PositionCell = styled.div` + display: flex; + align-items: center; height: 54px; padding: 0 10px; - &:nth-child(even) { - background-color: ${(props) => props.theme.colors.selectedTheme.table.fill}; - } border-bottom: ${(props) => props.theme.colors.selectedTheme.border}; ` -const HeadersRow = styled(PositionRowDesktop)` - height: ${FOOTER_HEIGHT}px; - padding: 7px 10px 0 10px; - color: ${(props) => props.theme.colors.selectedTheme.newTheme.text.secondary}; - border-top: ${(props) => props.theme.colors.selectedTheme.border}; - :not(:last-child) { - border-bottom: 0; - } - &:first-child { +const PositionRowDesktop = styled.div` + display: contents; + &:nth-child(even) > ${PositionCell} { background-color: ${(props) => props.theme.colors.selectedTheme.table.fill}; } ` -const PositionCell = styled.div` - display: flex; - align-items: center; +const HeadersRow = styled.div` + display: contents; + & > div { + display: flex; + align-items: center; + padding: 0 10px; + height: ${FOOTER_HEIGHT}px; + color: ${(props) => props.theme.colors.selectedTheme.newTheme.text.secondary}; + border-bottom: ${(props) => props.theme.colors.selectedTheme.border}; + } ` const PnlContainer = styled.div` diff --git a/packages/app/src/sections/futures/UserInfo/TableMarketDetails.tsx b/packages/app/src/sections/futures/UserInfo/TableMarketDetails.tsx index d3cea6d9a..d9323b535 100644 --- a/packages/app/src/sections/futures/UserInfo/TableMarketDetails.tsx +++ b/packages/app/src/sections/futures/UserInfo/TableMarketDetails.tsx @@ -1,8 +1,12 @@ import { FuturesMarketKey, PositionSide } from '@kwenta/sdk/types' +import { formatDollars } from '@kwenta/sdk/utils' +import Wei from '@synthetixio/wei' import { memo, ReactElement } from 'react' import styled from 'styled-components' +import ColoredPrice from 'components/ColoredPrice' import Currency from 'components/Currency' +import { PricesInfo } from 'state/prices/types' import PositionType from '../PositionType' @@ -12,23 +16,34 @@ type Props = { side?: PositionSide infoLabel?: string badge?: ReactElement + price?: Wei + priceInfo?: PricesInfo } -const TableMarketDetails = memo(({ marketKey, marketName, side, infoLabel, badge }: Props) => { - return ( - - -
- - {marketName} - {badge} - - {infoLabel && {infoLabel}} - {side && } -
-
- ) -}) +const TableMarketDetails = memo( + ({ marketKey, marketName, side, infoLabel, badge, price, priceInfo }: Props) => { + return ( + + +
+ + {marketName} + {badge} + + {infoLabel && {infoLabel}} + {side && } + {price && priceInfo && ( + + {formatDollars(price, { + suggestDecimals: true, + })} + + )} +
+
+ ) + } +) export default TableMarketDetails diff --git a/packages/app/src/translations/en.json b/packages/app/src/translations/en.json index 990da697b..82fb0b71e 100644 --- a/packages/app/src/translations/en.json +++ b/packages/app/src/translations/en.json @@ -447,12 +447,11 @@ "futures-positions-table": { "market": "Market", "side": "Side", - "avg-entry": "Avg. Entry Price", + "avg-entry": "Avg. Entry/Liq. Price", "last-entry": "Last Entry Price", "leverage": "Leverage", "pnl": "uP&L", "notionalValue": "Size", - "liquidationPrice": "Liq. Price", "no-result": "You have no open positions", "legacy-link": "Missing a position? Check the legacy app", "mobile": { From fc1bb89e039c5044e92df11baf57a408c894e40c Mon Sep 17 00:00:00 2001 From: Ralf Date: Wed, 9 Aug 2023 13:40:53 -0300 Subject: [PATCH 3/3] feat(*): add usdt perp (#904) * feat(*): add usdt perp * chore(app): add usdt logo --- packages/app/src/assets/png/currencies/sUSDT.png | Bin 0 -> 3799 bytes packages/app/src/utils/icons.ts | 2 ++ packages/sdk/src/constants/futures.ts | 10 ++++++++++ packages/sdk/src/types/futures.ts | 2 ++ packages/sdk/src/utils/futures.ts | 3 +++ 5 files changed, 17 insertions(+) create mode 100644 packages/app/src/assets/png/currencies/sUSDT.png diff --git a/packages/app/src/assets/png/currencies/sUSDT.png b/packages/app/src/assets/png/currencies/sUSDT.png new file mode 100644 index 0000000000000000000000000000000000000000..4f51ed94369bb34296c662a28642778956d8d4f8 GIT binary patch literal 3799 zcmeHJX*AS*8~*=iFf(?^(imG9vPQBmV>i}N8X{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#;lQnh2Gmv=1|;HCzCEIedRoxFyEK^8AoXX zO$^?#F4XZ9SZ)&0j9`^woTt?m(4LImAIl|n8x$?>9c7ndOpQA6IkAO=`z*8U;50ZZ zwNc5LiR@HCl#difDC9FpizoB>s>`(DOW}A=Od5M`(~5?$bPly^Yb!hnv(wgm$1-_yx%#=J=>=%-A?;?|R;I4wRz27SyO1W$!UENmq^`bmN8gA^>$R2rRw^zl% z)x#QR$*EaUQF+o&eXG2Oz*K^|+vJGv;0rurBa5pmkC@U8%(;*clNRpe&GzayM~zp; zINHL@b#=lnwH}KH*cq;)5_e9sDc#(=@C7h7apEm7PXqR5H3A;KOdggWWhx z#viZgI5*v&zq@m1Se=Zdn%W4B$uvd3>=4^Z5RyKYChLn(OsLw~Z`j;R4zYXmOm_2h z?S?vTLPxmu(y$TnIEskAG9@p_@~d{Serd?3^}E6UYEb`Hp#BFEFA6|J{tNtWJ^b|# q^lr{qbT6&DeZbj0aab=)OF;U7!+$*<%%I(^UkhtwWmu_?kNp?$p1eN* literal 0 HcmV?d00001 diff --git a/packages/app/src/utils/icons.ts b/packages/app/src/utils/icons.ts index d3618c57d..f8e68259a 100644 --- a/packages/app/src/utils/icons.ts +++ b/packages/app/src/utils/icons.ts @@ -54,6 +54,7 @@ import SUIIcon from 'assets/png/currencies/sSUI.png' import TRXIcon from 'assets/png/currencies/sTRX.png' import UNIIcon from 'assets/png/currencies/sUNI.png' import USDIcon from 'assets/png/currencies/sUSD.png' +import USDTIcon from 'assets/png/currencies/sUSDT.png' import WLDIcon from 'assets/png/currencies/sWLD.png' import XAGIcon from 'assets/png/currencies/sXAG.png' import XAUIcon from 'assets/png/currencies/sXAU.png' @@ -109,6 +110,7 @@ export const SYNTH_ICONS: Record = sSUIPERP: SUIIcon, sTRXPERP: TRXIcon, sUNIPERP: UNIIcon, + sUSDTPERP: USDTIcon, sWLDPERP: WLDIcon, sXAUPERP: XAUIcon, sXAGPERP: XAGIcon, diff --git a/packages/sdk/src/constants/futures.ts b/packages/sdk/src/constants/futures.ts index 179dc8bff..7ec64fc71 100644 --- a/packages/sdk/src/constants/futures.ts +++ b/packages/sdk/src/constants/futures.ts @@ -585,6 +585,16 @@ export const MARKETS: Record = { testnet: '0x69c5297fa967a51372d56174fcf7225b21263559bfbdb5cf03eff4af6c2212ea', }, }, + [FuturesMarketKey.sUSDTPERP]: { + key: FuturesMarketKey.sUSDTPERP, + asset: FuturesMarketAsset.USDT, + supports: 'both', + version: 2, + pythIds: { + mainnet: '0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b', + testnet: '0x1fc18861232290221461220bd4e2acd1dcdfbc89c84092c93c18bdc7756c1588', + }, + }, } export const MARKET_ASSETS_BY_PYTH_ID = Object.values(MARKETS) diff --git a/packages/sdk/src/types/futures.ts b/packages/sdk/src/types/futures.ts index 2fc4481a4..795bd60bc 100644 --- a/packages/sdk/src/types/futures.ts +++ b/packages/sdk/src/types/futures.ts @@ -135,6 +135,7 @@ export enum FuturesMarketKey { sMKRPERP = 'sMKRPERP', sRPLPERP = 'sRPLPERP', sWLDPERP = 'sWLDPERP', + sUSDTPERP = 'sUSDTPERP', } export enum FuturesMarketAsset { @@ -189,6 +190,7 @@ export enum FuturesMarketAsset { MKR = 'MKR', RPL = 'RPL', WLD = 'WLD', + USDT = 'USDT', } export interface FuturesMarketConfig { diff --git a/packages/sdk/src/utils/futures.ts b/packages/sdk/src/utils/futures.ts index 733566ca2..50e04c451 100644 --- a/packages/sdk/src/utils/futures.ts +++ b/packages/sdk/src/utils/futures.ts @@ -776,6 +776,7 @@ export const MarketAssetByKey: Record = { [FuturesMarketKey.sMKRPERP]: FuturesMarketAsset.MKR, [FuturesMarketKey.sRPLPERP]: FuturesMarketAsset.RPL, [FuturesMarketKey.sWLDPERP]: FuturesMarketAsset.WLD, + [FuturesMarketKey.sUSDTPERP]: FuturesMarketAsset.USDT, } as const export const MarketKeyByAsset: Record = { @@ -830,6 +831,7 @@ export const MarketKeyByAsset: Record = { [FuturesMarketAsset.MKR]: FuturesMarketKey.sMKRPERP, [FuturesMarketAsset.RPL]: FuturesMarketKey.sRPLPERP, [FuturesMarketAsset.WLD]: FuturesMarketKey.sWLDPERP, + [FuturesMarketAsset.USDT]: FuturesMarketKey.sUSDTPERP, } as const export const AssetDisplayByAsset: Record = { @@ -884,6 +886,7 @@ export const AssetDisplayByAsset: Record = { [FuturesMarketAsset.MKR]: 'Maker', [FuturesMarketAsset.RPL]: 'Rocket Pool', [FuturesMarketAsset.WLD]: 'Worldcoin', + [FuturesMarketAsset.USDT]: 'Tether', } as const export const PerpsV3SymbolToMarketKey: Record = {