From cacda7c19a039c02efddd1beed9f0b218ef87414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Thu, 22 Aug 2024 21:10:14 +0400 Subject: [PATCH 01/49] implemented new pools list with GLV markets --- src/abis/GlvReader.json | 1425 +++++++++++++++++ .../Synthetics/BridgingInfo/BridgingInfo.tsx | 26 +- .../GmAssetDropdown/GmAssetDropdown.tsx | 14 +- .../MarketStats/MarketDescription.tsx | 47 + .../MarketStatsWithComposition.tsx | 451 ++++++ .../Synthetics/OrderList/ExchangeTable.tsx | 38 +- .../PoolsList/ApyTooltipContent.tsx | 31 + .../Synthetics/PoolsList/MintableAmount.tsx | 106 ++ .../GmList.tsx => PoolsList/PoolsList.tsx} | 334 ++-- .../PoolsList/TokenValuesInfoCell.tsx | 8 + .../PoolsList/TokensBalanceInfo.tsx} | 32 +- .../sortPoolsTokensByField.tsx} | 29 +- .../sortPoolsTokensDefault.tsx} | 25 +- src/components/TokenIcon/TokenIcon.tsx | 44 +- src/config/contracts.ts | 5 +- src/config/dataStore.ts | 25 + src/config/markets.ts | 12 +- src/config/tokens.ts | 70 +- .../SyntheticsStateContextProvider.tsx | 12 + .../selectors/globalSelectors.ts | 12 + src/domain/synthetics/markets/glv.spec.ts | 41 + src/domain/synthetics/markets/glv.ts | 40 + src/domain/synthetics/markets/types.ts | 5 + .../synthetics/markets/useGmMarketsApy.ts | 35 +- src/domain/synthetics/markets/utils.ts | 5 + src/domain/synthetics/tokens/useGlvPools.ts | 292 ++++ src/img/ic_glv_40.svg | 1 + src/lib/multicall/useMulticall.ts | 1 + .../MarketPoolsPage/MarketPoolsPage.scss | 2 +- src/pages/MarketPoolsPage/MarketPoolsPage.tsx | 18 +- src/pages/Stake/StakeV2.tsx | 8 +- tailwind.config.js | 1 + 32 files changed, 2920 insertions(+), 275 deletions(-) create mode 100644 src/abis/GlvReader.json create mode 100644 src/components/Synthetics/MarketStats/MarketDescription.tsx create mode 100644 src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx create mode 100644 src/components/Synthetics/PoolsList/ApyTooltipContent.tsx create mode 100644 src/components/Synthetics/PoolsList/MintableAmount.tsx rename src/components/Synthetics/{GmList/GmList.tsx => PoolsList/PoolsList.tsx} (66%) create mode 100644 src/components/Synthetics/PoolsList/TokenValuesInfoCell.tsx rename src/components/{GmTokensBalanceInfo/GmTokensBalanceInfo.tsx => Synthetics/PoolsList/TokensBalanceInfo.tsx} (88%) rename src/components/Synthetics/{GmList/sortGmTokensByField.tsx => PoolsList/sortPoolsTokensByField.tsx} (74%) rename src/components/Synthetics/{GmList/sortGmTokensDefault.tsx => PoolsList/sortPoolsTokensDefault.tsx} (77%) create mode 100644 src/domain/synthetics/markets/glv.spec.ts create mode 100644 src/domain/synthetics/markets/glv.ts create mode 100644 src/domain/synthetics/tokens/useGlvPools.ts create mode 100644 src/img/ic_glv_40.svg diff --git a/src/abis/GlvReader.json b/src/abis/GlvReader.json new file mode 100644 index 0000000000..6292172554 --- /dev/null +++ b/src/abis/GlvReader.json @@ -0,0 +1,1425 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GlvReader", + "sourceName": "contracts/reader/GlvReader.sol", + "abi": [ + { + "inputs": [], + "name": "EmptyMarketTokenSupply", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvNegativeMarketPoolValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountGlvDeposits", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvDeposit.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountGlvWithdrawals", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvWithdrawal.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "getGlv", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "name": "getGlvBySalt", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvDeposit", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvDeposit.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvDeposits", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvDeposit.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "getGlvInfo", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "glv", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + } + ], + "internalType": "struct GlvReader.GlvInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvInfoList", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "glv", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + } + ], + "internalType": "struct GlvReader.GlvInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvShift", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct GlvShift.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "internalType": "struct GlvShift.Numbers", + "name": "numbers", + "type": "tuple" + } + ], + "internalType": "struct GlvShift.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvShifts", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct GlvShift.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + } + ], + "internalType": "struct GlvShift.Numbers", + "name": "numbers", + "type": "tuple" + } + ], + "internalType": "struct GlvShift.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address[]", + "name": "marketAddresses", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "indexTokenPrices", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getGlvTokenPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address[]", + "name": "marketAddresses", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "indexTokenPrices", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getGlvValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvWithdrawal", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvWithdrawal.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvWithdrawals", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + } + ], + "internalType": "struct GlvWithdrawal.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvs", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + } + \ No newline at end of file diff --git a/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx b/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx index db8a402926..ea1a7bbcce 100644 --- a/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +++ b/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx @@ -9,7 +9,7 @@ type Props = { tokenSymbol?: string; }; -export default function BridgingInfo(props: Props) { +export default function BridgingInfoG(props: Props) { const { chainId, tokenSymbol } = props; const chainName = getChainName(chainId); const bridgingOptions = getBridgingOptionsForToken(tokenSymbol); @@ -40,3 +40,27 @@ export default function BridgingInfo(props: Props) { /> ); } + +export function BridgingInfo(props: Props) { + const { chainId, tokenSymbol } = props; + const chainName = getChainName(chainId); + const bridgingOptions = getBridgingOptionsForToken(tokenSymbol); + + if (!tokenSymbol || !bridgingOptions) return null; + + return ( +

+ + Bridge {tokenSymbol} to {chainName} with + {" "} + {bridgingOptions.map((option, i) => { + const bridgeLink = option.generateLink(chainId); + return ( + + {option?.name} + + ); + })} +

+ ); +} diff --git a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx index 34e7150b11..cb51d4e28f 100644 --- a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx +++ b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx @@ -7,8 +7,10 @@ import { createBreakpoint } from "react-use"; import { getExplorerUrl } from "config/chains"; import { getIcon } from "config/icons"; -import { MarketInfo, MarketsInfoData, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; +import { MarketInfo, PoolsInfoData, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; +import { isGlv } from "domain/synthetics/markets/glv"; import { TokenData, TokensData, getTokenData } from "domain/synthetics/tokens"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; import { useChainId } from "lib/chains"; import { getByKey } from "lib/objects"; import useWallet, { WalletClient } from "lib/wallets/useWallet"; @@ -21,22 +23,24 @@ import "./GmAssetDropdown.scss"; type Props = { token?: TokenData; - marketsInfoData?: MarketsInfoData; + marketsInfoData?: PoolsInfoData; position?: Placement; tokensData?: TokensData; }; -function renderMarketName(market?: MarketInfo) { +function renderMarketName(market?: MarketInfo | GlvPoolInfo) { if (!market) { return null; } - const marketName = market.isSpotOnly ? "SWAP" : getMarketIndexName(market); + const isGlvMarket = isGlv(market); + + const marketName = market.isSpotOnly ? "SWAP" : isGlvMarket ? market.name : getMarketIndexName(market); const poolName = getMarketPoolName(market); return ( <> - GM: {marketName} + {isGlvMarket ? "GLV" : "GM"}: {marketName} [{poolName}] diff --git a/src/components/Synthetics/MarketStats/MarketDescription.tsx b/src/components/Synthetics/MarketStats/MarketDescription.tsx new file mode 100644 index 0000000000..75712cf2da --- /dev/null +++ b/src/components/Synthetics/MarketStats/MarketDescription.tsx @@ -0,0 +1,47 @@ +import { Trans } from "@lingui/macro"; + +import { getMarketIndexName, MarketInfo } from "domain/synthetics/markets"; + +import "./MarketStats.scss"; + +type Props = { + marketInfo?: MarketInfo; +}; + +export function MarketDescription({ marketInfo }: Props) { + if (!marketInfo) { + return null; + } + + let text; + if (marketInfo.indexToken.isSynthetic) { + text = ( + + This token automatically accrues fees from leverage trading and swaps for the {getMarketIndexName(marketInfo)}{" "} + market. It is also exposed to {marketInfo.longToken.symbol} and {marketInfo.shortToken.symbol} as per the + composition displayed. + + ); + } else if (marketInfo.isSpotOnly) { + text = ( + + This token automatically accrues fees from swaps for the {marketInfo.longToken.symbol}/ + {marketInfo.shortToken.symbol} market. It is also exposed to {marketInfo.longToken.symbol} and{" "} + {marketInfo.shortToken.symbol} as per the composition displayed. + + ); + } else { + let composition = + marketInfo.longToken.symbol === marketInfo.shortToken.symbol + ? marketInfo.longToken.symbol + : `${marketInfo.longToken.symbol} and ${marketInfo.shortToken.symbol}`; + text = ( + + This token automatically accrues fees from leverage trading and swaps for the {getMarketIndexName(marketInfo)}{" "} + market. It is also exposed to {composition} as per the composition displayed. + + ); + } + + return
{text}
; +} diff --git a/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx new file mode 100644 index 0000000000..631911f204 --- /dev/null +++ b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx @@ -0,0 +1,451 @@ +import { Trans, t } from "@lingui/macro"; +import { useMemo } from "react"; + +import { getBridgingOptionsForToken } from "config/bridging"; +import { + MarketInfo, + MarketTokensAPRData, + MarketsInfoData, + getMarketIndexName, + getMarketPoolName, + getMaxPoolUsd, + getMintableMarketTokens, + getPoolUsdWithoutPnl, + getSellableMarketToken, +} from "domain/synthetics/markets"; +import { TokenData, TokensData, convertToTokenAmount, convertToUsd } from "domain/synthetics/tokens"; +import { useChainId } from "lib/chains"; +import { BN_ZERO, formatAmountHuman, formatTokenAmountWithUsd, formatUsd } from "lib/numbers"; +import { getByKey } from "lib/objects"; +import MarketTokenSelector from "../MarketTokenSelector/MarketTokenSelector"; + +import { CardRow } from "components/CardRow/CardRow"; +import ExternalLink from "components/ExternalLink/ExternalLink"; +import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; +import Tooltip from "components/Tooltip/Tooltip"; +import { BridgingInfo } from "../BridgingInfo/BridgingInfo"; + +import TokenIcon from "components/TokenIcon/TokenIcon"; +import { TOKEN_COLOR_MAP } from "config/tokens"; +import { MARKET_STATS_DECIMALS } from "config/ui"; +import { bigMath } from "lib/bigmath"; +import { ExchangeTd, ExchangeTh, ExchangeTheadTr, ExchangeTr } from "../OrderList/ExchangeTable"; +import "./MarketStats.scss"; +import { MarketDescription } from "./MarketDescription"; + +type Props = { + marketsInfoData?: MarketsInfoData; + marketTokensData?: TokensData; + marketInfo?: MarketInfo; + marketToken?: TokenData; + marketsTokensApyData: MarketTokensAPRData | undefined; + marketsTokensIncentiveAprData: MarketTokensAPRData | undefined; +}; + +export function MarketStatsWithComposition(p: Props) { + const { + marketInfo, + marketToken, + marketsTokensApyData, + marketsInfoData, + marketTokensData, + marketsTokensIncentiveAprData, + } = p; + const { chainId } = useChainId(); + + const marketPrice = marketToken?.prices?.maxPrice; + const marketBalance = marketToken?.balance; + const marketBalanceUsd = convertToUsd(marketBalance, marketToken?.decimals, marketPrice); + + const marketTotalSupply = marketToken?.totalSupply; + const marketTotalSupplyUsd = convertToUsd(marketTotalSupply, marketToken?.decimals, marketPrice); + + const { longToken, shortToken, longPoolAmount, shortPoolAmount } = marketInfo || {}; + + const mintableInfo = marketInfo && marketToken ? getMintableMarketTokens(marketInfo, marketToken) : undefined; + const sellableInfo = marketInfo && marketToken ? getSellableMarketToken(marketInfo, marketToken) : undefined; + + const maxLongSellableTokenAmount = convertToTokenAmount( + sellableInfo?.maxLongSellableUsd, + longToken?.decimals, + longToken?.prices.minPrice + ); + + const maxShortSellableTokenAmount = convertToTokenAmount( + sellableInfo?.maxShortSellableUsd, + shortToken?.decimals, + shortToken?.prices.minPrice + ); + + const longPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, true, "midPrice") : undefined; + const shortPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, false, "midPrice") : undefined; + + const apy = getByKey(marketsTokensApyData, marketInfo?.marketTokenAddress); + const incentiveApr = getByKey(marketsTokensIncentiveAprData, marketInfo?.marketTokenAddress); + const indexName = marketInfo && getMarketIndexName(marketInfo); + const poolName = marketInfo && getMarketPoolName(marketInfo); + + const bridgingOprionsForToken = getBridgingOptionsForToken(longToken?.symbol); + const shouldShowMoreInfo = Boolean(bridgingOprionsForToken); + + const maxLongTokenValue = useMemo( + () => [ + formatTokenAmountWithUsd( + mintableInfo?.longDepositCapacityAmount, + mintableInfo?.longDepositCapacityUsd, + longToken?.symbol, + longToken?.decimals + ), + marketInfo + ? `(${formatUsd(getPoolUsdWithoutPnl(marketInfo, true, "midPrice"))} / ${formatUsd(getMaxPoolUsd(marketInfo, true))})` + : "", + ], + [ + longToken?.decimals, + longToken?.symbol, + marketInfo, + mintableInfo?.longDepositCapacityAmount, + mintableInfo?.longDepositCapacityUsd, + ] + ); + const maxShortTokenValue = useMemo( + () => [ + formatTokenAmountWithUsd( + mintableInfo?.shortDepositCapacityAmount, + mintableInfo?.shortDepositCapacityUsd, + shortToken?.symbol, + shortToken?.decimals + ), + marketInfo + ? `(${formatUsd(getPoolUsdWithoutPnl(marketInfo, false, "midPrice"))} / ${formatUsd(getMaxPoolUsd(marketInfo, false))})` + : "", + ], + [ + marketInfo, + mintableInfo?.shortDepositCapacityAmount, + mintableInfo?.shortDepositCapacityUsd, + shortToken?.decimals, + shortToken?.symbol, + ] + ); + + return ( +
+
+ +
+
+ + + {indexName} + [{poolName}] +
+ ) : ( + "..." + ) + } + /> + { + return ( +
+ + GM token pricing includes price impact pool amounts, the pending PnL of open positions, and + borrowing fees. It excludes funding fees, which are exchanged between traders. +
+
+ + Read more about GM token pricing + + . +
+
+ ); + }} + /> + } + /> + + + + {/* } /> */} + + + + + {marketInfo?.isSameCollaterals ? ( + + {marketInfo?.longToken.symbol} can be used to buy GM for this market up to the specified + buying caps. + + ) : ( + + {marketInfo?.longToken.symbol} and {marketInfo?.shortToken.symbol} can be used to buy GM for + this market up to the specified buying caps. + + )} + +
+
+ + +
+ +
+ } + /> + ) : ( + "..." + ) + } + /> + + + {marketInfo?.isSameCollaterals ? ( + + GM can be sold for {longToken?.symbol} for this market up to the specified selling caps. The + remaining tokens in the pool are reserved for currently open positions. + + ) : ( + + GM can be sold for {longToken?.symbol} and {shortToken?.symbol} for this market up to the + specified selling caps. The remaining tokens in the pool are reserved for currently open + positions. + + )} +
+
+ + {!marketInfo?.isSameCollaterals && ( + + )} +
+ } + /> + } + /> +
+ +
+
+
+

Composition

+ + +
+ + ); +} + +interface CompositionBarProps { + data: { + color: string; + value?: bigint; + }[]; +} + +function CompositionBar({ data }: CompositionBarProps) { + const sum = data.reduce((acc, { value }) => acc + (value ?? 0n), 0n); + const percents = data.map(({ value }) => (value === undefined ? 0n : bigMath.mulDiv(value, 100n, sum))); + + return ( +
+ {data.map(({ color, value }, index) => { + if (value === undefined) { + return null; + } + const widthPc = percents[index].toString(); + const previousWidthPc = index ? percents[index - 1]?.toString() : "0"; + + return ( +
+ ); + })} +
+ ); +} + +interface CompositionTableGmProps { + data: { prefix: string; amountUsd?: bigint; token?: TokenData; amount?: bigint }[]; +} + +export function CompositionTableGm({ data }: CompositionTableGmProps) { + const sum = data.reduce((acc, { amountUsd }) => acc + (amountUsd ?? 0n), 0n); + + return ( + + + + + COLLATERAL + + + AMOUNT + + + COMP. + + + + + {data.map(({ token, prefix, amountUsd, amount }, index) => { + if (amount === undefined || amountUsd === undefined || !token) { + return null; + } + + return ( + + + + + + + {prefix}: {token.symbol} + + + + + {formatAmountHuman(amount, token.decimals)} + + + {bigMath.mulDiv(amountUsd, 100n, sum).toString()} + + + ); + })} + +
+ ); +} diff --git a/src/components/Synthetics/OrderList/ExchangeTable.tsx b/src/components/Synthetics/OrderList/ExchangeTable.tsx index 0a216fc0c1..baafbed778 100644 --- a/src/components/Synthetics/OrderList/ExchangeTable.tsx +++ b/src/components/Synthetics/OrderList/ExchangeTable.tsx @@ -1,17 +1,25 @@ import cx from "classnames"; import { PropsWithChildren, forwardRef } from "react"; +interface ExchangeTdThProps extends PropsWithChildren, React.HTMLProps { + padding?: Padding; +} + export function ExchangeTable(props: PropsWithChildren & React.HTMLProps) { return ; } -export function ExchangeTh(props: PropsWithChildren & React.HTMLProps) { +export function ExchangeTh(props: ExchangeTdThProps) { + const { padding = "all", ...rest } = props; + return ( - MARKET + POOL @@ -164,7 +171,7 @@ export function GmList({ - {currentData.length > 0 && currentData.map((token) => ( - ))} {!currentData.length && !isLoading && ( @@ -224,41 +232,43 @@ export function GmList({ ); } -function useFilterSortGmPools({ - marketsInfoData, +function useFilterSortPools({ + poolsInfo, marketTokensData, orderBy, direction, marketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, + glvMarketsTokensApyData, searchText, tokensData, }: { - marketsInfoData: MarketsInfoData | undefined; + poolsInfo: PoolsInfoData | undefined; marketTokensData: TokensData | undefined; orderBy: SortField; direction: SortDirection; marketsTokensApyData: MarketTokensAPRData | undefined; marketsTokensIncentiveAprData: MarketTokensAPRData | undefined; marketsTokensLidoAprData: MarketTokensAPRData | undefined; + glvMarketsTokensApyData: MarketTokensAPRData | undefined; searchText: string; tokensData: TokensData | undefined; }) { const chainId = useSelector(selectChainId); - const sortedGmTokens = useMemo(() => { - if (!marketsInfoData || !marketTokensData) { + const sortedTokens = useMemo(() => { + if (!poolsInfo || !marketTokensData) { return []; } if (orderBy === "unspecified" || direction === "unspecified") { - return sortGmTokensDefault(marketsInfoData, marketTokensData); + return sortPoolsTokensDefault(poolsInfo, marketTokensData); } - return sortGmTokensByField({ + return sortPoolsTokensByField({ chainId, - marketsInfoData, + poolsInfo, marketTokensData, orderBy, direction, @@ -270,21 +280,23 @@ function useFilterSortGmPools({ chainId, direction, marketTokensData, - marketsInfoData, + poolsInfo, marketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, orderBy, ]); - const filteredGmTokens = useMemo(() => { + const filteredTokens = useMemo(() => { if (!searchText.trim()) { - return sortedGmTokens; + return sortedTokens; } - return sortedGmTokens.filter((token) => { - const market = getByKey(marketsInfoData, token?.address)!; - const indexToken = getTokenData(tokensData, market?.indexTokenAddress, "native"); + return sortedTokens.filter((token) => { + const market = getByKey(poolsInfo, token?.address)!; + const indexToken = isGlv(market) + ? market.indexToken + : getTokenData(tokensData, market?.indexTokenAddress, "native"); const longToken = getTokenData(tokensData, market?.longTokenAddress); const shortToken = getTokenData(tokensData, market?.shortTokenAddress); @@ -323,28 +335,30 @@ function useFilterSortGmPools({ isAddressEqual(shortTokenAddress as Address, searchText))) ); }); - }, [marketsInfoData, searchText, sortedGmTokens, tokensData]); + }, [poolsInfo, searchText, sortedTokens, tokensData]); - return filteredGmTokens; + return filteredTokens; } -function GmListItem({ +function PoolsListItem({ token, marketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, + glvMarketsTokensApyData, shouldScrollToTop, - isShiftAvailable, + hideShift, }: { token: TokenData; marketsTokensApyData: MarketTokensAPRData | undefined; marketsTokensIncentiveAprData: MarketTokensAPRData | undefined; marketsTokensLidoAprData: MarketTokensAPRData | undefined; + glvMarketsTokensApyData: MarketTokensAPRData | undefined; shouldScrollToTop: boolean | undefined; - isShiftAvailable: boolean; + hideShift: boolean; }) { const chainId = useSelector(selectChainId); - const marketsInfoData = useMarketsInfoData(); + const marketsInfoData = useSelector(selectPoolsData); const tokensData = useTokensData(); const userEarnings = useUserEarnings(chainId); const daysConsidered = useDaysConsideredInMarketsApr(); @@ -352,12 +366,57 @@ function GmListItem({ const market = getByKey(marketsInfoData, token?.address)!; - const indexToken = getTokenData(tokensData, market?.indexTokenAddress, "native"); + const isGlvMarket = isGlv(market); + + const indexToken = isGlvMarket ? market.indexToken : getTokenData(tokensData, market?.indexTokenAddress, "native"); const longToken = getTokenData(tokensData, market?.longTokenAddress); const shortToken = getTokenData(tokensData, market?.shortTokenAddress); - const mintableInfo = market && token ? getMintableMarketTokens(market, token) : undefined; - const apy = getByKey(marketsTokensApyData, token?.address); + const mintableInfo = useMemo(() => { + if (!market || !token || isGlvMarket) { + return undefined; + } + + return getMintableMarketTokens(market, token); + }, [market, token, isGlvMarket]); + + const shiftButton = useMemo(() => { + if (hideShift) { + return null; + } + + const btn = ( + + ); + + if (isGlvMarket) { + return ( + + Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. + However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens. + + } + handle={btn} + disableHandleStyle + /> + ); + } + + return btn; + }, [hideShift, market.marketTokenAddress, shouldScrollToTop, isGlvMarket]); + + const apy = isGlvMarket + ? getByKey(glvMarketsTokensApyData, market.indexToken.address) + : getByKey(marketsTokensApyData, token?.address); const incentiveApr = getByKey(marketsTokensIncentiveAprData, token?.address); const lidoApr = getByKey(marketsTokensLidoAprData, token?.address); const marketEarnings = getByKey(userEarnings?.byMarketAddress, token?.address); @@ -372,16 +431,26 @@ function GmListItem({ ? getNormalizedTokenSymbol(longToken.symbol) + getNormalizedTokenSymbol(shortToken.symbol) : getNormalizedTokenSymbol(indexToken.symbol); + const tokenIconBadge = isGlvMarket + ? getGlvMarketBadgeName(market.name) + : ([market.longToken.symbol, market.shortToken.symbol] as const); + return (
-
- +
+
- {getMarketIndexName({ indexToken, isSpotOnly: market?.isSpotOnly })} + {isGlvMarket ? `GLV: ${market.name}` : getMarketIndexName({ indexToken, isSpotOnly: market?.isSpotOnly })}
@@ -395,31 +464,36 @@ function GmListItem({ {showDebugValues && {market.marketTokenAddress}} {formatUsdPrice(token.prices?.minPrice)} - - {formatTokenAmount(totalSupply, token.decimals, "GM", { - useCommas: true, - displayDecimals: 2, - })} -
({formatUsd(totalSupplyUsd)}) +
- + {isGlvMarket ? ( + + ) : ( + + )} - @@ -443,139 +517,9 @@ function GmListItem({ > Sell -
- -
+
{shiftButton}
); } - -function MintableAmount({ - mintableInfo, - market, - token, - longToken, - shortToken, -}: { - mintableInfo: - | { - mintableAmount: bigint; - mintableUsd: bigint; - longDepositCapacityUsd: bigint; - shortDepositCapacityUsd: bigint; - longDepositCapacityAmount: bigint; - shortDepositCapacityAmount: bigint; - } - | undefined; - market: any; - token: any; - longToken: any; - shortToken: any; -}) { - const longTokenMaxValue = useMemo( - () => [ - mintableInfo - ? formatTokenAmountWithUsd( - mintableInfo.longDepositCapacityAmount, - mintableInfo.longDepositCapacityUsd, - longToken.symbol, - longToken.decimals - ) - : "-", - `(${formatUsd(getPoolUsdWithoutPnl(market, true, "midPrice"))} / ${formatUsd(getMaxPoolUsd(market, true))})`, - ], - [longToken.decimals, longToken.symbol, market, mintableInfo] - ); - const shortTokenMaxValue = useMemo( - () => [ - mintableInfo - ? formatTokenAmountWithUsd( - mintableInfo.shortDepositCapacityAmount, - mintableInfo.shortDepositCapacityUsd, - shortToken.symbol, - shortToken.decimals - ) - : "-", - `(${formatUsd(getPoolUsdWithoutPnl(market, false, "midPrice"))} / ${formatUsd(getMaxPoolUsd(market, false))})`, - ], - [market, mintableInfo, shortToken.decimals, shortToken.symbol] - ); - - return ( - - {formatTokenAmount(mintableInfo?.mintableAmount, token.decimals, "GM", { - useCommas: true, - displayDecimals: 0, - })} -
( - {formatUsd(mintableInfo?.mintableUsd, { - displayDecimals: 0, - })} - ) - - } - className="normal-case" - position="bottom-end" - renderContent={() => ( - <> -

- {market?.isSameCollaterals ? ( - {longToken.symbol} can be used to buy GM for this market up to the specified buying caps. - ) : ( - - {longToken.symbol} and {shortToken.symbol} can be used to buy GM for this market up to the specified - buying caps. - - )} -

-
- - - - )} - /> - ); -} - -function ApyTooltipContent() { - return ( -

- -

- The APY is an estimate based on the fees collected for the past seven days, extrapolating the current - borrowing fee. It excludes: -

-
    -
  • price changes of the underlying token(s)
  • -
  • traders' PnL, which is expected to be neutral in the long term
  • -
  • funding fees, which are exchanged between traders
  • -
-

- - Read more about GM token pricing - - . -

-

- Check GM pools' performance against other LP Positions in the{" "} - GMX Dune Dashboard. -

- -

- ); -} diff --git a/src/components/Synthetics/PoolsList/TokenValuesInfoCell.tsx b/src/components/Synthetics/PoolsList/TokenValuesInfoCell.tsx new file mode 100644 index 0000000000..f219a5e6c3 --- /dev/null +++ b/src/components/Synthetics/PoolsList/TokenValuesInfoCell.tsx @@ -0,0 +1,8 @@ +export function TokenValuesInfoCell({ token, usd }: { token?: string; usd?: string }) { + return ( + <> + {token &&
{token}
} + {usd &&
({usd})
} + + ); +} diff --git a/src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx b/src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx similarity index 88% rename from src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx rename to src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx index 32575c5c89..e3d75f7654 100644 --- a/src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +++ b/src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx @@ -9,33 +9,32 @@ import { TokenData, convertToUsd } from "domain/synthetics/tokens"; import { formatDeltaUsd, formatTokenAmount, formatUsd } from "lib/numbers"; import { getPositiveOrNegativeClass } from "lib/utils"; import { useCallback, useMemo } from "react"; +import { TokenValuesInfoCell } from "./TokenValuesInfoCell"; -export const GmTokensBalanceInfo = ({ +export const TokensBalanceInfo = ({ token, earnedTotal, earnedRecently, daysConsidered, - oneLine = false, + isGlv = false, }: { token: TokenData; earnedTotal?: bigint; earnedRecently?: bigint; daysConsidered: number; - oneLine?: boolean; + isGlv?: boolean; }) => { const content = ( - <> - {formatTokenAmount(token.balance, token.decimals, "GM", { + }( - {formatUsd(convertToUsd(token.balance, token.decimals, token.prices?.minPrice), { + usd={formatUsd(convertToUsd(token.balance, token.decimals, token.prices?.minPrice), { fallbackToZero: true, })} - ) - + /> ); const renderTooltipContent = useCallback(() => { @@ -65,14 +64,22 @@ export const GmTokensBalanceInfo = ({ ); }, [daysConsidered, earnedRecently, earnedTotal]); - if (earnedTotal === undefined && earnedRecently === undefined) { + + if ((earnedTotal === undefined && earnedRecently === undefined) || isGlv) { return content; } - return ; + return ( + + ); }; -export const GmTokensTotalBalanceInfo = ({ +export const TokensTotalBalanceInfo = ({ balance, balanceUsd, userEarnings, @@ -148,6 +155,7 @@ export const GmTokensTotalBalanceInfo = ({ pool.indexToken); + const gmTokens = values(marketTokensData).concat(glvTokens); + const directionMultiplier = direction === "asc" ? 1 : -1; if (orderBy === "price") { return gmTokens.sort((a, b) => { @@ -43,8 +48,12 @@ export function sortGmTokensByField({ if (orderBy === "buyable") { return gmTokens.sort((a, b) => { - const mintableA = getMintableMarketTokens(marketsInfoData[a.address], a); - const mintableB = getMintableMarketTokens(marketsInfoData[b.address], b); + const poolA = poolsInfo[a.address]; + const poolB = poolsInfo[b.address]; + + const mintableA = isGlv(poolA) ? getBuyableAmountGlv(poolA) : getMintableMarketTokens(poolA, a); + const mintableB = isGlv(poolB) ? getBuyableAmountGlv(poolB) : getMintableMarketTokens(poolB, b); + return (mintableA?.mintableUsd ?? 0n) > (mintableB?.mintableUsd ?? 0n) ? directionMultiplier : -directionMultiplier; @@ -80,5 +89,5 @@ export function sortGmTokensByField({ }); } - return sortGmTokensDefault(marketsInfoData, marketTokensData); + return sortPoolsTokensDefault(poolsInfo, marketTokensData); } diff --git a/src/components/Synthetics/GmList/sortGmTokensDefault.tsx b/src/components/Synthetics/PoolsList/sortPoolsTokensDefault.tsx similarity index 77% rename from src/components/Synthetics/GmList/sortGmTokensDefault.tsx rename to src/components/Synthetics/PoolsList/sortPoolsTokensDefault.tsx index 0f64ae9220..55d27bae89 100644 --- a/src/components/Synthetics/GmList/sortGmTokensDefault.tsx +++ b/src/components/Synthetics/PoolsList/sortPoolsTokensDefault.tsx @@ -1,8 +1,9 @@ import { entries, values } from "lodash"; import type { Address } from "viem"; -import type { MarketsInfoData } from "domain/synthetics/markets"; +import type { PoolsInfoData } from "domain/synthetics/markets"; import { TokenData, TokensData, convertToUsd } from "domain/synthetics/tokens"; +import { isGlv } from "domain/synthetics/markets/glv"; /** * Sorts GM tokens by: @@ -10,7 +11,7 @@ import { TokenData, TokensData, convertToUsd } from "domain/synthetics/tokens"; * 2. If non-zero balance, by balance descending * 3. If zero balance, by total supply USD descending */ -export function sortGmTokensDefault(marketsInfoData: MarketsInfoData, marketTokensData: TokensData) { +export function sortPoolsTokensDefault(marketsInfoData: PoolsInfoData, marketTokensData: TokensData) { if (marketsInfoData === undefined || marketTokensData === undefined) { return []; } @@ -19,15 +20,19 @@ export function sortGmTokensDefault(marketsInfoData: MarketsInfoData, marketToke [group in Address | "nonZero"]: { tokens: { tokenData: TokenData; totalSupplyUsd: bigint }[]; totalSupplyUsd: bigint; + isGlv: boolean; }; } = {} as any; for (const market of values(marketsInfoData)) { + // if (market.indexTokenAddress === "0xDD06Cd6694FeB4222FD1a4146d118078D672d7EB") { + // debugger; // eslint-disable-line + // } if (market.isDisabled) { continue; } - const marketTokenData = marketTokensData[market.marketTokenAddress]; + const marketTokenData = isGlv(market) ? market.indexToken : marketTokensData[market.marketTokenAddress]; if (!marketTokenData) { continue; @@ -39,10 +44,12 @@ export function sortGmTokensDefault(marketsInfoData: MarketsInfoData, marketToke marketTokenData.prices.minPrice )!; + const isGlvMarket = isGlv(market); + let groupKey: Address | "nonZero"; if (marketTokenData.balance !== undefined && marketTokenData.balance !== 0n) { groupKey = "nonZero"; - } else if (market.isSpotOnly) { + } else if ("isSpotOnly" in market && market.isSpotOnly) { groupKey = market.marketTokenAddress as Address; } else { groupKey = market.indexTokenAddress as Address; @@ -52,6 +59,7 @@ export function sortGmTokensDefault(marketsInfoData: MarketsInfoData, marketToke groupedTokens[groupKey] = { tokens: [], totalSupplyUsd: 0n, + isGlv: isGlvMarket, }; } @@ -90,6 +98,15 @@ export function sortGmTokensDefault(marketsInfoData: MarketsInfoData, marketToke if (bKey === "nonZero") { return 1; } + + // Glv second + if (a.isGlv && !b.isGlv) { + return -1; + } + if (!a.isGlv && b.isGlv) { + return 1; + } + // by total supply descending return a.totalSupplyUsd > b.totalSupplyUsd ? -1 : 1; }) diff --git a/src/components/TokenIcon/TokenIcon.tsx b/src/components/TokenIcon/TokenIcon.tsx index 5d4f0db56b..836dc1ce8e 100644 --- a/src/components/TokenIcon/TokenIcon.tsx +++ b/src/components/TokenIcon/TokenIcon.tsx @@ -12,13 +12,17 @@ type Props = { displaySize: number; importSize?: 24 | 40; className?: string; + badge?: string | readonly [topSymbol: string, bottomSymbol: string]; }; -function TokenIcon({ className, symbol, displaySize, importSize = 24 }: Props) { +function TokenIcon({ className, symbol, displaySize, importSize = 24, badge }: Props) { const iconPath = getIconUrlPath(symbol, importSize); const classNames = cx("Token-icon inline", className); + if (!iconPath) return <>; - return ( + + let sub; + const img = ( ); + + if (badge) { + if (typeof badge === "string") { + sub = ( + + {badge} + + ); + } else { + sub = ( + + {badge[0]} + {badge[0]} + + ); + } + } + + return ( + + {img} + {sub} + + ); } export default TokenIcon; diff --git a/src/config/contracts.ts b/src/config/contracts.ts index 55cc12edf9..7076c4a09d 100644 --- a/src/config/contracts.ts +++ b/src/config/contracts.ts @@ -1,8 +1,8 @@ -import { ethers, ContractRunner, Contract, InterfaceAbi } from "ethers"; -import { ARBITRUM, ARBITRUM_GOERLI, AVALANCHE, AVALANCHE_FUJI, BSС_MAINNET, BSС_TESTNET } from "./chains"; +import { Contract, ContractRunner, ethers, InterfaceAbi } from "ethers"; import { DataStore__factory } from "typechain-types/factories/DataStore__factory"; import { ExchangeRouter__factory } from "typechain-types/factories/ExchangeRouter__factory"; import { Multicall__factory } from "typechain-types/factories/Multicall__factory"; +import { ARBITRUM, ARBITRUM_GOERLI, AVALANCHE, AVALANCHE_FUJI, BSС_MAINNET, BSС_TESTNET } from "./chains"; const { ZeroAddress } = ethers; @@ -304,6 +304,7 @@ const CONTRACTS = { SyntheticsReader: "0xD52216D3A57F7eb1126498f00A4771553c737AE4", SyntheticsRouter: "0x5e7d61e4C52123ADF651961e4833aCc349b61491", Timelock: ZeroAddress, + GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", Multicall: "0x0f53e512b49202a37c81c6085417C9a9005F2196", }, diff --git a/src/config/dataStore.ts b/src/config/dataStore.ts index 958f179cb5..9060337644 100644 --- a/src/config/dataStore.ts +++ b/src/config/dataStore.ts @@ -82,6 +82,31 @@ export const MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT = hashString("MAX_ALLOWED_SUBAC export const SUBACCOUNT_ACTION_COUNT = hashString("SUBACCOUNT_ACTION_COUNT"); export const SUBACCOUNT_ORDER_ACTION = hashString("SUBACCOUNT_ORDER_ACTION"); export const SUBACCOUNT_AUTO_TOP_UP_AMOUNT = hashString("SUBACCOUNT_AUTO_TOP_UP_AMOUNT"); +export const GLV_MAX_MARKET_TOKEN_BALANCE_USD = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_USD"); +export const GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT"); +export const IS_GLV_MARKET_DISABLED = hashString("IS_GLV_MARKET_DISABLED"); +export const GLV_SHIFT_LAST_EXECUTED_AT = hashString("GLV_SHIFT_LAST_EXECUTED_AT"); +export const GLV_SHIFT_MIN_INTERVAL = hashString("GLV_SHIFT_MIN_INTERVAL"); + +export function glvShiftLastExecutedAtKey(glvAddress: string) { + return hashData(["bytes32", "address"], [GLV_SHIFT_LAST_EXECUTED_AT, glvAddress]); +} + +export function glvShiftMinIntervalKey(glvAddress: string) { + return hashData(["bytes32", "address"], [GLV_SHIFT_MIN_INTERVAL, glvAddress]); +} + +export function glvMaxMarketTokenBalanceUsdKey(glvAddress: string, market: string) { + return hashData(["bytes32", "address", "address"], [GLV_MAX_MARKET_TOKEN_BALANCE_USD, glvAddress, market]); +} + +export function glvMaxMarketTokenBalanceAmountKey(glvAddress: string, market: string) { + return hashData(["bytes32", "address", "address"], [GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT, glvAddress, market]); +} + +export function isGlvMarketDisabledKey(glvAddress: string, market: string) { + return hashData(["bytes32", "address", "address"], [IS_GLV_MARKET_DISABLED, glvAddress, market]); +} export function positionImpactFactorKey(market: string, isPositive: boolean) { return hashData(["bytes32", "address", "bool"], [POSITION_IMPACT_FACTOR_KEY, market, isPositive]); diff --git a/src/config/markets.ts b/src/config/markets.ts index 5803fb55a6..61121c23f4 100644 --- a/src/config/markets.ts +++ b/src/config/markets.ts @@ -2,7 +2,7 @@ import { parse } from "date-fns"; import mapValues from "lodash/mapValues"; import { isDevelopment } from "config/env"; -import { ARBITRUM, AVALANCHE, BSС_MAINNET } from "./chains"; +import { ARBITRUM, ARBITRUM_GOERLI, AVALANCHE, AVALANCHE_FUJI, BSС_MAINNET } from "./chains"; const p = (date: string) => parse(date, "dd MMM yyyy", new Date()); @@ -147,3 +147,13 @@ export function getMarketListingDate(chainId: number, marketAddress: string): Da return tokenListing.listingDate; } + +export const GLV_MARKETS = { + [ARBITRUM]: {}, + [ARBITRUM_GOERLI]: {}, + [AVALANCHE]: {}, + [AVALANCHE_FUJI]: { + "0xDD06Cd6694FeB4222FD1a4146d118078D672d7EB": "High Caps", + }, + default: "GLV", +} as const; diff --git a/src/config/tokens.ts b/src/config/tokens.ts index d0c746b4a0..b00ddb79e5 100644 --- a/src/config/tokens.ts +++ b/src/config/tokens.ts @@ -213,23 +213,6 @@ export const TOKENS: { [chainId: number]: Token[] } = { decimals: 18, isPlatformToken: true, }, - { - name: "GMX LP", - symbol: "GLP", - address: getContract(ARBITRUM, "GLP"), - decimals: 18, - imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", - reservesUrl: "https://portfolio.nansen.ai/dashboard/gmx?chain=ARBITRUM", - isPlatformToken: true, - }, - { - name: "GMX Market tokens", - symbol: "GM", - address: "", - decimals: 18, - imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", - isPlatformToken: true, - }, { name: "Wrapped BNB (LayerZero)", symbol: "BNB", @@ -362,6 +345,32 @@ export const TOKENS: { [chainId: number]: Token[] } = { coingeckoUrl: "https://www.coingecko.com/en/coins/shiba-inu", isSynthetic: true, }, + { + name: "GMX LP", + symbol: "GLP", + address: getContract(ARBITRUM, "GLP"), + decimals: 18, + imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", + reservesUrl: "https://portfolio.nansen.ai/dashboard/gmx?chain=ARBITRUM", + isPlatformToken: true, + }, + /** Placeholder tokens */ + { + name: "GMX Market tokens", + symbol: "GM", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", + isPlatformToken: true, + }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, ], [AVALANCHE]: [ { @@ -570,6 +579,7 @@ export const TOKENS: { [chainId: number]: Token[] } = { explorerUrl: "https://snowtrace.io/address/0x9e295B5B976a184B14aD8cd72413aD846C299660", reservesUrl: "https://portfolio.nansen.ai/dashboard/gmx?chain=AVAX", }, + /** Placeholder tokens */ { name: "GMX Market tokens", symbol: "GM", @@ -578,6 +588,14 @@ export const TOKENS: { [chainId: number]: Token[] } = { imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", isPlatformToken: true, }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, ], [ARBITRUM_GOERLI]: [ { @@ -764,6 +782,7 @@ export const TOKENS: { [chainId: number]: Token[] } = { imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", isPlatformToken: true, }, + /** Placeholder tokens */ { name: "GMX Market tokens", symbol: "GM", @@ -772,6 +791,14 @@ export const TOKENS: { [chainId: number]: Token[] } = { imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", isPlatformToken: true, }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, ], [AVALANCHE_FUJI]: [ { @@ -972,6 +999,7 @@ export const TOKENS: { [chainId: number]: Token[] } = { imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", isPlatformToken: true, }, + /** Placeholder tokens */ { name: "GMX Market tokens", symbol: "GM", @@ -980,6 +1008,14 @@ export const TOKENS: { [chainId: number]: Token[] } = { imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", isPlatformToken: true, }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, ], }; diff --git a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx index 6259f71f0c..88de3a3046 100644 --- a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx +++ b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx @@ -34,6 +34,7 @@ import { ReactNode, useCallback, useMemo, useState } from "react"; import { useParams } from "react-router-dom"; import { Context, createContext, useContext, useContextSelector } from "use-context-selector"; import { LeaderboardState, useLeaderboardState } from "./useLeaderboardState"; +import { GlvPoolsData, useGlvPoolsInfo } from "domain/synthetics/tokens/useGlvPools"; export type SyntheticsPageType = | "accounts" @@ -59,6 +60,7 @@ export type SyntheticsState = { uiFeeFactor: bigint; userReferralInfo: UserReferralInfo | undefined; depositMarketTokensData: TokensData | undefined; + glvInfo: ReturnType; closingPositionKey: string | undefined; setClosingPositionKey: (key: string | undefined) => void; @@ -133,6 +135,14 @@ export function SyntheticsStateContextProvider({ isTradePage ); + const isPoolsPage = pageType === "pools" || pageType === "dashboard"; + const glvInfo = useGlvPoolsInfo(isPoolsPage, { + marketsInfoData: marketsInfo.marketsInfoData, + tokensData: marketsInfo.tokensData, + chainId: chainId, + account: account, + }); + const settings = useSettings(); const { isLoading, positionsInfoData } = usePositionsInfoRequest(chainId, { @@ -186,6 +196,7 @@ export function SyntheticsStateContextProvider({ marketsInfo, ordersInfo, positionsConstants, + glvInfo, positionsInfo: { isLoading, positionsInfoData, @@ -243,6 +254,7 @@ export function SyntheticsStateContextProvider({ positionEditorState, confirmationBoxState, depositMarketTokensData, + glvInfo, ]); latestState = state; diff --git a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts index 0adeba7a54..af9a5dba99 100644 --- a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts @@ -15,6 +15,18 @@ export const selectUserReferralInfo = (s: SyntheticsState) => s.globals.userRefe export const selectChainId = (s: SyntheticsState) => s.globals.chainId; export const selectDepositMarketTokensData = (s: SyntheticsState) => s.globals.depositMarketTokensData; +export const selectGlvInfo = (s: SyntheticsState) => s.globals.glvInfo.glvPoolsInfo; +export const selectGlvInfoLoading = (s: SyntheticsState) => s.globals.glvInfo.isLoading; +export const selectPoolsData = createSelector((q) => { + const glvPoolsInfo = q(selectGlvInfo); + const marketsInfoData = q(selectMarketsInfoData); + + return { + ...glvPoolsInfo, + ...marketsInfoData, + }; +}); + export const selectMinCollateralUsd = (s: SyntheticsState) => s.globals.positionsConstants.minCollateralUsd; export const selectMinPositionSizeUsd = (s: SyntheticsState) => s.globals.positionsConstants.minPositionSizeUsd; diff --git a/src/domain/synthetics/markets/glv.spec.ts b/src/domain/synthetics/markets/glv.spec.ts new file mode 100644 index 0000000000..ac8b6f4323 --- /dev/null +++ b/src/domain/synthetics/markets/glv.spec.ts @@ -0,0 +1,41 @@ +import values from "lodash/values"; + +import { MarketInfo } from "domain/synthetics/markets"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; + +import { bigMath } from "lib/bigmath"; + +import { convertToUsd } from "../tokens/utils"; + +export function getBuyableAmountGlv(glv: GlvPoolInfo) { + const glvPriceUsd = glv.indexToken.prices.maxPrice; + + const amountUsd = values(glv.markets).reduce((acc, market) => { + debugger; // eslint-disable-line + return ( + acc + + bigMath.min( + market.maxMarketTokenBalanceUsd, + convertToUsd(market.glvMaxMarketTokenBalanceAmount, glv.indexToken.decimals, glvPriceUsd) ?? 0n + ) + ); + }, 0n); + + return { + mintableAmount: (amountUsd / glvPriceUsd) * 10n ** BigInt(glv.indexToken.decimals), + mintableUsd: amountUsd, + }; +} + +export function isGlv(pool: GlvPoolInfo | MarketInfo): pool is GlvPoolInfo { + return (pool as GlvPoolInfo).isGlv === true; +} + +export function getGlvMarketBadgeName(name: string) { + return name.split(" ").length > 1 + ? name + .split(" ") + .map((w) => w[0].toUpperCase()) + .join("") + : name.slice(0, 3).toUpperCase(); +} diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts new file mode 100644 index 0000000000..c08397f3f1 --- /dev/null +++ b/src/domain/synthetics/markets/glv.ts @@ -0,0 +1,40 @@ +import values from "lodash/values"; + +import { MarketInfo } from "domain/synthetics/markets"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; + +import { bigMath } from "lib/bigmath"; + +import { convertToUsd } from "../tokens/utils"; + +export function getBuyableAmountGlv(glv: GlvPoolInfo) { + const glvPriceUsd = glv.indexToken.prices.maxPrice; + + const amountUsd = values(glv.markets).reduce((acc, market) => { + return ( + acc + + bigMath.min( + market.maxMarketTokenBalanceUsd, + convertToUsd(market.glvMaxMarketTokenBalanceAmount, glv.indexToken.decimals, glvPriceUsd) ?? 0n + ) + ); + }, 0n); + + return { + mintableAmount: (amountUsd / glvPriceUsd) * 10n ** BigInt(glv.indexToken.decimals), + mintableUsd: amountUsd, + }; +} + +export function isGlv(pool: GlvPoolInfo | MarketInfo): pool is GlvPoolInfo { + return (pool as GlvPoolInfo).isGlv === true; +} + +export function getGlvMarketBadgeName(name: string) { + return name.split(" ").length > 1 + ? name + .split(" ") + .map((w) => w[0].toUpperCase()) + .join("") + : name.slice(0, 3).toUpperCase(); +} diff --git a/src/domain/synthetics/markets/types.ts b/src/domain/synthetics/markets/types.ts index 2e25d32c95..a6b7b821fb 100644 --- a/src/domain/synthetics/markets/types.ts +++ b/src/domain/synthetics/markets/types.ts @@ -1,4 +1,5 @@ import { TokenData } from "domain/synthetics/tokens"; +import { GlvPoolInfo } from "../tokens/useGlvPools"; export type PnlFactorType = "FOR_DEPOSITS" | "FOR_WITHDRAWALS" | "FOR_TRADERS"; @@ -133,6 +134,10 @@ export type MarketsInfoData = { [marketAddress: string]: MarketInfo; }; +export type PoolsInfoData = { + [marketAddress: string]: MarketInfo | GlvPoolInfo; +}; + export type MarketTokensAPRData = { [marketTokenAddress: string]: bigint; }; diff --git a/src/domain/synthetics/markets/useGmMarketsApy.ts b/src/domain/synthetics/markets/useGmMarketsApy.ts index 9e83249df6..31c3ebcbee 100644 --- a/src/domain/synthetics/markets/useGmMarketsApy.ts +++ b/src/domain/synthetics/markets/useGmMarketsApy.ts @@ -21,6 +21,8 @@ import { getPoolUsdWithoutPnl } from "domain/synthetics/markets"; import { getTokenBySymbolSafe } from "config/tokens"; import TokenAbi from "abis/Token.json"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { selectGlvInfo } from "context/SyntheticsStateContext/selectors/globalSelectors"; type RawCollectedFee = { cumulativeFeeUsdPerPoolValue: string; @@ -31,7 +33,8 @@ type RawPoolValue = { poolValue: string; }; -type GmTokensAPRResult = { +type GmGlvTokensAPRResult = { + glvApyInfoData: MarketTokensAPRData; marketsTokensIncentiveAprData?: MarketTokensAPRData; marketsTokensLidoAprData?: MarketTokensAPRData; marketsTokensApyData?: MarketTokensAPRData; @@ -202,9 +205,10 @@ function useIncentivesBonusApr(chainId: number, marketsInfoData: MarketsInfoData return marketTokensAPRData; } -export function useGmMarketsApy(chainId: number): GmTokensAPRResult { +export function useGmMarketsApy(chainId: number): GmGlvTokensAPRResult { const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); const { marketsInfoData } = useMarketsInfoRequest(chainId); + const glvPoolsInfo = useSelector(selectGlvInfo); const marketAddresses = useMarketAddresses(marketsInfoData); const client = getSubsquidGraphClient(chainId); @@ -357,7 +361,34 @@ export function useGmMarketsApy(chainId: number): GmTokensAPRResult { const marketsTokensIncentiveAprData = useIncentivesBonusApr(chainId, marketsInfoData); + const glvApyInfoData = useMemo(() => { + if (!glvPoolsInfo || !data?.marketsTokensApyData) { + return {}; + } + + return Object.values(glvPoolsInfo).reduce((acc, { markets, indexTokenAddress }) => { + // @todo recheck when will buy something + const marketData = markets.map((market) => { + const apy = data.marketsTokensApyData[market.address]; + const marketBalance = market.gmBalance; + const amountUsd = marketBalance * (marketTokensData?.[market.address].prices.minPrice ?? 0n); + + return { + apy, + amountUsd, + }; + }); + + const total = marketData.reduce((acc, { amountUsd }) => acc + amountUsd, 0n); + const sumApys = marketData.reduce((acc, { amountUsd, apy }) => acc + amountUsd * apy, 0n); + + acc[indexTokenAddress] = total === 0n ? 0n : sumApys / total; + return acc; + }, {}); + }, [glvPoolsInfo, data?.marketsTokensApyData, marketTokensData]); + return { + glvApyInfoData, marketsTokensLidoAprData: data?.marketsTokensLidoAprData, marketsTokensIncentiveAprData, avgMarketsApy: data?.avgMarketsApy, diff --git a/src/domain/synthetics/markets/utils.ts b/src/domain/synthetics/markets/utils.ts index 82d2e0c958..3f2889054c 100644 --- a/src/domain/synthetics/markets/utils.ts +++ b/src/domain/synthetics/markets/utils.ts @@ -10,6 +10,7 @@ import { PositionInfo } from "../positions"; import { convertToContractTokenPrices, convertToTokenAmount, convertToUsd, getMidPrice } from "../tokens"; import { TokenData, TokensData } from "../tokens/types"; import { ContractMarketPrices, Market, MarketInfo } from "./types"; +import { GLV_MARKETS } from "config/markets"; export function getMarketFullName(p: { longToken: Token; shortToken: Token; indexToken: Token; isSpotOnly: boolean }) { const { indexToken, longToken, shortToken, isSpotOnly } = p; @@ -17,6 +18,10 @@ export function getMarketFullName(p: { longToken: Token; shortToken: Token; inde return `${getMarketIndexName({ indexToken, isSpotOnly })} [${getMarketPoolName({ longToken, shortToken })}]`; } +export function getGlvMarketName(chainId: number, address: string) { + return GLV_MARKETS?.[chainId]?.[address] || GLV_MARKETS.default; +} + export function getMarketIndexName(p: { indexToken: Token; isSpotOnly: boolean }) { const { indexToken, isSpotOnly } = p; diff --git a/src/domain/synthetics/tokens/useGlvPools.ts b/src/domain/synthetics/tokens/useGlvPools.ts new file mode 100644 index 0000000000..137ec3fcfa --- /dev/null +++ b/src/domain/synthetics/tokens/useGlvPools.ts @@ -0,0 +1,292 @@ +import DataStore from "abis/DataStore.json"; +import GlvReader from "abis/GlvReader.json"; +import TokenAbi from "abis/Token.json"; + +import { getContract } from "config/contracts"; +import { + glvMaxMarketTokenBalanceAmountKey, + glvMaxMarketTokenBalanceUsdKey, + glvShiftLastExecutedAtKey, + glvShiftMinIntervalKey, + isGlvMarketDisabledKey, +} from "config/dataStore"; +import { getTokenBySymbol, TOKENS } from "config/tokens"; +import { MulticallRequestConfig, useMulticall } from "lib/multicall"; +import { getGlvMarketName, MarketInfo, MarketsInfoData } from "../markets"; +import { TokenData, TokensData } from "./types"; + +export type GlvList = { + glv: { + glvToken: string; + longToken: string; + shortToken: string; + }; + markets: string[]; +}[]; + +export type GlvPoolsData = { + [key in string]: GlvPoolInfo; +}; + +export interface GlvPoolInfo extends MarketInfo { + isGlv: true; + marketTokenAddress: string; + indexTokenAddress: string; + longTokenAddress: string; + shortTokenAddress: string; + markets: GlvMarket[]; + glvShiftLastExecutedAt: bigint; + glvShiftMinInterval: bigint; +} + +export interface GlvMarket { + address: string; + isDisabled: boolean; + maxMarketTokenBalanceUsd: bigint; + glvMaxMarketTokenBalanceAmount: bigint; + gmBalance: bigint; +} + +type GlvsRequestConfig = MulticallRequestConfig<{ + glvs: { + calls: { + list: { + methodName: string; + params: [string, number, number]; + }; + }; + }; +}>; + +export function useGlvPoolsInfo( + enabled: boolean, + deps: { + marketsInfoData: MarketsInfoData | undefined; + tokensData: TokensData | undefined; + chainId: number; + account: string | undefined; + } +) { + const { marketsInfoData, tokensData, chainId, account } = deps; + const dataStoreAddress = getContract(chainId, "DataStore"); + const glvReaderAddress = getContract(chainId, "GlvReader"); + + const { data: glvs, isLoading: isLoadingGlvs } = useMulticall( + chainId, + "useGlvTokenMarkets", + { + key: enabled ? ["glvMarkets", chainId] : undefined, + request: () => { + return { + glvs: { + contractAddress: glvReaderAddress, + abi: GlvReader.abi, + calls: { + list: { + methodName: "getGlvInfoList", + params: [dataStoreAddress, 0, 100], + }, + }, + }, + }; + }, + parseResponse(result) { + return result.data.glvs.list.returnValues as GlvList; + }, + } + ); + + const shouldRequest = enabled && glvs && marketsInfoData && tokensData && account; + + const { data: glvPoolsInfo, isLoading: isLoadingGlvsInfo } = useMulticall<{}, GlvPoolsData | undefined>( + chainId, + "useGlvMarketsInfos", + { + key: shouldRequest ? ["glvMarketsInfos", chainId, glvs, account] : shouldRequest, + request: () => { + if (!shouldRequest) { + return {}; + } + + const request = glvs.reduce((acc, { glv, markets }) => { + acc[glv.glvToken + "-prices"] = { + contractAddress: glvReaderAddress, + abi: GlvReader.abi, + calls: { + glvTokenPriceMin: { + methodName: "getGlvTokenPrice", + params: [ + dataStoreAddress, + markets, + markets.map((market) => { + return [ + marketsInfoData[market].indexToken.prices.minPrice, + marketsInfoData[market].indexToken.prices.maxPrice, + ]; + }), + [tokensData[glv.longToken].prices.maxPrice, tokensData[glv.longToken].prices.minPrice], + [tokensData[glv.shortToken].prices.maxPrice, tokensData[glv.shortToken].prices.minPrice], + glv.glvToken, + false, + ], + }, + glvTokenPriceMax: { + methodName: "getGlvTokenPrice", + params: [ + dataStoreAddress, + markets, + markets.map((market) => { + return [ + marketsInfoData[market].indexToken.prices.minPrice, + marketsInfoData[market].indexToken.prices.maxPrice, + ]; + }), + [tokensData[glv.longToken].prices.maxPrice, tokensData[glv.longToken].prices.minPrice], + [tokensData[glv.shortToken].prices.maxPrice, tokensData[glv.shortToken].prices.minPrice], + glv.glvToken, + true, + ], + }, + }, + }; + + acc[glv.glvToken + "-tokenData"] = { + contractAddress: glv.glvToken, + abi: TokenAbi.abi, + calls: { + totalSupply: { + methodName: "totalSupply", + params: [], + }, + balance: { + methodName: "balanceOf", + params: [account], + }, + }, + }; + + acc[glv.glvToken + "-info"] = { + contractAddress: dataStoreAddress, + abi: DataStore.abi, + calls: { + glvShiftLastExecutedAt: { + methodName: "getUint", + params: [glvShiftLastExecutedAtKey(glv.glvToken)], + }, + glvShiftMinInterval: { + methodName: "getUint", + params: [glvShiftMinIntervalKey(glv.glvToken)], + }, + }, + }; + + markets.forEach((market) => { + acc[glv.glvToken + "-" + market + "-info"] = { + contractAddress: dataStoreAddress, + abi: DataStore.abi, + calls: { + maxMarketTokenBalanceUsd: { + methodName: "getUint", + params: [glvMaxMarketTokenBalanceUsdKey(glv.glvToken, market)], + }, + glvMaxMarketTokenBalanceAmount: { + methodName: "getUint", + params: [glvMaxMarketTokenBalanceAmountKey(glv.glvToken, market)], + }, + isGlvMarketDisabled: { + methodName: "getBool", + params: [isGlvMarketDisabledKey(glv.glvToken, market)], + }, + }, + }; + }); + + markets.forEach((market) => { + acc[glv.glvToken + "-" + market + "-gm-balance"] = { + contractAddress: market, + abi: TokenAbi.abi, + calls: { + balance: { + methodName: "balanceOf", + params: [glv.glvToken], + }, + }, + }; + }); + + return acc; + }, {}); + + return request; + }, + parseResponse({ data }) { + if (!glvs || !marketsInfoData || !tokensData || !account) { + return undefined; + } + + const result: GlvPoolsData = {}; + glvs.forEach(({ glv, markets }) => { + const pricesMax = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; + const pricesMin = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; + const [priceMin, usdAmountMin, totalSupply] = pricesMax; + const [priceMax, usdAmountMax] = pricesMin; + + const glvName = getGlvMarketName(chainId, glv.glvToken); + + const tokenConfig = getTokenBySymbol(chainId, "GLV"); + + const indexToken: TokenData = { + ...tokenConfig, + address: glv.glvToken, + prices: { + minPrice: priceMin, + maxPrice: priceMax, + }, + totalSupply: totalSupply, + // @todo + usdAmountMax: usdAmountMax, + usdAmountMin: usdAmountMin, + balance: data[glv.glvToken + "-tokenData"].balance.returnValues[0], + ...data[glv.glvToken + "-tokenData"].returnValues, + }; + + result[glv.glvToken] = { + ...glv, + ...data[glv.glvToken + "-info"].returnValues, + isGlv: true, + indexToken: indexToken, + longToken: tokensData[glv.longToken], + shortToken: tokensData[glv.shortToken], + isSpotOnly: false, + indexTokenAddress: glv.glvToken, + marketTokenAddress: glv.glvToken, + longTokenAddress: glv.longToken, + shortTokenAddress: glv.shortToken, + totalSupply, + name: glvName, + isDisabled: markets.every( + (market) => data[glv.glvToken + "-" + market + "-info"].isGlvMarketDisabled.returnValues[0] + ), + markets: markets.map((market) => { + const marketData = data[glv.glvToken + "-" + market + "-info"]; + const marketBalance = data[glv.glvToken + "-" + market + "-gm-balance"].balance.returnValues[0]; + return { + address: market, + isDisabled: marketData.isGlvMarketDisabled.returnValues[0], + maxMarketTokenBalanceUsd: marketData.maxMarketTokenBalanceUsd.returnValues[0], + glvMaxMarketTokenBalanceAmount: marketData.glvMaxMarketTokenBalanceAmount.returnValues[0], + gmBalance: marketBalance, + }; + }), + }; + }); + return result; + }, + } + ); + + return { + glvPoolsInfo, + isLoading: isLoadingGlvs || isLoadingGlvsInfo, + }; +} diff --git a/src/img/ic_glv_40.svg b/src/img/ic_glv_40.svg new file mode 100644 index 0000000000..45f626a9f7 --- /dev/null +++ b/src/img/ic_glv_40.svg @@ -0,0 +1 @@ + diff --git a/src/lib/multicall/useMulticall.ts b/src/lib/multicall/useMulticall.ts index 0b3f3f6bc1..abc23a2cdc 100644 --- a/src/lib/multicall/useMulticall.ts +++ b/src/lib/multicall/useMulticall.ts @@ -121,6 +121,7 @@ export function useMulticall, TResul const response = successDataByChainIdRef.current[chainId]; if (!response) { + console.log("----------->", responseOrFailure); throw new Error(`Multicall response is empty`); } diff --git a/src/pages/MarketPoolsPage/MarketPoolsPage.scss b/src/pages/MarketPoolsPage/MarketPoolsPage.scss index 8e6df094ef..2e5fbda3ad 100644 --- a/src/pages/MarketPoolsPage/MarketPoolsPage.scss +++ b/src/pages/MarketPoolsPage/MarketPoolsPage.scss @@ -4,7 +4,7 @@ } .MarketPoolsPage-content .MarketPoolsPage-swap-box { - max-width: 47.95rem; + max-width: 44rem; width: 100%; } diff --git a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx index 728cf9033b..9ac687a8c6 100644 --- a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx +++ b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx @@ -17,11 +17,11 @@ import SEO from "components/Common/SEO"; import ExternalLink from "components/ExternalLink/ExternalLink"; import Footer from "components/Footer/Footer"; import PageTitle from "components/PageTitle/PageTitle"; -import { GmList } from "components/Synthetics/GmList/GmList"; +import { PoolsList } from "components/Synthetics/PoolsList/PoolsList"; import { getGmSwapBoxAvailableModes } from "components/Synthetics/GmSwap/GmSwapBox/getGmSwapBoxAvailableModes"; import { GmSwapBox } from "components/Synthetics/GmSwap/GmSwapBox/GmSwapBox"; -import { MarketStats } from "components/Synthetics/MarketStats/MarketStats"; +import { MarketStatsWithComposition } from "components/Synthetics/MarketStats/MarketStatsWithComposition"; import "./MarketPoolsPage.scss"; export function MarketPoolsPage() { @@ -33,7 +33,8 @@ export function MarketPoolsPage() { const depositMarketTokensData = useSelector(selectDepositMarketTokensData); const { marketTokensData: withdrawalMarketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); - const { marketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData } = useGmMarketsApy(chainId); + const { marketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, glvApyInfoData } = + useGmMarketsApy(chainId); const [operation, setOperation] = useState(Operation.Deposit); let [mode, setMode] = useState(Mode.Single); @@ -77,11 +78,11 @@ export function MarketPoolsPage() { qa="pools-page" /> -
- +
- Select a Market + Select a Pool
- - diff --git a/tailwind.config.js b/tailwind.config.js index fda0c196e8..7790e5e4ba 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -89,6 +89,7 @@ module.exports = { borderRadius: merge(fromPairs(range(0, 96 + 1).map((borderRadius) => [borderRadius, `${borderRadius}px`])), { full: "9999px", }), + borderWidth: fromPairs(range(0, 8).map((borderWidth) => [borderWidth, `${borderWidth}px`])), fontSize: { 12: "1.2rem", 14: "1.4rem", From 46e81c00cc05f685597da94318bcd6d7366e6501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Thu, 22 Aug 2024 21:10:30 +0400 Subject: [PATCH 02/49] updated .po files --- src/locales/de/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/en/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/es/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/fr/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/ja/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/ko/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/pseudo/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/ru/messages.po | 106 +++++++++++++++++++++++++-------- src/locales/zh/messages.po | 106 +++++++++++++++++++++++++-------- 9 files changed, 720 insertions(+), 234 deletions(-) diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index 8031e21dac..f5144c1a4e 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "PREIS" @@ -196,8 +196,9 @@ msgstr "" msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "Siehe Status." #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "Zu Metamask hinzufügen" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "Tippe auf [Wallet erstellen], um dein Web3 Wallet zu verwenden." @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "MARKT" @@ -971,6 +976,10 @@ msgstr "Staken übermittelt! <0>Status anzeigen." msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "Pool wählen" @@ -1097,6 +1110,10 @@ msgstr "Gehe Long..." msgid "Total Rebates" msgstr "Rabatte insgesamt" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "MÄRKTE" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "Überprüfung des Codes..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "Akzeptiere, dass die Ausführung von Orders nicht garantiert ist und Tri msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "Staken fehlgeschlagen" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "WALLET" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "Reserviert" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "Shorts Nettotarif / 1h" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "Netzwerke" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "POOL" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "Von GMX generierte Gebühren" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "Grund: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "Referral Code Update fehlgeschlagen." #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "Marktverringerung" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<0>Zurück zu <1>Homepage <2>oder <3>Traden" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "Limit Swap ausführen" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "Ökosystem" msgid "High USDG Slippage, Long Anyway" msgstr "Hohe USDG-Abweichung, trotzdem Long" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "GLP Kaufen / Verkaufen" msgid "Open {0} in Explorer" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "GEBÜHREN" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "GMX Perpetuals Daten" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "Konnte Abhebung von {0} {longOrShortText} nicht ausführen" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "Trigger-Preis" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "Swap fehlgeschlagen." +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "Ordergröße ist größer als die Position. Wird nur ausgeführt, wenn sich die Position erhöht" #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "Kaufen" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "Bonus Tokens" msgid "Transaction failed" msgstr "Transaktion fehlgeschlagen" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "Netto-Rate" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "Über" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index 7fbc6894f7..760b0744f7 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "You have an existing order in the {0} market pool.<0><1>Switch to {1} market pool." #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "PRICE" @@ -196,8 +196,9 @@ msgstr "Enable leverage sent." msgid "Show error" msgstr "Show error" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "{0} can be used to buy GM for this market up to the specified buying caps." @@ -249,6 +250,7 @@ msgid "View status." msgstr "View status." #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "Buyable" @@ -533,6 +535,10 @@ msgstr "Add to Metamask" msgid "Insufficient staked tokens" msgstr "Insufficient staked tokens" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "Select a Pool" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "Tap [Create Wallet] to start using your Web3 Wallet." @@ -614,7 +620,6 @@ msgstr "Claim {totalUsd}" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "MARKET" @@ -971,6 +976,10 @@ msgstr "Stake submitted! <0>View status." msgid "Short Liq." msgstr "Short Liq." +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "Buy Fee" @@ -1033,6 +1042,10 @@ msgstr "Vest" msgid "Generating and activating Subaccount" msgstr "Generating and activating Subaccount" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "Select pool" @@ -1097,6 +1110,10 @@ msgstr "Longing..." msgid "Total Rebates" msgstr "Total Rebates" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." @@ -1448,6 +1465,10 @@ msgstr "MARKETS" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "Max {0}" @@ -1713,7 +1734,6 @@ msgstr "Max" msgid "Checking code..." msgstr "Checking code..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "No claims match the selected filters" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "Direction" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." @@ -2943,6 +2965,10 @@ msgstr "The Max Network Fee is set to a higher value to handle potential increas msgid "Start Unrealized PnL" msgstr "Start Unrealized PnL" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "AMOUNT" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "Sending settle request" @@ -3041,7 +3067,7 @@ msgstr "Accept that orders are not guaranteed to execute and trigger orders may msgid "Select a market" msgstr "Select a market" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "Wallet {daysConsidered}d accrued Fees" @@ -3085,6 +3111,10 @@ msgstr "{longShortText} {0} Open Interest" msgid "Subaccount activation failed" msgstr "Subaccount activation failed" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "COMP." + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "You have no GMX tokens to claim." @@ -3255,8 +3285,8 @@ msgstr "You can transfer AVAX from other networks to Avalanche using any of the msgid "Unsupported network" msgstr "Unsupported network" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "Shift" @@ -3314,8 +3344,8 @@ msgstr "The position would be immediately liquidated upon order execution. Try r msgid "Enable" msgstr "Enable" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "BUYABLE" @@ -3935,7 +3965,7 @@ msgid "Stake failed" msgstr "Stake failed" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "WALLET" @@ -3962,7 +3992,7 @@ msgstr "Three tokens create our ecosystem" msgid "Reserved" msgstr "Reserved" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "Available amount to deposit into the specific GM pool." @@ -4005,7 +4035,7 @@ msgstr "Shorts Net Rate / 1h" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "Expected 365d Fees are projected based on past {daysConsidered}d base APY." @@ -4059,6 +4089,7 @@ msgstr "Networks" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "{0}: {1}, Price: {priceDisplay}" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "POOL" @@ -4163,6 +4194,7 @@ msgid "Fees generated by GMX" msgstr "Fees generated by GMX" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." @@ -4217,7 +4249,7 @@ msgstr "Fulfilling buy request" msgid "Reason: {0}" msgstr "Reason: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "Wallet total accrued Fees" @@ -4540,6 +4572,7 @@ msgstr "Referral code updated failed." #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4796,8 +4829,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "There is no liquidation price, as the position's collateral value will increase to cover any negative PnL." #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "Select a Market" +#~ msgid "Select a Market" +#~ msgstr "Select a Market" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4846,7 +4879,7 @@ msgstr "Insufficient liquidity to swap collateral" msgid "Market Decrease" msgstr "Market Decrease" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "Wallet 365d expected Fees" @@ -5130,7 +5163,7 @@ msgstr "Get alerts and announcements from GMX to stay on top of your trades, liq msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "No GM pools found." @@ -5138,6 +5171,10 @@ msgstr "No GM pools found." msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<0>Return to <1>Homepage <2>or <3>Trade" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "Bridge {tokenSymbol} to {chainName} with" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5391,7 +5428,7 @@ msgstr "Execute Limit Swap" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "To purchase GMX on the {0} blockchain, please <0>change your network." -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "{daysConsidered}d accrued Fees" @@ -5415,7 +5452,7 @@ msgstr "Ecosystem" msgid "High USDG Slippage, Long Anyway" msgstr "High USDG Slippage, Long Anyway" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "Wallet total" @@ -5741,8 +5778,9 @@ msgstr "Buy / Sell GLP" msgid "Open {0} in Explorer" msgstr "Open {0} in Explorer" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "{0} and {1} can be used to buy GM for this market up to the specified buying caps." @@ -5804,7 +5842,7 @@ msgstr "FEES" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "TOTAL SUPPLY" @@ -5952,6 +5990,10 @@ msgstr "GMX Perpetuals Data" msgid "Top Positions" msgstr "Top Positions" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "Pools" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "Could not execute withdrawal from {0} {longOrShortText}" @@ -6160,6 +6202,7 @@ msgid "Trigger Price" msgstr "Trigger Price" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "Sellable" @@ -6269,6 +6312,10 @@ msgstr "Realized Base PnL" msgid "Swap failed." msgstr "Swap failed." +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6398,6 +6445,7 @@ msgid "GLP to GM Airdrop" msgstr "GLP to GM Airdrop" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." @@ -6648,6 +6696,7 @@ msgstr "Claim {wrappedTokenSymbol} Rewards" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6739,8 +6788,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "Order size is bigger than position, will only be executable if position increases" #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "Buy" @@ -6827,9 +6876,9 @@ msgstr "Fulfilling shift request" msgid "Referral code submitted!" msgstr "Referral code submitted!" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "APY" @@ -6969,6 +7018,7 @@ msgstr "The Bonus APR will be airdropped as {airdropTokenTitle} tokens. <0>Read #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7131,6 +7181,10 @@ msgstr "Bonus Tokens" msgid "Transaction failed" msgstr "Transaction failed" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "COLLATERAL" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7152,7 +7206,7 @@ msgstr "Net Rate" msgid "2nd Place" msgstr "2nd Place" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." @@ -7213,11 +7267,11 @@ msgstr "Claims History" msgid "About" msgstr "About" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "Total accrued Fees" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "Fee values do not include incentives." @@ -7345,7 +7399,7 @@ msgstr "You do not have any eligible trade during the competition window." msgid "Last 30d" msgstr "Last 30d" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "The fees' USD value is calculated at the time they are accrued and does not include incentives." @@ -7499,8 +7553,8 @@ msgstr "Daily and Cumulative PnL" msgid "Edit {longOrShortText} {0}" msgstr "Edit {longOrShortText} {0}" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "Sell" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index e40cbde5ca..b8eb654131 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "PRECIO" @@ -196,8 +196,9 @@ msgstr "Activación de apalancamiento enviado." msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "Ver estado." #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "Añadir a Metamask" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "Toca [Crear cartera] para empezar a usar tu cartera Web3." @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "MERCADO" @@ -971,6 +976,10 @@ msgstr "Stakeo enviado! <0>Ver estado." msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "Seleccionar reserva" @@ -1097,6 +1110,10 @@ msgstr "Entrando a largo..." msgid "Total Rebates" msgstr "Total de Reembolsos" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "MERCADOS" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "Comprobando código..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "Acepta que las órdenes no tienen garantía de ejecución y que las órd msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "Stakeo fallido" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "MONEDERO" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "Reservado" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "Tasa Neta de Cortos / 1h" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "Redes" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "RESERVA" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "Comisiones generadas por GMX" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "Razón: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "Falló la actualización del código de referido." #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "Disminución del mercado" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<0>Volver a <1>Página inicial <2>o <3>Operar" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "Ejecutar Intercambio Límite" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "Ecosistema" msgid "High USDG Slippage, Long Anyway" msgstr "Alto Deslizamiento de USDG, ir Largo de todas formas" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "Comprar / Vender GLP" msgid "Open {0} in Explorer" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "COMISIONES" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "Datos de Perpetuos GMX" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "No se pudo ejecutar la retirada desde {0} {longOrShortText}" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "Precio de Activación" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "Falló el Intercambio." +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "El tamaño de la orden es mayor que la posición, sólo se ejecutará si la posición se incrementa" #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "Comprar" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "Tokens adicionales" msgid "Transaction failed" msgstr "Transacción fallida" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "Tasa Neta" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "Sobre" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index b5d8a1da9b..456f6fcd49 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "PRIX" @@ -196,8 +196,9 @@ msgstr "Activation du levier envoyée." msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "Voir le statut" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "Ajouter à Metamask" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "Appuyez sur [Créer un portefeuille] pour commencer à utiliser votre portefeuille Web3." @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "MARCHÉ" @@ -971,6 +976,10 @@ msgstr "Staking soumis ! <0>Voir le statut." msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "Sélectionner un pool" @@ -1097,6 +1110,10 @@ msgstr "Long en cours..." msgid "Total Rebates" msgstr "Remise totale" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "MARCHÉS" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "Vérification du code..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "Accepter que les ordres ne sont pas garantis de s'exécuter et que les o msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "Staking échoué" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "PORTEFEUILLE" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "Réservé" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "Taux net Shorts / 1h" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "Réseaux" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "POOL" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "Commissions générées par GMX" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "Raison: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "Baisse du marché" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<0>Retourner à <1>la page d'accueil <2>ou <3>échanger" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "Exécuter l'échange limité" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "Écosystème" msgid "High USDG Slippage, Long Anyway" msgstr "Glissement USDG élevé, longer quand-même" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "Acheter / Vendre GLP" msgid "Open {0} in Explorer" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "FRAIS" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "Données sur les Perpetuals de GMX" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "Impossible d'exécuter ce retrait depuis {0} {longOrShortText}" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "Prix de déclenchement" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "échange échoué." +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "Montant de l'ordre supérieure à la position, il sera exécutable seulement si la position augmente." #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "Acheter" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "Tokens Bonus" msgid "Transaction failed" msgstr "Transaction échouée" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "Taux net" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "À propos" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index ed45af2686..2ac8a17db8 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "価格" @@ -196,8 +196,9 @@ msgstr "レバレッジ有効化申し込み完了。" msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "状況を見る" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "メタマスクに追加" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "ウェブ3ウォレットを使用するには[ウォレットを作成]をタップしてください。" @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "マーケット" @@ -971,6 +976,10 @@ msgstr "ステーク申し込み完了! <0>状況を確認する" msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "プールを選択" @@ -1097,6 +1110,10 @@ msgstr "ロング中..." msgid "Total Rebates" msgstr "リベート総額" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "マーケット" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "コード確認中..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "注文が執行される保証がないこと、トリガー注文がト msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "ステークできませんでした" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "ウォレット" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "リザーブ済" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "1時間あたりのショートネットレート" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "ネットワーク" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "プール" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "GMXが得た手数料" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "理由: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "紹介コードが更新できませんでした。" #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "市場減少" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<0>戻る <1>ホームページへ <2>or <3>トレードへ" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "指値スワップの執行" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "エコシステム" msgid "High USDG Slippage, Long Anyway" msgstr "USDGスリッページが大きいです。ともかくロングする" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "GLPの購入/売却" msgid "Open {0} in Explorer" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "手数料" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "GMXのパーペチュアルのデータ" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "{0} {longOrShortText}からの引き出しを実行できませんでした" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "トリガー価格" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "スワップできませんでした。" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "注文サイズがポジションより大きいため、ポジションが拡大した場合にだけ執行可能です" #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "購入" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "ボーナストークン" msgid "Transaction failed" msgstr "取引に失敗しました" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "ネットレート" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "内容" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 7c10e4e71d..fc13578cac 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "가격" @@ -196,8 +196,9 @@ msgstr "레버리지 유효화 제출 완료" msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "상태 보기." #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "메타마스크에 추가해주세요" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "웹3 지갑을 사용하려면 [지갑 생성]을 탭하세요." @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "마켓" @@ -971,6 +976,10 @@ msgstr "스테이킹 제출완료! <0>상태 보기." msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "풀 선택" @@ -1097,6 +1110,10 @@ msgstr "롱 실행중..." msgid "Total Rebates" msgstr "총 소개 보수" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "마켓" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "코드 확인중..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "주문의 실행이 보장되지 않으며 트리거 주문이 트리거 msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "스테이킹 실패됨" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "지갑이" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "리저브 완료" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "숏 순율 / 1시간" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "네트워크" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "풀" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "GMX로 획득한 수수료" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "이유: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "추천인 코드 업데이트 실패." #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "시장 감소" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<1>홈페이지 <2>혹은 <3>트레이드 페이지<0>로 돌아가기" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "지정가 스왑 실행" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "이코시스템" msgid "High USDG Slippage, Long Anyway" msgstr "높은 USDG 슬리피지 상관 없이 롱 포지션 체결" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "GLP 구매 / 판매" msgid "Open {0} in Explorer" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "수수료" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "GMX 파생상품 데이터" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "{0} {longOrShortText}의 인출을 실행시키지 못했습니다" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "트리거 가격" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "스왑 실패." +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "주문의 사이즈가 포지션을 초과했습니다. 포지션을 증가하는 경우에만 실행 가능합니다." #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "구매" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "보너스 토큰" msgid "Transaction failed" msgstr "트랜잭션 실패" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "순 수수료율" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "대하여" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index 3b6ee5bf08..3b4e5b8ca9 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "" @@ -196,8 +196,9 @@ msgstr "" msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "" @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "" @@ -971,6 +976,10 @@ msgstr "" msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "" @@ -1097,6 +1110,10 @@ msgstr "" msgid "Total Rebates" msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "" msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "" msgid "High USDG Slippage, Long Anyway" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "" msgid "Open {0} in Explorer" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "" #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "" msgid "Transaction failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index f907767de3..240e96af87 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "ЦЕНА" @@ -196,8 +196,9 @@ msgstr "Активировать отправку рычага." msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "Посмотреть статус" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "Добавить в MetaMask" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "Нажмите [Создать кошелек], чтобы начать использовать ваш Web3 кошелек." @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "РЫНОК" @@ -971,6 +976,10 @@ msgstr "Стакинг принята! <0>Смотреть статус." msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "Выбрать пул" @@ -1097,6 +1110,10 @@ msgstr "Лонгин..." msgid "Total Rebates" msgstr "Всего Ребайтов" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "РЫНКИ" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "Проверка кода..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "Принять, что исполнение ордеров не гара msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "Стакинг не прошла" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "КОШЕЛЁК" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "Зарезервировано" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "Чистая ставка шортов / 1ч" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "Сети" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "ПУЛ" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "Комиссионные, сгенерированные GMX" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "Причина: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "Обновление реферального кода не прошло #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "Уменьшение рынка" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<0>Вернуться к <1>Домашняя страница <2>или <3> Торговля" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "Исполнение лимитного обмена" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "msgstr" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "Экосистема" msgid "High USDG Slippage, Long Anyway" msgstr "Высокое Скольжение USDG, Лонг в Любом случае" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "Купить / Продать GLP" msgid "Open {0} in Explorer" msgstr "Открыть {0} в Explorer" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "СБОРЫ" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "Данные по Бессрочным контрактам GMX" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "Не удалось выполнить вывод из {0} {longOrShortText}" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "Цена триггера" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "Обмен не выполнен" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "Размер ордера больше позиции, будет исполнен только при увеличении позиции." #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "Купить" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "Бонусные токены" msgid "Transaction failed" msgstr "Транзакция не прошла" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "Чистая ставка" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "О проекте" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 4f6644f227..8d675fd4ab 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -47,8 +47,8 @@ msgid "You have an existing order in the {0} market pool.<0><1>Switch to {1} mar msgstr "" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "PRICE" msgstr "价钱" @@ -196,8 +196,9 @@ msgstr "启用杠杆发送" msgid "Show error" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -249,6 +250,7 @@ msgid "View status." msgstr "查看状况" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -533,6 +535,10 @@ msgstr "添加到Metamask" msgid "Insufficient staked tokens" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "Select a Pool" +msgstr "" + #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "Tap [Create Wallet] to start using your Web3 Wallet." msgstr "点击[创建钱包]开始使用您的Web3钱包" @@ -614,7 +620,6 @@ msgstr "" #: src/components/Synthetics/AccruedPositionPriceImpactRebateModal/AccruedPositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "MARKET" msgstr "市场" @@ -971,6 +976,10 @@ msgstr "质押送出! <0>查看状况" msgid "Short Liq." msgstr "" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "Buy Fee" msgstr "" @@ -1033,6 +1042,10 @@ msgstr "" msgid "Generating and activating Subaccount" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Shifting from GLV to another pool is not possible, as GLV can only be sold into individual tokens. However, you can buy GLV tokens without incurring buying fees by using eligible GM pool tokens." +msgstr "" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Select pool" msgstr "选择池子" @@ -1097,6 +1110,10 @@ msgstr "做多中" msgid "Total Rebates" msgstr "返利总额" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +msgstr "" + #: src/components/Synthetics/PositionItem/PositionItem.tsx msgid "Negative Funding Fees are settled against the collateral automatically and will influence the liquidation price. Positive Funding Fees can be claimed under Claimable Funding after realizing any action on the position." msgstr "" @@ -1448,6 +1465,10 @@ msgstr "市场" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Max {0}" msgstr "" @@ -1713,7 +1734,6 @@ msgstr "" msgid "Checking code..." msgstr "检查代码..." -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "GM Pools" @@ -2743,6 +2763,7 @@ msgstr "" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/MarketCard/MarketCard.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderItem/OrderItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -2882,6 +2903,7 @@ msgid "Direction" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -2943,6 +2965,10 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "AMOUNT" +msgstr "" + #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" msgstr "" @@ -3041,7 +3067,7 @@ msgstr "接受订单不保证执行,触发订单可能不按触发价格结算 msgid "Select a market" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet {daysConsidered}d accrued Fees" msgstr "" @@ -3085,6 +3111,10 @@ msgstr "" msgid "Subaccount activation failed" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COMP." +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." msgstr "" @@ -3255,8 +3285,8 @@ msgstr "" msgid "Unsupported network" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Shift" msgstr "" @@ -3314,8 +3344,8 @@ msgstr "" msgid "Enable" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "BUYABLE" msgstr "" @@ -3932,7 +3962,7 @@ msgid "Stake failed" msgstr "质押失败" #: src/components/Glp/GlpSwap.js -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "WALLET" msgstr "钱包" @@ -3959,7 +3989,7 @@ msgstr "" msgid "Reserved" msgstr "储备" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Available amount to deposit into the specific GM pool." msgstr "" @@ -4002,7 +4032,7 @@ msgstr "做空净率 / 1h" msgid "Purchase <0>GM Tokens to earn fees from swaps and leverage trading." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Expected 365d Fees are projected based on past {daysConsidered}d base APY." msgstr "" @@ -4056,6 +4086,7 @@ msgstr "网络" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" msgstr "池子" @@ -4160,6 +4191,7 @@ msgid "Fees generated by GMX" msgstr "费用由GMX所产生" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM can be sold for {0} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." msgstr "" @@ -4214,7 +4246,7 @@ msgstr "" msgid "Reason: {0}" msgstr "原因: {0}" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total accrued Fees" msgstr "" @@ -4537,6 +4569,7 @@ msgstr "推荐代码更新失败" #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -4793,8 +4826,8 @@ msgid "There is no liquidation price, as the position's collateral value will in msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Select a Market" -msgstr "" +#~ msgid "Select a Market" +#~ msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Min. required Collateral" @@ -4843,7 +4876,7 @@ msgstr "" msgid "Market Decrease" msgstr "市场减少" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet 365d expected Fees" msgstr "" @@ -5127,7 +5160,7 @@ msgstr "" msgid "<0>{0} is required for collateral.<1>Swap amount from {1} to {2} exceeds {3} acceptable amount. Reduce the \"Pay\" size, or use {4} as the \"Pay\" token to use it for collateral.<2>You can buy {5} on 1inch." msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "No GM pools found." msgstr "" @@ -5135,6 +5168,10 @@ msgstr "" msgid "<0>Return to <1>Homepage <2>or <3>Trade" msgstr "<0>返回 <1>主页 <2>or <3>交易" +#: src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +msgid "Bridge {tokenSymbol} to {chainName} with" +msgstr "" + #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js #: src/components/Exchange/SwapBox.js @@ -5388,7 +5425,7 @@ msgstr "执行限价交换" msgid "To purchase GMX on the {0} blockchain, please <0>change your network." msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "{daysConsidered}d accrued Fees" msgstr "" @@ -5412,7 +5449,7 @@ msgstr "生态系统" msgid "High USDG Slippage, Long Anyway" msgstr "高 USDG 滑点,继续做多" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Wallet total" msgstr "" @@ -5735,8 +5772,9 @@ msgstr "购买/出售GLP" msgid "Open {0} in Explorer" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/PoolsList/MintableAmount.tsx msgid "{0} and {1} can be used to buy GM for this market up to the specified buying caps." msgstr "" @@ -5798,7 +5836,7 @@ msgstr "费用" msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}<5>[{toPoolName}]" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "TOTAL SUPPLY" msgstr "" @@ -5946,6 +5984,10 @@ msgstr "GMX永续产品数据" msgid "Top Positions" msgstr "" +#: src/components/Synthetics/PoolsList/PoolsList.tsx +msgid "Pools" +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not execute withdrawal from {0} {longOrShortText}" msgstr "无法执行提取{0} {longOrShortText}" @@ -6154,6 +6196,7 @@ msgid "Trigger Price" msgstr "触发价格" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6263,6 +6306,10 @@ msgstr "" msgid "Swap failed." msgstr "交易失败" +#: src/components/Synthetics/MarketStats/MarketDescription.tsx +msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." +msgstr "" + #: src/components/Exchange/PositionSeller.js #: src/components/Exchange/SwapBox.js #: src/domain/synthetics/trade/utils/validation.ts @@ -6392,6 +6439,7 @@ msgid "GLP to GM Airdrop" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "GM token pricing includes price impact pool amounts, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6642,6 +6690,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV2.tsx @@ -6733,8 +6782,8 @@ msgid "Order size is bigger than position, will only be executable if position i msgstr "订单规模大于头寸,只有在头寸增加的情况下才会执行" #: src/components/Header/AppHeaderLinks.tsx -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Buy" msgstr "购买" @@ -6821,9 +6870,9 @@ msgstr "" msgid "Referral code submitted!" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" msgstr "" @@ -6963,6 +7012,7 @@ msgstr "" #: src/components/Glp/GlpSwap.js #: src/components/Migration/Migration.js #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js #: src/pages/Stake/StakeV1.js @@ -7125,6 +7175,10 @@ msgstr "奖励代币" msgid "Transaction failed" msgstr "交易失败" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "COLLATERAL" +msgstr "" + #: src/components/Exchange/PositionEditor.js #: src/pages/Stake/StakeV2.tsx msgid "Depositing..." @@ -7146,7 +7200,7 @@ msgstr "净率" msgid "2nd Place" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx +#: src/components/Synthetics/PoolsList/ApyTooltipContent.tsx msgid "<0>The APY is an estimate based on the fees collected for the past seven days, extrapolating the current borrowing fee. It excludes:<1><2>price changes of the underlying token(s)<3>traders' PnL, which is expected to be neutral in the long term<4>funding fees, which are exchanged between traders<5><6>Read more about GM token pricing.<7>Check GM pools' performance against other LP Positions in the <8>GMX Dune Dashboard." msgstr "" @@ -7207,11 +7261,11 @@ msgstr "" msgid "About" msgstr "关于" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Total accrued Fees" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "Fee values do not include incentives." msgstr "" @@ -7339,7 +7393,7 @@ msgstr "" msgid "Last 30d" msgstr "" -#: src/components/GmTokensBalanceInfo/GmTokensBalanceInfo.tsx +#: src/components/Synthetics/PoolsList/TokensBalanceInfo.tsx msgid "The fees' USD value is calculated at the time they are accrued and does not include incentives." msgstr "" @@ -7493,8 +7547,8 @@ msgstr "" msgid "Edit {longOrShortText} {0}" msgstr "" -#: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "Sell" msgstr "" From cdd335632d5be043b586bba4200e327d9d7e2b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Mon, 26 Aug 2024 21:51:02 +0400 Subject: [PATCH 03/49] added GLV card in /pools and updated GmSwapBox for GLV --- src/abis/GlvRouter.json | 613 ++++++++++++++++++ .../MarketSelector/GmSelectorForGlv.tsx | 252 +++++++ .../MarketSelector/PoolListItem.tsx | 152 +++++ .../MarketSelector/PoolSelector.tsx | 187 +----- src/components/MarketSelector/types.tsx | 33 + .../GmAssetDropdown/GmAssetDropdown.tsx | 14 +- .../GmDepositWithdrawalBox.tsx | 316 ++++----- .../GmDepositWithdrawalBox/InfoRows.tsx | 69 +- .../GmDepositWithdrawalBox/useFees.tsx | 73 +++ .../useGmDepositWithdrawalBoxState.tsx | 4 - .../useSubmitButtonState.tsx | 477 ++++++++++++++ .../useUpdateInputAmounts.tsx | 33 +- .../Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx | 43 +- .../MarketStatsWithComposition.tsx | 574 ++++++++-------- .../MarketStats/components/CompositionBar.tsx | 74 +++ .../components/CompositionTable.tsx | 182 ++++++ .../{ => components}/MarketDescription.tsx | 12 +- .../useMarketGlvGmMarketsCompositions.ts | 54 ++ .../hooks/useMarketMintableTokens.ts | 14 + .../hooks/useMarketSellableToken.ts | 19 + .../MarketTokenSelector.tsx | 21 +- .../Synthetics/PoolsList/PoolsList.tsx | 8 +- .../PoolsList/sortPoolsTokensByField.tsx | 8 +- src/config/contracts.ts | 12 + src/config/localStorage.ts | 5 + .../SyntheticsStateContextProvider.tsx | 18 +- .../selectors/globalSelectors.ts | 6 +- .../synthetics/markets/createDepositTxn.ts | 104 +++ src/domain/synthetics/markets/glv.spec.ts | 2 +- src/domain/synthetics/markets/glv.ts | 66 +- src/domain/synthetics/markets/types.ts | 6 +- .../synthetics/markets/useGmMarketsApy.ts | 10 +- .../synthetics/markets/useMarketTokensData.ts | 27 +- src/domain/synthetics/markets/utils.ts | 17 +- src/domain/synthetics/tokens/useGlvPools.ts | 84 ++- .../trade/useAvailableTokenOptions.ts | 5 + .../trade/useSortedPoolsWithIndexToken.ts | 38 +- src/domain/synthetics/trade/utils/deposit.ts | 1 + src/lib/multicall/useMulticall.ts | 1 - src/lib/numbers.ts | 13 +- src/locales/de/messages.po | 133 +++- src/locales/en/messages.po | 133 +++- src/locales/es/messages.po | 133 +++- src/locales/fr/messages.po | 133 +++- src/locales/ja/messages.po | 133 +++- src/locales/ko/messages.po | 133 +++- src/locales/pseudo/messages.po | 133 +++- src/locales/ru/messages.po | 133 +++- src/locales/zh/messages.po | 133 +++- src/pages/MarketPoolsPage/MarketPoolsPage.tsx | 36 +- 50 files changed, 4029 insertions(+), 851 deletions(-) create mode 100644 src/abis/GlvRouter.json create mode 100644 src/components/MarketSelector/GmSelectorForGlv.tsx create mode 100644 src/components/MarketSelector/PoolListItem.tsx create mode 100644 src/components/MarketSelector/types.tsx create mode 100644 src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx create mode 100644 src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx create mode 100644 src/components/Synthetics/MarketStats/components/CompositionBar.tsx create mode 100644 src/components/Synthetics/MarketStats/components/CompositionTable.tsx rename src/components/Synthetics/MarketStats/{ => components}/MarketDescription.tsx (84%) create mode 100644 src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts create mode 100644 src/components/Synthetics/MarketStats/hooks/useMarketMintableTokens.ts create mode 100644 src/components/Synthetics/MarketStats/hooks/useMarketSellableToken.ts diff --git a/src/abis/GlvRouter.json b/src/abis/GlvRouter.json new file mode 100644 index 0000000000..786301ad78 --- /dev/null +++ b/src/abis/GlvRouter.json @@ -0,0 +1,613 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "GlvRouter", + "sourceName": "contracts/router/GlvRouter.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "contract Router", + "name": "_router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "_dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "_eventEmitter", + "type": "address" + }, + { + "internalType": "contract IGlvHandler", + "name": "_glvHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "_externalHandler", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "EmptyGlvDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvWithdrawal", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "InvalidNativeTokenSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelGlvDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelGlvWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDepositUtils.CreateGlvDepositParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvDeposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawalUtils.CreateGlvWithdrawalParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvWithdrawal", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glvHandler", + "outputs": [ + { + "internalType": "contract IGlvHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "name": "makeExternalCalls", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteGlvDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteGlvWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + } + \ No newline at end of file diff --git a/src/components/MarketSelector/GmSelectorForGlv.tsx b/src/components/MarketSelector/GmSelectorForGlv.tsx new file mode 100644 index 0000000000..caf92ca6e6 --- /dev/null +++ b/src/components/MarketSelector/GmSelectorForGlv.tsx @@ -0,0 +1,252 @@ +import { t } from "@lingui/macro"; +import cx from "classnames"; +import { useCallback, useMemo, useState } from "react"; +import { BiChevronDown } from "react-icons/bi"; + +import { getNormalizedTokenSymbol } from "config/tokens"; +import { MarketInfo, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; +import { convertToUsd } from "domain/synthetics/tokens"; +import { + gmTokensFavoritesTabOptionLabels, + gmTokensFavoritesTabOptions, +} from "domain/synthetics/tokens/useGmTokensFavorites"; +import { useLocalizedMap } from "lib/i18n"; +import { getByKey } from "lib/objects"; + +import SearchInput from "components/SearchInput/SearchInput"; +import Tab from "components/Tab/Tab"; +import TokenIcon from "components/TokenIcon/TokenIcon"; +import Modal from "../Modal/Modal"; + +import { useGlvGmMarketsWithComposition } from "components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; + +import "./MarketSelector.scss"; +import { CommonPoolSelectorProps, MarketOption } from "./types"; +import { PoolListItem } from "./PoolListItem"; + +type Props = Omit & { + isDeposit: boolean; + glvMarketInfo?: GlvPoolInfo; + onSelectGmMarket?: (market: MarketInfo) => void; +}; + +export function GmPoolsSelector({ + className, + isDeposit, + label, + isSideMenu, + marketTokensData, + selectedMarketAddress, + showBalances, + onSelectGmMarket, + getMarketState, + showAllPools = false, + showIndexIcon = false, + favoriteTokens, + glvMarketInfo, + setFavoriteTokens, + tab, + setTab, +}: Props) { + const [isModalVisible, setIsModalVisible] = useState(false); + const [searchKeyword, setSearchKeyword] = useState(""); + + const markets = useGlvGmMarketsWithComposition(isDeposit, glvMarketInfo?.marketTokenAddress); + + const localizedTabOptionLabels = useLocalizedMap(gmTokensFavoritesTabOptionLabels); + + const marketsOptions: MarketOption[] = useMemo(() => { + const allMarkets = + markets + .map((market) => { + const gmMarketInfo = market.pool; + + if (!gmMarketInfo) { + return null; + } + + const gmMarketInfoInGlv = glvMarketInfo?.markets.find((m) => { + return m.address === gmMarketInfo.marketTokenAddress; + }); + + const indexName = getMarketIndexName(gmMarketInfo); + const marketToken = getByKey(marketTokensData, gmMarketInfo.marketTokenAddress); + const gmBalance = gmMarketInfoInGlv?.gmBalance; + const gmBalanceUsd = convertToUsd(marketToken?.balance, marketToken?.decimals, marketToken?.prices.minPrice); + const state = getMarketState?.(gmMarketInfo); + + return { + indexName, + poolName: indexName, + name: gmMarketInfo.name, + marketInfo: gmMarketInfo, + balance: gmBalance ?? 0n, + balanceUsd: gmBalanceUsd ?? 0n, + state, + }; + }) + .filter(Boolean as unknown as (value: T | null) => value is T) ?? []; + + const marketsWithBalance: MarketOption[] = []; + const marketsWithoutBalance: MarketOption[] = []; + + for (const market of allMarkets) { + if (market.balance > 0) { + marketsWithBalance.push(market); + } else { + marketsWithoutBalance.push(market); + } + } + + const sortedMartketsWithBalance = marketsWithBalance.sort((a, b) => { + return (b.balanceUsd ?? 0n) > (a.balanceUsd ?? 0n) ? 1 : -1; + }); + + return [...sortedMartketsWithBalance, ...marketsWithoutBalance]; + }, [getMarketState, marketTokensData, markets, glvMarketInfo]); + + const selectedPool = useMemo( + () => marketsOptions.find((option) => option.marketInfo.marketTokenAddress === selectedMarketAddress), + [marketsOptions, selectedMarketAddress] + ); + + const marketInfo = selectedPool?.marketInfo; + + const filteredOptions = useMemo(() => { + const lowercaseSearchKeyword = searchKeyword.toLowerCase(); + return marketsOptions.filter((option) => { + const name = option.name.toLowerCase(); + const textSearchMatch = name.includes(lowercaseSearchKeyword); + + const favoriteMatch = tab === "favorites" ? favoriteTokens?.includes(option.marketInfo.marketTokenAddress) : true; + + return textSearchMatch && favoriteMatch; + }); + }, [favoriteTokens, marketsOptions, searchKeyword, tab]); + + const onSelectGmPool = useCallback( + function onSelectOption(option: MarketOption) { + onSelectGmMarket?.(option.marketInfo); + setIsModalVisible(false); + }, + [onSelectGmMarket, setIsModalVisible] + ); + + const _handleKeyDown = useCallback( + (e) => { + if (e.key === "Enter") { + e.preventDefault(); + e.stopPropagation(); + if (filteredOptions.length > 0) { + onSelectGmPool(filteredOptions[0]); + } + } + }, + [onSelectGmPool, filteredOptions] + ); + + const handleFavoriteClick = useCallback( + (address: string): void => { + if (favoriteTokens.includes(address)) { + setFavoriteTokens(favoriteTokens.filter((token) => token !== address)); + } else { + setFavoriteTokens([...favoriteTokens, address]); + } + }, + [favoriteTokens, setFavoriteTokens] + ); + + const handleSearch = useCallback((e: React.ChangeEvent) => { + setSearchKeyword(e.target.value); + }, []); + + function displayPoolLabel(marketInfo: MarketInfo | undefined) { + if (!marketInfo) return "..."; + + if (glvMarketInfo) { + return ( +
setIsModalVisible(true)}> + {getMarketIndexName(marketInfo)} [{getMarketPoolName(marketInfo)}] + +
+ ); + } + + const name = showAllPools ? `GM: ${getMarketIndexName(marketInfo)}` : getMarketPoolName(marketInfo); + + if (marketsOptions?.length > 1) { + return ( +
setIsModalVisible(true)}> + {name ? name : "..."} + +
+ ); + } + + return
{name ? name : "..."}
; + } + + return ( +
+ + } + > + + +
+ {filteredOptions.map((option, marketIndex) => ( + + ))} +
+
+ + {marketInfo && ( +
+ {showIndexIcon && ( + + )} + {displayPoolLabel(marketInfo)} +
+ )} +
+ ); +} diff --git a/src/components/MarketSelector/PoolListItem.tsx b/src/components/MarketSelector/PoolListItem.tsx new file mode 100644 index 0000000000..ff0f0599fb --- /dev/null +++ b/src/components/MarketSelector/PoolListItem.tsx @@ -0,0 +1,152 @@ +import cx from "classnames"; +import { useCallback } from "react"; + +import { getNormalizedTokenSymbol } from "config/tokens"; +import { MarketInfo } from "domain/synthetics/markets"; +import { TokenData } from "domain/synthetics/tokens"; +import { formatTokenAmount, formatUsd } from "lib/numbers"; + +import FavoriteStar from "components/FavoriteStar/FavoriteStar"; +import TokenIcon from "components/TokenIcon/TokenIcon"; +import TooltipWithPortal from "../Tooltip/TooltipWithPortal"; + +import { isGlv } from "domain/synthetics/markets/glv"; +import { MarketOption, MarketState } from "./types"; + +export function PoolListItem(props: { + marketInfo: MarketInfo; + marketToken?: TokenData; + poolName: string; + balance: bigint; + balanceUsd: bigint; + indexName: string; + state?: MarketState; + isFavorite: boolean; + isInFirstHalf: boolean; + showAllPools?: boolean; + showBalances?: boolean; + onFavoriteClick: (address: string) => void; + onSelectOption: (option: MarketOption) => void; +}) { + const { + marketInfo, + poolName, + balance, + balanceUsd, + indexName, + state = {}, + marketToken, + isFavorite, + isInFirstHalf, + showAllPools, + showBalances, + onFavoriteClick, + onSelectOption, + } = props; + const { longToken, shortToken, indexToken } = marketInfo; + + const indexTokenImage = marketInfo.isSpotOnly + ? getNormalizedTokenSymbol(longToken.symbol) + getNormalizedTokenSymbol(shortToken.symbol) + : getNormalizedTokenSymbol(indexToken.symbol); + + const handleFavoriteClick = (event: React.MouseEvent) => { + event.stopPropagation(); + onFavoriteClick(marketInfo.marketTokenAddress); + }; + + const handleClick = useCallback(() => { + if (state.disabled) { + return; + } + + onSelectOption({ + marketInfo, + indexName, + poolName, + balance, + balanceUsd, + state, + name: marketInfo.name, + }); + }, [balance, balanceUsd, indexName, marketInfo, onSelectOption, poolName, state]); + + return ( +
+ {state.disabled && state.message && ( + } + position={isInFirstHalf ? "bottom" : "top"} + disableHandleStyle + closeOnDoubleClick + fitHandleWidth + content={state.message} + /> + )} +
+
+ {showAllPools ? ( + + ) : ( + <> + + {shortToken && ( + + )} + + )} +
+
+
+ {isGlv(marketInfo) ? ( +
+ GLV: {marketInfo.name} + [{poolName}] +
+ ) : showAllPools ? ( +
+ {indexName && indexName} + {poolName && `[${poolName}]`} +
+ ) : ( +
{poolName}
+ )} +
+
+
+
+
+ {(showBalances && balance !== undefined && ( +
+ {balance > 0 + ? formatTokenAmount(balance, marketToken?.decimals, "GM", { + useCommas: true, + }) + : "-"} +
+ )) || + null} + + {(showBalances && balanceUsd !== undefined && balanceUsd > 0 &&
{formatUsd(balanceUsd)}
) || null} +
+
+
+ +
+
+
+ ); +} diff --git a/src/components/MarketSelector/PoolSelector.tsx b/src/components/MarketSelector/PoolSelector.tsx index 0bf1bf852e..a336d5d2c8 100644 --- a/src/components/MarketSelector/PoolSelector.tsx +++ b/src/components/MarketSelector/PoolSelector.tsx @@ -5,54 +5,25 @@ import { BiChevronDown } from "react-icons/bi"; import { getNormalizedTokenSymbol } from "config/tokens"; import { MarketInfo, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; -import { TokenData, TokensData, convertToUsd } from "domain/synthetics/tokens"; +import { convertToUsd } from "domain/synthetics/tokens"; import { - GmTokensFavoritesContextType, gmTokensFavoritesTabOptionLabels, gmTokensFavoritesTabOptions, } from "domain/synthetics/tokens/useGmTokensFavorites"; import { useLocalizedMap } from "lib/i18n"; -import { formatTokenAmount, formatUsd } from "lib/numbers"; import { getByKey } from "lib/objects"; -import FavoriteStar from "components/FavoriteStar/FavoriteStar"; import SearchInput from "components/SearchInput/SearchInput"; import Tab from "components/Tab/Tab"; import TokenIcon from "components/TokenIcon/TokenIcon"; import Modal from "../Modal/Modal"; -import TooltipWithPortal from "../Tooltip/TooltipWithPortal"; -import "./MarketSelector.scss"; - -type Props = { - label?: string; - className?: string; - selectedMarketAddress?: string; - selectedIndexName?: string; - markets: MarketInfo[]; - marketTokensData?: TokensData; - showBalances?: boolean; - isSideMenu?: boolean; - getMarketState?: (market: MarketInfo) => MarketState | undefined; - onSelectMarket: (market: MarketInfo) => void; - showAllPools?: boolean; - showIndexIcon?: boolean; -} & GmTokensFavoritesContextType; +import { isGlv } from "domain/synthetics/markets/glv"; -type MarketState = { - disabled?: boolean; - message?: string; -}; +import { CommonPoolSelectorProps, MarketOption } from "./types"; -type MarketOption = { - indexName: string; - poolName: string; - name: string; - marketInfo: MarketInfo; - balance: bigint; - balanceUsd: bigint; - state?: MarketState; -}; +import "./MarketSelector.scss"; +import { PoolListItem } from "./PoolListItem"; export function PoolSelector({ selectedMarketAddress, @@ -71,7 +42,7 @@ export function PoolSelector({ setFavoriteTokens, tab, setTab, -}: Props) { +}: CommonPoolSelectorProps) { const [isModalVisible, setIsModalVisible] = useState(false); const [searchKeyword, setSearchKeyword] = useState(""); @@ -165,7 +136,18 @@ export function PoolSelector({ function displayPoolLabel(marketInfo: MarketInfo | undefined) { if (!marketInfo) return "..."; - const name = showAllPools ? `GM: ${getMarketIndexName(marketInfo)}` : getMarketPoolName(marketInfo); + const name = showAllPools + ? `${marketInfo.indexToken.symbol}: ${getMarketIndexName(marketInfo)}` + : getMarketPoolName(marketInfo); + + if (isGlv(marketInfo)) { + return ( +
setIsModalVisible(true)}> + GLV: {marketInfo.name} + +
+ ); + } if (marketsOptions?.length > 1) { return ( @@ -242,136 +224,3 @@ export function PoolSelector({
); } - -function PoolListItem(props: { - marketInfo: MarketInfo; - marketToken?: TokenData; - poolName: string; - balance: bigint; - balanceUsd: bigint; - indexName: string; - state?: MarketState; - isFavorite: boolean; - isInFirstHalf: boolean; - showAllPools?: boolean; - showBalances?: boolean; - onFavoriteClick: (address: string) => void; - onSelectOption: (option: MarketOption) => void; -}) { - const { - marketInfo, - poolName, - balance, - balanceUsd, - indexName, - state = {}, - marketToken, - isFavorite, - isInFirstHalf, - showAllPools, - showBalances, - onFavoriteClick, - onSelectOption, - } = props; - const { longToken, shortToken, indexToken } = marketInfo; - - const indexTokenImage = marketInfo.isSpotOnly - ? getNormalizedTokenSymbol(longToken.symbol) + getNormalizedTokenSymbol(shortToken.symbol) - : getNormalizedTokenSymbol(indexToken.symbol); - - const handleFavoriteClick = (event: React.MouseEvent) => { - event.stopPropagation(); - onFavoriteClick(marketInfo.marketTokenAddress); - }; - - const handleClick = useCallback(() => { - if (state.disabled) { - return; - } - - onSelectOption({ - marketInfo, - indexName, - poolName, - balance, - balanceUsd, - state, - name: marketInfo.name, - }); - }, [balance, balanceUsd, indexName, marketInfo, onSelectOption, poolName, state]); - - return ( -
- {state.disabled && state.message && ( - } - position={isInFirstHalf ? "bottom" : "top"} - disableHandleStyle - closeOnDoubleClick - fitHandleWidth - content={state.message} - /> - )} -
-
- {showAllPools ? ( - - ) : ( - <> - - {shortToken && ( - - )} - - )} -
-
-
- {showAllPools ? ( -
- {indexName && indexName} - {poolName && `[${poolName}]`} -
- ) : ( -
{poolName}
- )} -
-
-
-
-
- {(showBalances && balance !== undefined && ( -
- {balance > 0 - ? formatTokenAmount(balance, marketToken?.decimals, "GM", { - useCommas: true, - }) - : "-"} -
- )) || - null} - - {(showBalances && balanceUsd !== undefined && balanceUsd > 0 &&
{formatUsd(balanceUsd)}
) || null} -
-
-
- -
-
-
- ); -} diff --git a/src/components/MarketSelector/types.tsx b/src/components/MarketSelector/types.tsx new file mode 100644 index 0000000000..2e24c25615 --- /dev/null +++ b/src/components/MarketSelector/types.tsx @@ -0,0 +1,33 @@ +import { MarketInfo } from "domain/synthetics/markets"; +import { TokensData } from "domain/synthetics/tokens"; +import { GmTokensFavoritesContextType } from "domain/synthetics/tokens/useGmTokensFavorites"; + +export type CommonPoolSelectorProps = { + label?: string; + className?: string; + selectedMarketAddress?: string; + selectedIndexName?: string; + markets: MarketInfo[]; + marketTokensData?: TokensData; + showBalances?: boolean; + isSideMenu?: boolean; + getMarketState?: (market: MarketInfo) => MarketState | undefined; + onSelectMarket: (market: MarketInfo) => void; + showAllPools?: boolean; + showIndexIcon?: boolean; +} & GmTokensFavoritesContextType; + +export type MarketState = { + disabled?: boolean; + message?: string; +}; + +export type MarketOption = { + indexName: string; + poolName: string; + name: string; + marketInfo: MarketInfo; + balance: bigint; + balanceUsd: bigint; + state?: MarketState; +}; diff --git a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx index cb51d4e28f..765544ad98 100644 --- a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx +++ b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx @@ -69,6 +69,8 @@ export default function GmAssetDropdown({ token, marketsInfoData, tokensData, po whileElementsMounted: autoUpdate, }); + const contractSymbol = market && isGlv(market) ? `${market.indexToken.contractSymbol}` : undefined; + return (
@@ -91,7 +93,13 @@ export default function GmAssetDropdown({ token, marketsInfoData, tokensData, po )} - + {active && shortToken && walletClient && ( { + const token = marketTokensData?.[m.address]; + const market = marketsInfoData[m.address]; + + if (token) { + return { + ...token, + name: market.name, + }; + } + }) + .filter(Boolean as unknown as (x: T | undefined) => x is T), + ]; + } + if (longToken.address !== shortToken.address) { result.push(shortToken); } @@ -223,32 +236,57 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { return result; }, - [marketInfo, tokensData] + [marketInfo, tokensData, isGlvMarket, marketTokensData, marketsInfoData] ); - const marketToken = getTokenData( - isDeposit ? depositMarketTokensData : withdrawalMarketTokensData, - marketInfo?.marketTokenAddress - ); - const marketTokenAmount = parseValue(marketTokenInputValue || "0", marketToken?.decimals || 0)!; - const marketTokenUsd = convertToUsd( - marketTokenAmount, - marketToken?.decimals, - isDeposit ? marketToken?.prices?.maxPrice : marketToken?.prices?.minPrice - )!; + /** + * Here and following we use `underlyingGmMarket` to get the correct market info for GLV markets + * because we need to use actual GM market data to calculate fees, errors and so on, + * but here marketInfo may be a Vault market + */ + const { underlyingGmMarket, marketToken, marketTokenUsd, marketTokenAmount } = useMemo(() => { + const realGmMarket = isGlvMarket && selectedGlvGmMarket ? marketsInfoData[selectedGlvGmMarket] : marketInfo; + + const marketToken = getTokenData( + isDeposit ? depositMarketTokensData : withdrawalMarketTokensData, + realGmMarket?.marketTokenAddress + ); + const marketTokenAmount = parseValue(marketTokenInputValue || "0", marketToken?.decimals || 0)!; + const marketTokenUsd = convertToUsd( + marketTokenAmount, + marketToken?.decimals, + isDeposit ? marketToken?.prices?.maxPrice : marketToken?.prices?.minPrice + )!; + + return { + underlyingGmMarket: realGmMarket, + marketToken, + marketTokenAmount, + marketTokenUsd, + }; + }, [ + isGlvMarket, + marketInfo, + marketsInfoData, + selectedGlvGmMarket, + depositMarketTokensData, + withdrawalMarketTokensData, + marketTokenInputValue, + isDeposit, + ]); const { longCollateralLiquidityUsd, shortCollateralLiquidityUsd } = useMemo(() => { - if (!marketInfo) return {}; + if (!marketInfo || isGlvMarket) return {}; return { longCollateralLiquidityUsd: getAvailableUsdLiquidityForCollateral(marketInfo, true), shortCollateralLiquidityUsd: getAvailableUsdLiquidityForCollateral(marketInfo, false), }; - }, [marketInfo]); + }, [marketInfo, isGlvMarket]); const amounts = useDepositWithdrawalAmounts({ isDeposit, - marketInfo, + marketInfo: underlyingGmMarket, marketToken, longTokenInputState, shortTokenInputState, @@ -258,127 +296,44 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { isWithdrawal, }); - const { fees, executionFee } = useMemo(() => { - if (!gasLimits || gasPrice === undefined || !tokensData || !amounts) { - return {}; - } - - const basisUsd = isDeposit - ? (amounts?.longTokenUsd ?? 0n) + (amounts?.shortTokenUsd ?? 0n) - : amounts?.marketTokenUsd || 0n; - - const swapFee = getFeeItem(amounts.swapFeeUsd * -1n, basisUsd); - const swapPriceImpact = getFeeItem(amounts.swapPriceImpactDeltaUsd, basisUsd); - const uiFee = getFeeItem(amounts.uiFeeUsd * -1n, basisUsd, { - shouldRoundUp: true, - }); - - const totalFees = getTotalFeeItem([swapPriceImpact, swapFee, uiFee].filter(Boolean) as FeeItem[]); - const fees: GmSwapFees = { - swapFee, - swapPriceImpact, - totalFees, - uiFee, - }; - - const gasLimit = isDeposit - ? estimateExecuteDepositGasLimit(gasLimits, { - initialLongTokenAmount: amounts.longTokenAmount, - initialShortTokenAmount: amounts.shortTokenAmount, - }) - : estimateExecuteWithdrawalGasLimit(gasLimits, {}); - - const oraclePriceCount = isDeposit ? estimateDepositOraclePriceCount(0) : estimateWithdrawalOraclePriceCount(0); - - const executionFee = getExecutionFee(chainId, gasLimits, tokensData, gasLimit, gasPrice, oraclePriceCount); - - return { - fees, - executionFee, - }; - }, [amounts, chainId, gasLimits, gasPrice, isDeposit, tokensData]); + const { fees, executionFee } = useFees({ + amounts, + chainId, + gasLimits, + gasPrice, + isDeposit, + tokensData, + }); const isHighPriceImpact = (fees?.swapPriceImpact?.deltaUsd ?? 0) < 0 && bigMath.abs(fees?.swapPriceImpact?.bps ?? 0n) >= HIGH_PRICE_IMPACT_BPS; - const submitState = useMemo(() => { - const commonError = getCommonError({ - chainId, - isConnected: true, - hasOutdatedUi, - })[0]; - - const swapError = getGmSwapError({ - isDeposit, - marketInfo, - marketToken, - longToken: longTokenInputState?.token, - shortToken: shortTokenInputState?.token, - marketTokenAmount, - marketTokenUsd: amounts?.marketTokenUsd, - longTokenAmount: amounts?.longTokenAmount, - shortTokenAmount: amounts?.shortTokenAmount, - longTokenUsd: amounts?.longTokenUsd, - shortTokenUsd: amounts?.shortTokenUsd, - longTokenLiquidityUsd: longCollateralLiquidityUsd, - shortTokenLiquidityUsd: shortCollateralLiquidityUsd, - fees, - isHighPriceImpact: Boolean(isHighPriceImpact), - isHighPriceImpactAccepted, - priceImpactUsd: fees?.swapPriceImpact?.deltaUsd, - })[0]; - - const error = commonError || swapError; - - if (!account) { - return { - text: t`Connect Wallet`, - onSubmit: () => openConnectModal?.(), - }; - } - - const onSubmit = () => { - setStage("confirmation"); - }; - - if (error) { - return { - text: error, - error, - isDisabled: !shouldDisableValidationForTesting, - onSubmit, - }; - } - - return { - text: isDeposit ? t`Buy GM` : t`Sell GM`, - onSubmit, - }; - }, [ - chainId, - hasOutdatedUi, - isDeposit, - marketInfo, - marketToken, - longTokenInputState?.token, - shortTokenInputState?.token, - marketTokenAmount, - amounts?.marketTokenUsd, - amounts?.longTokenAmount, - amounts?.shortTokenAmount, - amounts?.longTokenUsd, - amounts?.shortTokenUsd, - longCollateralLiquidityUsd, - shortCollateralLiquidityUsd, + const submitState = useSubmitButtonState({ + amounts, + executionFee, fees, + isDeposit, isHighPriceImpact, isHighPriceImpactAccepted, - account, - openConnectModal, - setStage, - shouldDisableValidationForTesting, - ]); + marketInfo: underlyingGmMarket, + marketToken: marketToken!, + operation, + shouldDisableValidation: shouldDisableValidationForTesting, + tokensData, + longToken: longTokenInputState?.token, + shortToken: shortTokenInputState?.token, + marketTokenAmount, + marketTokenUsd: amounts?.marketTokenUsd, + longTokenAmount: amounts?.longTokenAmount, + shortTokenAmount: amounts?.shortTokenAmount, + longTokenUsd: amounts?.longTokenUsd, + shortTokenUsd: amounts?.shortTokenUsd, + longTokenLiquidityUsd: longCollateralLiquidityUsd, + shortTokenLiquidityUsd: shortCollateralLiquidityUsd, + marketTokensData, + isGlv: Boolean(isGlvMarket), + }); const firstTokenShowMaxButton = (isDeposit && @@ -447,6 +402,13 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { [onSelectMarket, resetInputs] ); + const onGmPoolChange = useCallback( + (marketAddress: string) => { + onSelectGlvGmMarket?.(marketAddress); + }, + [onSelectGlvGmMarket] + ); + const onMaxClickFirstToken = useCallback(() => { if (firstToken?.balance) { let maxAvailableAmount = firstToken.isNative @@ -524,7 +486,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { const handleFormSubmit = useCallback( (e: React.FormEvent) => { e.preventDefault(); - submitState.onSubmit(); + submitState.onSubmit?.(); }, [submitState] ); @@ -630,6 +592,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { chainId, }); // #endregion + return ( <>
@@ -648,7 +611,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { onInputValueChange={handleFirstTokenInputValueChange} onClickMax={onMaxClickFirstToken} > - {firstTokenAddress && isSingle && isDeposit ? ( + {firstTokenAddress && isSingle && isDeposit && tokenOptions.length > 1 ? ( @@ -740,36 +706,12 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { className="w-full" variant="primary-action" onClick={submitState.onSubmit} - disabled={submitState.isDisabled} + disabled={submitState.disabled} > {submitState.text}
- - { - setStage("swap"); - }} - onClose={() => { - setStage("swap"); - }} - shouldDisableValidation={shouldDisableValidationForTesting} - /> ); } diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx index 37b237e754..86c0429c79 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx @@ -1,7 +1,7 @@ import { t } from "@lingui/macro"; import { values } from "lodash"; -import { selectMarketsInfoData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectPoolsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { ExecutionFee } from "domain/synthetics/fees"; import { TokensData } from "domain/synthetics/tokens"; @@ -12,9 +12,14 @@ import { showMarketToast } from "../showMarketToast"; import { ExchangeInfo } from "components/Exchange/ExchangeInfo"; import ExchangeInfoRow from "components/Exchange/ExchangeInfoRow"; +import { GmPoolsSelector } from "components/MarketSelector/GmSelectorForGlv"; import { PoolSelector } from "components/MarketSelector/PoolSelector"; import { GmFees } from "components/Synthetics/GmSwap/GmFees/GmFees"; import { NetworkFeeRow } from "components/Synthetics/NetworkFeeRow/NetworkFeeRow"; +import { MarketInfo } from "domain/synthetics/markets"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { useCallback } from "react"; +import { isGlv } from "../../../../../domain/synthetics/markets/glv"; import { HighPriceImpactRow } from "../HighPriceImpactRow"; export function InfoRows({ @@ -24,11 +29,14 @@ export function InfoRows({ isDeposit, fees, executionFee, + marketInfo, isHighPriceImpact, isHighPriceImpactAccepted, setIsHighPriceImpactAccepted, isSingle, onMarketChange, + onGmPoolChange, + selectedGlvGmMarket, }: { indexName: string | undefined; marketAddress: string | undefined; @@ -36,14 +44,24 @@ export function InfoRows({ isDeposit: boolean; fees: GmSwapFees | undefined; executionFee: ExecutionFee | undefined; + marketInfo: MarketInfo | GlvPoolInfo | undefined; isHighPriceImpact: boolean; isHighPriceImpactAccepted: boolean; setIsHighPriceImpactAccepted: (val: boolean) => void; isSingle: boolean; onMarketChange: (marketAddress: string) => void; + onGmPoolChange?: (marketAddress: string) => void; + selectedGlvGmMarket?: string; }) { const gmTokenFavoritesContext = useGmTokensFavorites(); - const markets = values(useSelector(selectMarketsInfoData)); + const markets = values(useSelector(selectPoolsData)); + + const onSelectGmMarket = useCallback( + (marketInfo: MarketInfo) => { + onGmPoolChange?.(marketInfo.marketTokenAddress); + }, + [onGmPoolChange] + ); return ( @@ -52,21 +70,38 @@ export function InfoRows({ className="SwapBox-info-row" label={t`Pool`} value={ - { - onMarketChange(marketInfo.marketTokenAddress); - showMarketToast(marketInfo); - }} - {...gmTokenFavoritesContext} - /> + marketInfo && isGlv(marketInfo) ? ( + + ) : ( + { + onMarketChange(marketInfo.marketTokenAddress); + showMarketToast(marketInfo); + }} + {...gmTokenFavoritesContext} + /> + ) } /> diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx new file mode 100644 index 0000000000..f06c1b714e --- /dev/null +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx @@ -0,0 +1,73 @@ +import { useMemo } from "react"; +import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; +import { + estimateExecuteDepositGasLimit, + estimateExecuteWithdrawalGasLimit, + FeeItem, + GasLimitsConfig, + getExecutionFee, + getFeeItem, + getTotalFeeItem, +} from "domain/synthetics/fees"; +import { TokensData } from "domain/synthetics/tokens"; +import { GmSwapFees } from "domain/synthetics/trade"; +import { + estimateDepositOraclePriceCount, + estimateWithdrawalOraclePriceCount, +} from "domain/synthetics/fees/utils/estimateOraclePriceCount"; + +export const useFees = ({ + amounts, + chainId, + gasLimits, + gasPrice, + isDeposit, + tokensData, +}: { + amounts: ReturnType; + chainId: number; + gasLimits: GasLimitsConfig | undefined; + gasPrice: bigint | undefined; + isDeposit: boolean; + tokensData: TokensData | undefined; +}) => { + return useMemo(() => { + if (!gasLimits || gasPrice === undefined || !tokensData || !amounts) { + return {}; + } + + const basisUsd = isDeposit + ? (amounts?.longTokenUsd ?? 0n) + (amounts?.shortTokenUsd ?? 0n) + : amounts?.marketTokenUsd || 0n; + + const swapFee = getFeeItem(amounts.swapFeeUsd * -1n, basisUsd); + const swapPriceImpact = getFeeItem(amounts.swapPriceImpactDeltaUsd, basisUsd); + const uiFee = getFeeItem(amounts.uiFeeUsd * -1n, basisUsd, { + shouldRoundUp: true, + }); + + const totalFees = getTotalFeeItem([swapPriceImpact, swapFee, uiFee].filter(Boolean) as FeeItem[]); + const fees: GmSwapFees = { + swapFee, + swapPriceImpact, + totalFees, + uiFee, + }; + + const gasLimit = isDeposit + ? estimateExecuteDepositGasLimit(gasLimits, { + initialLongTokenAmount: amounts.longTokenAmount, + initialShortTokenAmount: amounts.shortTokenAmount, + }) + : estimateExecuteWithdrawalGasLimit(gasLimits, {}); + + const oraclePriceCount = isDeposit ? estimateDepositOraclePriceCount(0) : estimateWithdrawalOraclePriceCount(0); + + const executionFee = getExecutionFee(chainId, gasLimits, tokensData, gasLimit, gasPrice, oraclePriceCount); + + return { + fees, + executionFee, + }; + }, [amounts, chainId, gasLimits, gasPrice, isDeposit, tokensData]); +}; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx index 12df713b79..6bc2c78c64 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx @@ -14,7 +14,6 @@ export function useGmDepositWithdrawalBoxState(operation: Operation, mode: Mode, const chainId = useSelector(selectChainId); const [focusedInput, setFocusedInput] = useState<"longCollateral" | "shortCollateral" | "market">("market"); - const [stage, setStage] = useState<"swap" | "confirmation" | "processing">(); const [isHighPriceImpactAccepted, setIsHighPriceImpactAccepted] = useState(false); const [firstTokenAddress, setFirstTokenAddress] = useLocalStorageSerializeKey( [chainId, SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY, isDeposit, marketAddress, "first"], @@ -32,9 +31,6 @@ export function useGmDepositWithdrawalBoxState(operation: Operation, mode: Mode, focusedInput, setFocusedInput, - stage, - setStage, - isHighPriceImpactAccepted, setIsHighPriceImpactAccepted, diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx new file mode 100644 index 0000000000..8775be5d09 --- /dev/null +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx @@ -0,0 +1,477 @@ +import { plural, t } from "@lingui/macro"; +import { useConnectModal } from "@rainbow-me/rainbowkit"; +import { getContract } from "config/contracts"; +import { DEFAULT_SLIPPAGE_AMOUNT } from "config/factors"; +import { useSyntheticsEvents } from "context/SyntheticsEvents"; +import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useHasOutdatedUi } from "domain/legacy"; +import { ExecutionFee } from "domain/synthetics/fees"; +import { createDepositTxn, createWithdrawalTxn, MarketInfo } from "domain/synthetics/markets"; +import { createShiftTxn } from "domain/synthetics/markets/createShiftTxn"; +import { + getNeedTokenApprove, + getTokenData, + TokenData, + TokensData, + useTokensAllowanceData, +} from "domain/synthetics/tokens"; +import { getCommonError, getGmSwapError } from "domain/synthetics/trade/utils/validation"; +import { usePendingTxns } from "lib/usePendingTxns"; +import useWallet from "lib/wallets/useWallet"; +import { uniq } from "lodash"; +import { useCallback, useMemo, useState } from "react"; +import { Operation } from "../types"; +import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; +import { useFees } from "./useFees"; + +interface Props { + amounts: ReturnType; + fees: ReturnType["fees"]; + isDeposit: boolean; + marketInfo?: MarketInfo; + marketToken: TokenData; + operation: Operation; + longToken: TokenData | undefined; + shortToken: TokenData | undefined; + + marketTokenAmount: bigint | undefined; + marketTokenUsd: bigint | undefined; + longTokenAmount: bigint | undefined; + longTokenUsd: bigint | undefined; + shortTokenAmount: bigint | undefined; + shortTokenUsd: bigint | undefined; + + fromMarketTokenAmount?: bigint; + fromMarketToken?: TokenData; + fromMarketTokenUsd?: bigint; + + longTokenLiquidityUsd?: bigint | undefined; + shortTokenLiquidityUsd?: bigint | undefined; + + isHighPriceImpact: boolean; + isHighPriceImpactAccepted: boolean; + + shouldDisableValidation?: boolean; + + tokensData: TokensData | undefined; + marketTokensData?: TokensData; + executionFee: ExecutionFee | undefined; + isGlv: boolean; +} + +const processingTextMap = { + [Operation.Deposit]: (symbol: string) => t`Buying ${symbol}...`, + [Operation.Withdrawal]: (symbol: string) => t`Selling ${symbol}...`, + [Operation.Shift]: (symbol: string) => t`Shifting ${symbol}...`, +}; + +export const useSubmitButtonState = ({ + isDeposit, + amounts, + fees, + marketInfo, + marketToken, + operation, + longToken, + longTokenAmount, + shortToken, + shortTokenAmount, + + marketTokenAmount, + longTokenLiquidityUsd, + shortTokenLiquidityUsd, + + isHighPriceImpact, + isHighPriceImpactAccepted, + + shouldDisableValidation, + + fromMarketTokenAmount, + fromMarketToken, + tokensData, + marketTokensData, + executionFee, + isGlv, +}: Props) => { + const chainId = useSelector(selectChainId); + const routerAddress = getContract(chainId, "SyntheticsRouter"); + const { data: hasOutdatedUi } = useHasOutdatedUi(); + const { openConnectModal } = useConnectModal(); + const { signer, account } = useWallet(); + const { setPendingDeposit, setPendingWithdrawal, setPendingShift } = useSyntheticsEvents(); + const [, setPendingTxns] = usePendingTxns(); + + const [isSubmitting, setIsSubmitting] = useState(false); + + const onConnectAccount = useCallback(() => { + openConnectModal?.(); + }, [openConnectModal]); + + const payTokenAddresses = useMemo( + function getPayTokenAddresses() { + if (!marketToken) { + return []; + } + + const addresses: string[] = []; + + if (operation === Operation.Deposit) { + if (longTokenAmount !== undefined && longTokenAmount > 0 && longToken) { + addresses.push(longToken.address); + } + if (shortTokenAmount !== undefined && shortTokenAmount > 0 && shortToken) { + addresses.push(shortToken.address); + } + } else if (operation === Operation.Withdrawal) { + addresses.push(marketToken.address); + } + + return uniq(addresses); + }, + [operation, marketToken, longTokenAmount, longToken, shortTokenAmount, shortToken] + ); + + const { tokensAllowanceData } = useTokensAllowanceData(chainId, { + spenderAddress: routerAddress, + tokenAddresses: payTokenAddresses, + }); + + const isAllowanceLoaded = Boolean(tokensAllowanceData); + + const commonError = getCommonError({ + chainId, + isConnected: true, + hasOutdatedUi, + })[0]; + + const swapError = getGmSwapError({ + isDeposit, + marketInfo, + marketToken, + longToken: longToken, + shortToken: shortToken, + marketTokenAmount, + marketTokenUsd: amounts?.marketTokenUsd, + longTokenAmount: amounts?.longTokenAmount, + shortTokenAmount: amounts?.shortTokenAmount, + longTokenUsd: amounts?.longTokenUsd, + shortTokenUsd: amounts?.shortTokenUsd, + longTokenLiquidityUsd: longTokenLiquidityUsd, + shortTokenLiquidityUsd: shortTokenLiquidityUsd, + fees, + isHighPriceImpact: Boolean(isHighPriceImpact), + isHighPriceImpactAccepted, + priceImpactUsd: fees?.swapPriceImpact?.deltaUsd, + })[0]; + + const error = commonError || swapError; + + const tokensToApprove = useMemo( + function getTokensToApprove() { + const addresses: string[] = []; + + if (!tokensAllowanceData) { + return addresses; + } + + if (operation === Operation.Deposit) { + if ( + longTokenAmount !== undefined && + longTokenAmount > 0 && + longToken && + getNeedTokenApprove(tokensAllowanceData, longToken.address, longTokenAmount) + ) { + addresses.push(longToken.address); + } + + if ( + shortTokenAmount !== undefined && + shortTokenAmount > 0 && + shortToken && + getNeedTokenApprove(tokensAllowanceData, shortToken.address, shortTokenAmount) + ) { + addresses.push(shortToken.address); + } + } else if (operation === Operation.Withdrawal) { + if ( + marketTokenAmount !== undefined && + marketTokenAmount > 0 && + marketToken && + getNeedTokenApprove(tokensAllowanceData, marketToken.address, marketTokenAmount) + ) { + addresses.push(marketToken.address); + } + } else if (operation === Operation.Shift) { + if ( + fromMarketTokenAmount !== undefined && + fromMarketTokenAmount > 0 && + fromMarketToken && + getNeedTokenApprove(tokensAllowanceData, fromMarketToken.address, fromMarketTokenAmount) + ) { + addresses.push(fromMarketToken.address); + } + } + + return uniq(addresses); + }, + [ + fromMarketToken, + fromMarketTokenAmount, + longToken, + longTokenAmount, + marketToken, + marketTokenAmount, + operation, + shortToken, + shortTokenAmount, + tokensAllowanceData, + ] + ); + + const onCreateDeposit = useCallback( + function onCreateDeposit() { + if ( + !account || + !executionFee || + !marketToken || + !marketInfo || + marketTokenAmount === undefined || + !tokensData || + !signer + ) { + return Promise.resolve(); + } + + const initialLongTokenAddress = longToken?.address || marketInfo.longTokenAddress; + const initialShortTokenAddress = marketInfo.isSameCollaterals + ? initialLongTokenAddress + : shortToken?.address || marketInfo.shortTokenAddress; + + return createDepositTxn(chainId, signer, { + account, + initialLongTokenAddress, + initialShortTokenAddress, + longTokenSwapPath: [], + shortTokenSwapPath: [], + longTokenAmount: longTokenAmount ?? 0n, + shortTokenAmount: shortTokenAmount ?? 0n, + marketTokenAddress: marketToken.address, + minMarketTokens: marketTokenAmount, + executionFee: executionFee.feeTokenAmount, + allowedSlippage: DEFAULT_SLIPPAGE_AMOUNT, + skipSimulation: shouldDisableValidation, + tokensData, + setPendingTxns, + setPendingDeposit, + }); + }, + [ + account, + executionFee, + longToken, + longTokenAmount, + marketInfo, + marketToken, + marketTokenAmount, + shortToken, + shortTokenAmount, + signer, + tokensData, + shouldDisableValidation, + chainId, + setPendingDeposit, + setPendingTxns, + ] + ); + + const onCreateWithdrawal = useCallback( + function onCreateWithdrawal() { + if ( + !account || + !marketInfo || + !marketToken || + !executionFee || + longTokenAmount === undefined || + shortTokenAmount === undefined || + !tokensData || + !signer + ) { + return Promise.resolve(); + } + + return createWithdrawalTxn(chainId, signer, { + account, + initialLongTokenAddress: longToken?.address || marketInfo.longTokenAddress, + initialShortTokenAddress: shortToken?.address || marketInfo.shortTokenAddress, + longTokenSwapPath: [], + shortTokenSwapPath: [], + marketTokenAmount: marketTokenAmount!, + minLongTokenAmount: longTokenAmount, + minShortTokenAmount: shortTokenAmount, + marketTokenAddress: marketToken.address, + executionFee: executionFee.feeTokenAmount, + allowedSlippage: DEFAULT_SLIPPAGE_AMOUNT, + tokensData, + skipSimulation: shouldDisableValidation, + setPendingTxns, + setPendingWithdrawal, + }); + }, + [ + account, + executionFee, + longToken, + longTokenAmount, + marketInfo, + marketToken, + marketTokenAmount, + shortToken, + shortTokenAmount, + signer, + tokensData, + shouldDisableValidation, + chainId, + setPendingWithdrawal, + setPendingTxns, + ] + ); + + const onCreateShift = useCallback( + function onCreateShift() { + if ( + !signer || + !account || + !fromMarketToken || + !executionFee || + !marketToken || + fromMarketTokenAmount === undefined || + marketTokenAmount === undefined || + !tokensData + ) { + return Promise.resolve(); + } + + return createShiftTxn(chainId, signer, { + account, + fromMarketTokenAddress: fromMarketToken.address, + fromMarketTokenAmount: fromMarketTokenAmount, + toMarketTokenAddress: marketToken.address, + minToMarketTokenAmount: marketTokenAmount, + executionFee: executionFee.feeTokenAmount, + allowedSlippage: DEFAULT_SLIPPAGE_AMOUNT, + skipSimulation: shouldDisableValidation, + tokensData, + setPendingTxns, + setPendingShift, + }); + }, + [ + account, + executionFee, + fromMarketToken, + fromMarketTokenAmount, + marketToken, + marketTokenAmount, + signer, + tokensData, + shouldDisableValidation, + chainId, + setPendingShift, + setPendingTxns, + ] + ); + + const onSubmit = useCallback(() => { + setIsSubmitting(true); + + let txnPromise: Promise; + + if (operation === Operation.Deposit) { + txnPromise = onCreateDeposit(); + } else if (operation === Operation.Withdrawal) { + txnPromise = onCreateWithdrawal(); + } else { + txnPromise = onCreateShift(); + } + + txnPromise + .catch((error) => { + throw error; + }) + .finally(() => { + setIsSubmitting(false); + }); + }, [operation, onCreateDeposit, onCreateShift, onCreateWithdrawal]); + + return useMemo(() => { + if (!account) { + return { + text: t`Connect Wallet`, + onSubmit: onConnectAccount, + }; + } + + if (payTokenAddresses.length > 0 && !isAllowanceLoaded) { + return { + text: t`Loading...`, + disabled: true, + }; + } + + if (error) { + return { + text: error, + disabled: !shouldDisableValidation, + onClick: onSubmit, + }; + } + + const operationTokenSymbol = isGlv ? "GLV" : "GM"; + + if (isSubmitting) { + return { + text: processingTextMap[operation](operationTokenSymbol), + disabled: true, + }; + } + + if (tokensToApprove.length > 0 && marketToken) { + const symbols = tokensToApprove.map((address) => { + const token = getTokenData(tokensData, address) || getTokenData(marketTokensData, address); + return address === marketToken.address ? "GM" : token?.assetSymbol ?? token?.symbol; + }); + + const symbolsText = symbols.join(", "); + + return { + text: plural(symbols.length, { + one: `Pending ${symbolsText} approval`, + other: `Pending ${symbolsText} approvals`, + }), + disabled: true, + }; + } + + return { + text: isDeposit ? t`Buy ${operationTokenSymbol}` : t`Sell ${operationTokenSymbol}`, + onSubmit, + }; + }, [ + account, + error, + isAllowanceLoaded, + isDeposit, + marketToken, + operation, + isSubmitting, + tokensToApprove, + onConnectAccount, + shouldDisableValidation, + onSubmit, + tokensData, + marketTokensData, + payTokenAddresses.length, + isGlv, + ]); +}; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx index 66f177770d..1cf68e04f9 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx @@ -1,7 +1,8 @@ import { Dispatch, SetStateAction, useEffect } from "react"; +import { isGlv } from "domain/synthetics/markets/glv"; import { MarketInfo } from "domain/synthetics/markets/types"; -import { TokenData } from "domain/synthetics/tokens"; +import { convertToTokenAmount, TokenData } from "domain/synthetics/tokens"; import type { DepositAmounts, WithdrawalAmounts } from "domain/synthetics/trade"; import { formatAmountFree } from "lib/numbers"; @@ -67,9 +68,23 @@ export function useUpdateInputAmounts({ } if (amounts) { - setMarketTokenInputValue( - amounts.marketTokenAmount > 0 ? formatAmountFree(amounts.marketTokenAmount, marketToken.decimals) : "" - ); + if (isGlv(marketInfo)) { + const glvPrice = isDeposit + ? marketInfo.indexToken.prices.maxPrice + : marketInfo.indexToken.prices.minPrice; + const gmUsdAmount = amounts.marketTokenUsd; + const glvAmount = convertToTokenAmount(gmUsdAmount, marketInfo.indexToken.decimals, glvPrice); + + setMarketTokenInputValue( + glvAmount !== undefined && glvAmount > 0 + ? formatAmountFree(glvAmount, marketInfo.indexToken.decimals) + : "" + ); + } else { + setMarketTokenInputValue( + amounts.marketTokenAmount > 0 ? formatAmountFree(amounts.marketTokenAmount, marketToken.decimals) : "" + ); + } } } else if (focusedInput === "market") { if (marketTokenAmount <= 0) { @@ -80,10 +95,18 @@ export function useUpdateInputAmounts({ if (amounts) { if (longToken) { + let longTokenAmountToSet = amounts.longTokenAmount; + + if (isGlv(marketInfo)) { + amounts.longTokenUsd; + // @todo + } + longTokenInputState?.setValue( - amounts.longTokenAmount > 0 ? formatAmountFree(amounts.longTokenAmount, longToken.decimals) : "" + longTokenAmountToSet > 0 ? formatAmountFree(longTokenAmountToSet, longToken.decimals) : "" ); } + if (shortToken) { shortTokenInputState?.setValue( amounts.shortTokenAmount > 0 ? formatAmountFree(amounts.shortTokenAmount, shortToken.decimals) : "" diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx index d11343fb2b..4b154e4ae5 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx @@ -1,7 +1,6 @@ import { msg } from "@lingui/macro"; import { useMemo } from "react"; -import { useMarketsInfoData } from "context/SyntheticsStateContext/hooks/globalsHooks"; import { selectShiftAvailableMarkets } from "context/SyntheticsStateContext/selectors/shiftSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { useLocalizedMap } from "lib/i18n"; @@ -10,9 +9,13 @@ import { getGmSwapBoxAvailableModes } from "./getGmSwapBoxAvailableModes"; import { Mode, Operation } from "./types"; import Tab from "components/Tab/Tab"; -import { GmSwapBoxDepositWithdrawal } from "./GmDepositWithdrawalBox/GmDepositWithdrawalBox"; import { GmShiftBox } from "./GmShiftBox/GmShiftBox"; +import { selectPoolsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { isGlv } from "domain/synthetics/markets/glv"; + +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { GmSwapBoxDepositWithdrawal } from "./GmDepositWithdrawalBox/GmDepositWithdrawalBox"; import "./GmSwapBox.scss"; export type GmSwapBoxProps = { @@ -22,14 +25,22 @@ export type GmSwapBoxProps = { mode: Mode; onSetMode: (mode: Mode) => void; onSetOperation: (operation: Operation) => void; + selectedGlvGmMarket?: string; + onSelectGlvGmMarket?: (marketAddress: string) => void; }; -const OPERATION_LABELS = { +const OPERATION_LABELS_GM = { [Operation.Deposit]: msg`Buy GM`, [Operation.Withdrawal]: msg`Sell GM`, [Operation.Shift]: msg`Shift GM`, }; +const OPERATION_LABELS_GLV = { + [Operation.Deposit]: msg`Buy GLV`, + [Operation.Withdrawal]: msg`Sell GLV`, + [Operation.Shift]: msg`Shift GM`, +}; + const MODE_LABELS = { [Mode.Single]: msg`Single`, [Mode.Pair]: msg`Pair`, @@ -38,13 +49,21 @@ const MODE_LABELS = { const OPERATIONS = [Operation.Deposit, Operation.Withdrawal, Operation.Shift]; export function GmSwapBox(p: GmSwapBoxProps) { - const { selectedMarketAddress, operation, mode, onSetMode, onSetOperation, onSelectMarket } = p; + const { + selectedMarketAddress, + operation, + mode, + onSetMode, + onSetOperation, + onSelectMarket, + selectedGlvGmMarket, + onSelectGlvGmMarket, + } = p; const marketAddress = selectedMarketAddress; - const marketsInfoData = useMarketsInfoData(); + const marketsInfoData = useSelector(selectPoolsData); const shiftAvailableMarkets = useSelector(selectShiftAvailableMarkets); - const marketInfo = getByKey(marketsInfoData, marketAddress); const availableOperations = useMemo(() => { @@ -64,7 +83,14 @@ export function GmSwapBox(p: GmSwapBoxProps) { }, [marketAddress, shiftAvailableMarkets]); const availableModes = getGmSwapBoxAvailableModes(operation, marketInfo); - const localizedOperationLabels = useLocalizedMap(OPERATION_LABELS); + const localizedOperationLabelsGM = useLocalizedMap(OPERATION_LABELS_GM); + const localizedOperationLabelsGLV = useLocalizedMap(OPERATION_LABELS_GLV); + + const localizedOperationLabels = useMemo( + () => (marketInfo && isGlv(marketInfo) ? localizedOperationLabelsGLV : localizedOperationLabelsGM), + [marketInfo, localizedOperationLabelsGM, localizedOperationLabelsGLV] + ); + const localizedModeLabels = useLocalizedMap(MODE_LABELS); return ( @@ -89,7 +115,10 @@ export function GmSwapBox(p: GmSwapBoxProps) { {operation === Operation.Deposit || operation === Operation.Withdrawal ? ( [ formatTokenAmountWithUsd( @@ -129,9 +133,166 @@ export function MarketStatsWithComposition(p: Props) { ] ); + const buyableRow = useMemo(() => { + const buyableInfo = mintableInfo + ? formatTokenAmountWithUsd( + mintableInfo.mintableAmount, + mintableInfo.mintableUsd, + isGlvMarket ? marketToken?.symbol : marketToken?.symbol, + marketToken?.decimals, + { + displayDecimals: 0, + } + ) + : "..."; + + if (isGlvMarket) { + return ; + } + + return ( + + {marketInfo?.isSameCollaterals ? ( + + {marketInfo?.longToken.symbol} can be used to buy GM for this market up to the specified buying + caps. + + ) : ( + + {marketInfo?.longToken.symbol} and {marketInfo?.shortToken.symbol} can be used to buy GM for this + market up to the specified buying caps. + + )} + +
+
+ + +
+ +
+ } + /> + ) : ( + "..." + ) + } + /> + ); + }, [isGlvMarket, marketInfo, marketToken, marketTotalSupplyUsd, mintableInfo, maxLongTokenValue, maxShortTokenValue]); + + const sellableRow = useMemo(() => { + const sellableValue = sellableInfo + ? formatTokenAmountWithUsd( + sellableInfo?.totalAmount, + sellableInfo?.totalUsd, + marketToken?.symbol, + marketToken?.decimals, + { + displayDecimals: 0, + } + ) + : "..."; + + if (isGlvMarket) { + return ; + } + + return ( + + {marketInfo?.isSameCollaterals ? ( + + GM can be sold for {longToken?.symbol} for this market up to the specified selling caps. The + remaining tokens in the pool are reserved for currently open positions. + + ) : ( + + GM can be sold for {longToken?.symbol} and {shortToken?.symbol} for this market up to the specified + selling caps. The remaining tokens in the pool are reserved for currently open positions. + + )} +
+
+ + {!marketInfo?.isSameCollaterals && ( + + )} +
+ } + /> + } + /> + ); + }, [ + marketInfo, + longToken, + shortToken, + marketToken, + sellableInfo, + maxLongSellableTokenAmount, + maxShortSellableTokenAmount, + isGlvMarket, + ]); + + const canFitCompositionOnRow = useMedia("(min-width: 1200px)"); + return ( -
-
+
+
- - {indexName} - [{poolName}] -
- ) : ( - "..." - ) - } - /> + {isGlvMarket ? ( + + {marketInfo.name} + [{poolName}] +
+ ) : ( + "..." + ) + } + /> + ) : ( + + {indexName} + [{poolName}] +
+ ) : ( + "..." + ) + } + /> + )} + - {/* } /> */} - ... + ) : ( + + ) } /> - {marketInfo?.isSameCollaterals ? ( - - {marketInfo?.longToken.symbol} can be used to buy GM for this market up to the specified - buying caps. - - ) : ( - - {marketInfo?.longToken.symbol} and {marketInfo?.shortToken.symbol} can be used to buy GM for - this market up to the specified buying caps. - - )} - -
-
- - -
- -
- } - /> - ) : ( - "..." - ) + ) + : "..." } /> - - {marketInfo?.isSameCollaterals ? ( - - GM can be sold for {longToken?.symbol} for this market up to the specified selling caps. The - remaining tokens in the pool are reserved for currently open positions. - - ) : ( - - GM can be sold for {longToken?.symbol} and {shortToken?.symbol} for this market up to the - specified selling caps. The remaining tokens in the pool are reserved for currently open - positions. - - )} -
-
- - {!marketInfo?.isSameCollaterals && ( - - )} -
+ {sellableRow} + {buyableRow} + + {isGlvMarket && ( + <> + - } - /> + + + )} +
-
-

Composition

- - +
+
+

Composition

+ + +
); } -interface CompositionBarProps { - data: { - color: string; - value?: bigint; - }[]; -} +/** + * + * @returns every N weeks, days, hours, minutes, and seconds + */ +function secondsToHumanReadableDuration(s: bigint, roundUpTo?: "minutes" | "hours" | "days" | "weeks"): string { + const secs = Number(s); -function CompositionBar({ data }: CompositionBarProps) { - const sum = data.reduce((acc, { value }) => acc + (value ?? 0n), 0n); - const percents = data.map(({ value }) => (value === undefined ? 0n : bigMath.mulDiv(value, 100n, sum))); + const weeks = Math.floor(secs / 604800); + const days = Math.floor((secs % 604800) / 86400); + const hours = Math.floor((secs % 86400) / 3600); + const minutes = Math.floor((secs % 3600) / 60); + const seconds = secs % 60; - return ( -
- {data.map(({ color, value }, index) => { - if (value === undefined) { - return null; - } - const widthPc = percents[index].toString(); - const previousWidthPc = index ? percents[index - 1]?.toString() : "0"; - - return ( -
- ); - })} -
- ); -} + const parts = (() => { + const parts: string[] = []; -interface CompositionTableGmProps { - data: { prefix: string; amountUsd?: bigint; token?: TokenData; amount?: bigint }[]; -} + if (weeks) { + parts.push(weeks > 1 ? t`${weeks} weeks` : t`week`); + } + if (roundUpTo === "weeks") { + return parts; + } -export function CompositionTableGm({ data }: CompositionTableGmProps) { - const sum = data.reduce((acc, { amountUsd }) => acc + (amountUsd ?? 0n), 0n); + if (days) { + parts.push(days > 1 ? t`${days} days` : t`day`); + } + if (roundUpTo === "days") { + return parts; + } - return ( -
); } @@ -43,14 +51,20 @@ export const ExchangeTr = forwardRef< /> ); }); -export function ExchangeTd(props: PropsWithChildren & React.HTMLProps) { + +type Padding = "all" | "horizontal" | "vertical" | "none"; + +export function ExchangeTd(props: ExchangeTdThProps) { + const { padding = "all", ...rest } = props; return ( ); } diff --git a/src/components/Synthetics/PoolsList/ApyTooltipContent.tsx b/src/components/Synthetics/PoolsList/ApyTooltipContent.tsx new file mode 100644 index 0000000000..2a94b61204 --- /dev/null +++ b/src/components/Synthetics/PoolsList/ApyTooltipContent.tsx @@ -0,0 +1,31 @@ +import { Trans } from "@lingui/macro"; + +import ExternalLink from "components/ExternalLink/ExternalLink"; + +export function ApyTooltipContent() { + return ( +

+ +

+ The APY is an estimate based on the fees collected for the past seven days, extrapolating the current + borrowing fee. It excludes: +

+
    +
  • price changes of the underlying token(s)
  • +
  • traders' PnL, which is expected to be neutral in the long term
  • +
  • funding fees, which are exchanged between traders
  • +
+

+ + Read more about GM token pricing + + . +

+

+ Check GM pools' performance against other LP Positions in the{" "} + GMX Dune Dashboard. +

+ +

+ ); +} diff --git a/src/components/Synthetics/PoolsList/MintableAmount.tsx b/src/components/Synthetics/PoolsList/MintableAmount.tsx new file mode 100644 index 0000000000..7e452e429b --- /dev/null +++ b/src/components/Synthetics/PoolsList/MintableAmount.tsx @@ -0,0 +1,106 @@ +import { Trans } from "@lingui/macro"; +import { useMemo } from "react"; + +import { getMaxPoolUsd, getPoolUsdWithoutPnl, MarketInfo } from "domain/synthetics/markets"; +import { formatTokenAmount, formatTokenAmountWithUsd, formatUsd } from "lib/numbers"; + +import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; +import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; +import { TokenData } from "domain/synthetics/tokens"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { TokenValuesInfoCell } from "./TokenValuesInfoCell"; + +export function MintableAmount({ + mintableInfo, + market, + token, + longToken, + shortToken, +}: { + mintableInfo: + | { + mintableAmount: bigint; + mintableUsd: bigint; + longDepositCapacityUsd?: bigint; + shortDepositCapacityUsd?: bigint; + longDepositCapacityAmount?: bigint; + shortDepositCapacityAmount?: bigint; + } + | undefined; + market: MarketInfo | GlvPoolInfo; + token: TokenData; + longToken?: TokenData; + shortToken?: TokenData; +}) { + const longTokenMaxValue = useMemo( + () => [ + mintableInfo && longToken + ? formatTokenAmountWithUsd( + mintableInfo.longDepositCapacityAmount, + mintableInfo.longDepositCapacityUsd, + longToken.symbol, + longToken.decimals + ) + : "-", + `(${formatUsd(getPoolUsdWithoutPnl(market, true, "midPrice"))} / ${formatUsd(getMaxPoolUsd(market, true))})`, + ], + [longToken, market, mintableInfo] + ); + const shortTokenMaxValue = useMemo( + () => [ + mintableInfo && shortToken + ? formatTokenAmountWithUsd( + mintableInfo.shortDepositCapacityAmount, + mintableInfo.shortDepositCapacityUsd, + shortToken.symbol, + shortToken.decimals + ) + : "-", + `(${formatUsd(getPoolUsdWithoutPnl(market, false, "midPrice"))} / ${formatUsd(getMaxPoolUsd(market, false))})`, + ], + [market, mintableInfo, shortToken] + ); + + const content = ( + + ); + + if (!longToken || !shortToken) { + return content; + } + + return ( + ( + <> +

+ {market?.isSameCollaterals ? ( + {longToken.symbol} can be used to buy GM for this market up to the specified buying caps. + ) : ( + + {longToken.symbol} and {shortToken.symbol} can be used to buy GM for this market up to the specified + buying caps. + + )} +

+
+ + + + )} + /> + ); +} diff --git a/src/components/Synthetics/GmList/GmList.tsx b/src/components/Synthetics/PoolsList/PoolsList.tsx similarity index 66% rename from src/components/Synthetics/GmList/GmList.tsx rename to src/components/Synthetics/PoolsList/PoolsList.tsx index 3f6b44b38e..764d034492 100644 --- a/src/components/Synthetics/GmList/GmList.tsx +++ b/src/components/Synthetics/PoolsList/PoolsList.tsx @@ -1,5 +1,4 @@ import { Trans, t } from "@lingui/macro"; -import cx from "classnames"; import noop from "lodash/noop"; import { useCallback, useMemo, useState } from "react"; import { Address, isAddress, isAddressEqual } from "viem"; @@ -9,44 +8,49 @@ import usePagination from "components/Referrals/usePagination"; import { getIcons } from "config/icons"; import { getNormalizedTokenSymbol } from "config/tokens"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; -import { useMarketsInfoData, useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; -import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; +import { + selectChainId, + selectGlvInfoLoading, + selectPoolsData, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectShiftAvailableMarkets } from "context/SyntheticsStateContext/selectors/shiftSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { MarketTokensAPRData, - MarketsInfoData, + PoolsInfoData, getMarketIndexName, getMarketPoolName, - getMaxPoolUsd, getMintableMarketTokens, - getPoolUsdWithoutPnl, getTotalGmInfo, useMarketTokensData, } from "domain/synthetics/markets"; import { useDaysConsideredInMarketsApr } from "domain/synthetics/markets/useDaysConsideredInMarketsApr"; import { useUserEarnings } from "domain/synthetics/markets/useUserEarnings"; import { TokenData, TokensData, convertToUsd, getTokenData } from "domain/synthetics/tokens"; -import { formatTokenAmount, formatTokenAmountWithUsd, formatUsd, formatUsdPrice } from "lib/numbers"; +import { formatTokenAmount, formatUsd, formatUsdPrice } from "lib/numbers"; import { getByKey } from "lib/objects"; -import { sortGmTokensByField } from "./sortGmTokensByField"; -import { sortGmTokensDefault } from "./sortGmTokensDefault"; +import { sortPoolsTokensByField } from "./sortPoolsTokensByField"; +import { sortPoolsTokensDefault } from "./sortPoolsTokensDefault"; import { AprInfo } from "components/AprInfo/AprInfo"; import Button from "components/Button/Button"; -import ExternalLink from "components/ExternalLink/ExternalLink"; -import { GmTokensBalanceInfo, GmTokensTotalBalanceInfo } from "components/GmTokensBalanceInfo/GmTokensBalanceInfo"; import Pagination from "components/Pagination/Pagination"; import SearchInput from "components/SearchInput/SearchInput"; import { GMListSkeleton } from "components/Skeleton/Skeleton"; import { Sorter, useSorterHandlers, type SortDirection } from "components/Sorter/Sorter"; -import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; import TokenIcon from "components/TokenIcon/TokenIcon"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; +import { getBuyableAmountGlv, getGlvMarketBadgeName, isGlv } from "domain/synthetics/markets/glv"; import GmAssetDropdown from "../GmAssetDropdown/GmAssetDropdown"; import { ExchangeTd, ExchangeTh, ExchangeTheadTr, ExchangeTr } from "../OrderList/ExchangeTable"; +import { ApyTooltipContent } from "./ApyTooltipContent"; +import { MintableAmount } from "./MintableAmount"; +import { TokenValuesInfoCell } from "./TokenValuesInfoCell"; +import { TokensBalanceInfo, TokensTotalBalanceInfo } from "./TokensBalanceInfo"; type Props = { + glvMarketsTokensApyData: MarketTokensAPRData | undefined; marketsTokensApyData: MarketTokensAPRData | undefined; marketsTokensIncentiveAprData: MarketTokensAPRData | undefined; marketsTokensLidoAprData: MarketTokensAPRData | undefined; @@ -58,15 +62,17 @@ const tokenAddressStyle = { fontSize: 5 }; export type SortField = "price" | "totalSupply" | "buyable" | "wallet" | "apy" | "unspecified"; -export function GmList({ +export function PoolsList({ marketsTokensApyData, + glvMarketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, shouldScrollToTop, isDeposit, }: Props) { const chainId = useSelector(selectChainId); - const marketsInfoData = useMarketsInfoData(); + const poolsInfo = useSelector(selectPoolsData); + const glvsLoading = useSelector(selectGlvInfoLoading); const tokensData = useTokensData(); const { marketTokensData } = useMarketTokensData(chainId, { isDeposit }); const { isConnected: active } = useAccount(); @@ -80,13 +86,14 @@ export function GmList({ [shiftAvailableMarkets] ); - const isLoading = !marketsInfoData || !marketTokensData; + const isLoading = !poolsInfo || !marketTokensData || glvsLoading; - const filteredGmTokens = useFilterSortGmPools({ - marketsInfoData, + const filteredGmTokens = useFilterSortPools({ + poolsInfo, marketTokensData, orderBy, direction, + glvMarketsTokensApyData, marketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, @@ -117,7 +124,7 @@ export function GmList({ >
- GM Pools + Pools Network Icon @@ -136,7 +143,7 @@ export function GmList({
- - - - COLLATERAL - - - AMOUNT - - - COMP. - - - - - {data.map(({ token, prefix, amountUsd, amount }, index) => { - if (amount === undefined || amountUsd === undefined || !token) { - return null; - } + if (hours) { + parts.push(hours > 1 ? t`${hours} hours` : t`hour`); + } + if (roundUpTo === "hours") { + return parts; + } - return ( - - - - - - - {prefix}: {token.symbol} - - - - - {formatAmountHuman(amount, token.decimals)} - - - {bigMath.mulDiv(amountUsd, 100n, sum).toString()} - - - ); - })} - -
- ); + if (minutes) { + parts.push(minutes > 1 ? t`${minutes} minutes` : t`minute`); + } + if (roundUpTo === "minutes") { + return parts; + } + + if (seconds) { + parts.push(seconds > 1 ? t`${seconds} seconds` : t`second`); + } + + return parts; + })(); + + return t`Every` + " " + parts.join(" "); } diff --git a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx new file mode 100644 index 0000000000..c68bef54f7 --- /dev/null +++ b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx @@ -0,0 +1,74 @@ +import { useMemo } from "react"; + +import { TOKEN_COLOR_MAP } from "config/tokens"; + +import { selectTokensData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; + +import { getPoolUsdWithoutPnl, MarketInfo } from "domain/synthetics/markets"; +import { isGlv } from "domain/synthetics/markets/glv"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; + +import { bigMath } from "lib/bigmath"; + +interface CompositionBarProps { + marketInfo?: MarketInfo | GlvPoolInfo; +} + +export function CompositionBar({ marketInfo }: CompositionBarProps) { + const tokensData = useSelector(selectTokensData); + const data = useMemo(() => { + if (!marketInfo) { + return []; + } + + if (isGlv(marketInfo)) { + return marketInfo.markets.map((market) => { + return { + value: market.gmBalance, + color: tokensData?.[market.address]?.symbol + ? TOKEN_COLOR_MAP[tokensData?.[market.address]?.symbol] + : TOKEN_COLOR_MAP.default, + }; + }); + } + + const { longToken, shortToken } = marketInfo; + const longPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, true, "midPrice") : undefined; + const shortPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, false, "midPrice") : undefined; + + return [ + { + value: longPoolAmountUsd, + color: longToken ? TOKEN_COLOR_MAP[longToken?.symbol] || TOKEN_COLOR_MAP.default : TOKEN_COLOR_MAP.default, + }, + { + value: shortPoolAmountUsd, + color: shortToken ? TOKEN_COLOR_MAP[shortToken?.symbol] || TOKEN_COLOR_MAP.default : TOKEN_COLOR_MAP.default, + }, + ]; + }, [marketInfo, tokensData]); + + const sum = data.reduce((acc, { value }) => acc + (value ?? 0n), 0n); + const percents = data.map(({ value }) => (value === undefined || sum === 0n ? 0n : bigMath.mulDiv(value, 100n, sum))); + + return ( +
+ {data.map(({ color, value }, index) => { + if (value === undefined) { + return null; + } + const widthPc = percents[index].toString(); + const previousWidthPc = index ? percents[index - 1]?.toString() : "0"; + + return ( +
+ ); + })} +
+ ); +} diff --git a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx new file mode 100644 index 0000000000..81d477a045 --- /dev/null +++ b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx @@ -0,0 +1,182 @@ +import { t, Trans } from "@lingui/macro"; +import { useMemo } from "react"; + +import { bigintToNumber, formatAmountHuman } from "lib/numbers"; + +import TokenIcon from "components/TokenIcon/TokenIcon"; +import { TOKEN_COLOR_MAP } from "config/tokens"; +import { selectMarketsInfoData, selectTokensData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { getPoolUsdWithoutPnl, MarketInfo } from "domain/synthetics/markets"; +import { isGlv } from "domain/synthetics/markets/glv"; +import { TokenData } from "domain/synthetics/tokens"; +import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; + +import { USD_DECIMALS } from "lib/legacy"; +import { getMarketIndexName } from "../../../../domain/synthetics/markets/utils"; +import { ExchangeTd, ExchangeTh, ExchangeTheadTr, ExchangeTr } from "../../OrderList/ExchangeTable"; +import { useGlvGmMarketsWithComposition } from "../hooks/useMarketGlvGmMarketsCompositions"; + +interface CompositionTableGmProps { + marketInfo?: MarketInfo | GlvPoolInfo; +} + +interface GmTableConfig { + type: "gm"; + data: { + token: TokenData; + amount: bigint; + prefix: string; + comp: number; + }[]; +} +interface GlvTableConfig { + type: "glv"; + data: { + pool: MarketInfo; + tvl: readonly [used: bigint, available: bigint]; + comp: number; + }[]; +} + +export function CompositionTableGm({ marketInfo }: CompositionTableGmProps) { + const marketsInfoData = useSelector(selectMarketsInfoData); + const tokensData = useSelector(selectTokensData); + const isGlvMarket = marketInfo && isGlv(marketInfo); + + const selectGmComposition = useGlvGmMarketsWithComposition(true, marketInfo?.marketTokenAddress); + + const [col1, col2, col3] = useMemo(() => { + if (isGlvMarket) { + return [t`POOL`, t`TVL`, t`COMP`]; + } + + return [t`COLLATERAL`, t`AMOUNT`, t`COMP`]; + }, [isGlvMarket]); + + const table: GmTableConfig | GlvTableConfig | undefined = useMemo(() => { + if (!marketInfo) { + return undefined; + } + + if (isGlvMarket) { + if (!marketsInfoData || !tokensData) { + return undefined; + } + + return { + type: "glv", + data: selectGmComposition, + }; + } + + const { longToken, shortToken, longPoolAmount, shortPoolAmount } = marketInfo; + const longPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, true, "midPrice") : undefined; + const shortPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, false, "midPrice") : undefined; + + const sum = bigintToNumber((longPoolAmountUsd ?? 0n) + (shortPoolAmountUsd ?? 0n), USD_DECIMALS); + + return { + type: "gm", + data: [ + { + token: longToken, + amount: longPoolAmount, + comp: longPoolAmountUsd !== undefined ? (bigintToNumber(longPoolAmountUsd, USD_DECIMALS) * 100) / sum : 0, + prefix: "Long", + }, + { + token: shortToken, + amount: shortPoolAmount, + comp: shortPoolAmountUsd !== undefined ? (bigintToNumber(shortPoolAmountUsd, USD_DECIMALS) * 100) / sum : 0, + prefix: "Short", + }, + ], + }; + }, [marketInfo, marketsInfoData, isGlvMarket, tokensData, selectGmComposition]); + + const rows = useMemo(() => { + if (!table) { + return null; + } + + if (table.type === "glv") { + return table.data.map(({ comp, pool, tvl }, index) => { + if (comp === undefined || comp === undefined || !pool) { + return null; + } + + return ( + + + + + + {getMarketIndexName({ indexToken: pool.indexToken, isSpotOnly: false })} + + + + {formatAmountHuman(tvl[0], USD_DECIMALS, true, 0)}/{formatAmountHuman(tvl[1], USD_DECIMALS, true, 0)} + + + {comp.toString()} + + + ); + }); + } + + if (table.type === "gm") { + return table.data.map(({ amount, comp, token, prefix }, index) => { + if (amount === undefined || comp === undefined || !token) { + return null; + } + + return ( + + + + + + + {prefix}: {token.symbol} + + + + + {formatAmountHuman(amount, token.decimals)} + + + {comp.toFixed(2)} + + + ); + }); + } + }, [table]); + + return ( + + + + + {col1} + + + {col2} + + + {col3} + + + + {rows} +
+ ); +} diff --git a/src/components/Synthetics/MarketStats/MarketDescription.tsx b/src/components/Synthetics/MarketStats/components/MarketDescription.tsx similarity index 84% rename from src/components/Synthetics/MarketStats/MarketDescription.tsx rename to src/components/Synthetics/MarketStats/components/MarketDescription.tsx index 75712cf2da..aafaeecb0a 100644 --- a/src/components/Synthetics/MarketStats/MarketDescription.tsx +++ b/src/components/Synthetics/MarketStats/components/MarketDescription.tsx @@ -1,8 +1,7 @@ import { Trans } from "@lingui/macro"; import { getMarketIndexName, MarketInfo } from "domain/synthetics/markets"; - -import "./MarketStats.scss"; +import { isGlv } from "domain/synthetics/markets/glv"; type Props = { marketInfo?: MarketInfo; @@ -43,5 +42,14 @@ export function MarketDescription({ marketInfo }: Props) { ); } + if (isGlv(marketInfo)) { + text = ( + + This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps + from the included markets. + + ); + } + return
{text}
; } diff --git a/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts b/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts new file mode 100644 index 0000000000..c355a5cfed --- /dev/null +++ b/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts @@ -0,0 +1,54 @@ +import { selectPoolsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useMarketTokensData } from "domain/synthetics/markets"; +import { getMaxUsdBuyableAmountInMarket, isGlv } from "domain/synthetics/markets/glv"; +import { useChainId } from "lib/chains"; +import { bigintToNumber } from "lib/numbers"; +import { useMemo } from "react"; + +export const useGlvGmMarketsWithComposition = (isDeposit: boolean, glvAddress?: string) => { + const { chainId } = useChainId(); + const { marketTokensData } = useMarketTokensData(chainId, { + isDeposit, + }); + + const allMarkets = useSelector(selectPoolsData); + + return useMemo(() => { + if (!glvAddress) { + return []; + } + + const glv = allMarkets[glvAddress]; + + if (!glv || !isGlv(glv)) { + return []; + } + + const sum = glv.markets.reduce((acc, market) => acc + market.gmBalance, 0n); + const rows = glv.markets + .map((market) => { + const gmMarket = allMarkets[market.address]; + const token = marketTokensData?.[gmMarket?.marketTokenAddress]; + + if (!token) { + return null; + } + + return { + amount: market.gmBalance, + pool: gmMarket, + tvl: [ + (market.gmBalance * token.prices.maxPrice) / 10n ** BigInt(token.decimals), + getMaxUsdBuyableAmountInMarket(glv.indexToken.prices.maxPrice, market, glv), + ] as const, + comp: sum === 0n ? 0 : (bigintToNumber(market.gmBalance, 1) * 100) / bigintToNumber(sum, 1), + }; + }) + .filter(Boolean as unknown as (x: T | null) => x is T); + + return rows.sort((a, b) => { + return b.comp - a.comp; + }); + }, [allMarkets, glvAddress, marketTokensData]); +}; diff --git a/src/components/Synthetics/MarketStats/hooks/useMarketMintableTokens.ts b/src/components/Synthetics/MarketStats/hooks/useMarketMintableTokens.ts new file mode 100644 index 0000000000..72d64a114e --- /dev/null +++ b/src/components/Synthetics/MarketStats/hooks/useMarketMintableTokens.ts @@ -0,0 +1,14 @@ +import { getMintableMarketTokens, MarketInfo } from "domain/synthetics/markets"; +import { getMintableInfoGlv, isGlv } from "domain/synthetics/markets/glv"; +import { TokenData } from "domain/synthetics/tokens"; + +export const useMarketMintableTokens = (marketInfo?: MarketInfo, marketToken?: TokenData) => { + if (!marketInfo) { + return undefined; + } + if (isGlv(marketInfo)) { + return getMintableInfoGlv(marketInfo); + } + + return marketToken ? getMintableMarketTokens(marketInfo, marketToken) : undefined; +}; diff --git a/src/components/Synthetics/MarketStats/hooks/useMarketSellableToken.ts b/src/components/Synthetics/MarketStats/hooks/useMarketSellableToken.ts new file mode 100644 index 0000000000..171913abe5 --- /dev/null +++ b/src/components/Synthetics/MarketStats/hooks/useMarketSellableToken.ts @@ -0,0 +1,19 @@ +import { selectMarketsInfoData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { getSellableMarketToken, MarketInfo } from "domain/synthetics/markets"; +import { getSellableInfoGlv, isGlv } from "domain/synthetics/markets/glv"; +import { TokenData, TokensData } from "domain/synthetics/tokens"; + +export const useMarketSellableToken = (marketInfo?: MarketInfo, marketToken?: TokenData, tokensData?: TokensData) => { + const marketsInfoData = useSelector(selectMarketsInfoData); + + if (!marketInfo) { + return undefined; + } + + if (isGlv(marketInfo)) { + return getSellableInfoGlv(marketInfo, marketsInfoData, tokensData); + } + + return marketToken ? getSellableMarketToken(marketInfo, marketToken) : undefined; +}; diff --git a/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx b/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx index d1ac3a5213..1f5383cab1 100644 --- a/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +++ b/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -38,6 +38,7 @@ import { SelectorBaseMobileHeaderContent, useSelectorClose, } from "../SelectorBase/SelectorBase"; +import { getGlvMarketBadgeName, isGlv } from "domain/synthetics/markets/glv"; type Props = { marketsInfoData?: MarketsInfoData; @@ -66,6 +67,8 @@ export default function MarketTokenSelector(props: Props) { getNormalizedTokenSymbol(currentMarketInfo.shortToken.symbol) : currentMarketInfo?.indexToken.symbol; + const isGlvMarket = currentMarketInfo && isGlv(currentMarketInfo); + return ( {currentMarketInfo ? ( <> - +
- GM{indexName && `: ${indexName}`} + {isGlvMarket ? ( + GLV: {currentMarketInfo.name} + ) : ( + GM{indexName && `: ${indexName}`} + )} {poolName && `[${poolName}]`} diff --git a/src/components/Synthetics/PoolsList/PoolsList.tsx b/src/components/Synthetics/PoolsList/PoolsList.tsx index 764d034492..7275f29e64 100644 --- a/src/components/Synthetics/PoolsList/PoolsList.tsx +++ b/src/components/Synthetics/PoolsList/PoolsList.tsx @@ -41,7 +41,7 @@ import { GMListSkeleton } from "components/Skeleton/Skeleton"; import { Sorter, useSorterHandlers, type SortDirection } from "components/Sorter/Sorter"; import TokenIcon from "components/TokenIcon/TokenIcon"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; -import { getBuyableAmountGlv, getGlvMarketBadgeName, isGlv } from "domain/synthetics/markets/glv"; +import { getMintableInfoGlv, getGlvMarketBadgeName, isGlv } from "domain/synthetics/markets/glv"; import GmAssetDropdown from "../GmAssetDropdown/GmAssetDropdown"; import { ExchangeTd, ExchangeTh, ExchangeTheadTr, ExchangeTr } from "../OrderList/ExchangeTable"; import { ApyTooltipContent } from "./ApyTooltipContent"; @@ -275,6 +275,7 @@ function useFilterSortPools({ marketsTokensApyData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, + glvMarketsTokensApyData, }); }, [ chainId, @@ -283,6 +284,7 @@ function useFilterSortPools({ poolsInfo, marketsTokensApyData, marketsTokensIncentiveAprData, + glvMarketsTokensApyData, marketsTokensLidoAprData, orderBy, ]); @@ -466,7 +468,7 @@ function PoolsListItem({ {formatUsdPrice(token.prices?.minPrice)} {isGlvMarket ? ( - + ) : ( (mintableB?.mintableUsd ?? 0n) ? directionMultiplier diff --git a/src/config/contracts.ts b/src/config/contracts.ts index 7076c4a09d..f6fa1e929b 100644 --- a/src/config/contracts.ts +++ b/src/config/contracts.ts @@ -133,6 +133,10 @@ const CONTRACTS = { SyntheticsRouter: "0xa960786Bc30F8587279df6116F9E0B15C5b034dE", Timelock: ZeroAddress, + // @todo + GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", + GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", + Multicall: "0x6d85594c9BD6b0833bC85AE62B360654A1e52D70", }, [ARBITRUM]: { @@ -189,6 +193,9 @@ const CONTRACTS = { ShiftVault: "0xfe99609C4AA83ff6816b64563Bdffd7fa68753Ab", SyntheticsReader: "0x5Ca84c34a381434786738735265b9f3FD814b824", SyntheticsRouter: "0x7452c558d45f8afC8c83dAe62C3f8A5BE19c71f6", + // @todo + GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", + GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", Multicall: "0x842ec2c7d803033edf55e478f461fc547bc54eb2", }, @@ -247,6 +254,9 @@ const CONTRACTS = { ShiftVault: "0x7fC46CCb386e9bbBFB49A2639002734C3Ec52b39", SyntheticsReader: "0xBAD04dDcc5CC284A86493aFA75D2BEb970C72216", SyntheticsRouter: "0x820F5FfC5b525cD4d88Cd91aCf2c28F16530Cc68", + // @todo + GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", + GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", Multicall: "0xcA11bde05977b3631167028862bE2a173976CA11", }, @@ -304,7 +314,9 @@ const CONTRACTS = { SyntheticsReader: "0xD52216D3A57F7eb1126498f00A4771553c737AE4", SyntheticsRouter: "0x5e7d61e4C52123ADF651961e4833aCc349b61491", Timelock: ZeroAddress, + GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", + GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", Multicall: "0x0f53e512b49202a37c81c6085417C9a9005F2196", }, diff --git a/src/config/localStorage.ts b/src/config/localStorage.ts index 28f1c2b438..1c52891bca 100644 --- a/src/config/localStorage.ts +++ b/src/config/localStorage.ts @@ -30,6 +30,7 @@ export const SYNTHETICS_TRADE_OPTIONS = "synthetics-trade-options"; export const SYNTHETICS_ACCEPTABLE_PRICE_IMPACT_BUFFER_KEY = "synthetics-acceptable-price-impact-buffer"; export const SYNTHETICS_DEPOSIT_INDEX_TOKEN_KEY = "synthetics-deposit-index-token"; export const SYNTHETICS_DEPOSIT_MARKET_KEY = "synthetics-market-deposit-market"; +export const SYNTHETICS_DEPOSIT_MARKET_GLV_KEY = "synthetics-market-glv-deposit-market"; export const SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY = "synthetics-market-deposit-token"; export const SYNTHETICS_COLLATERAL_DEPOSIT_TOKEN_KEY = "synthetics-collateral-deposit-token"; @@ -65,6 +66,10 @@ export function getSyntheticsDepositMarketKey(chainId: number) { return [chainId, SYNTHETICS_DEPOSIT_MARKET_KEY]; } +export function getSyntheticsDepositGlvMarketKey(chainId: number) { + return [chainId, SYNTHETICS_DEPOSIT_MARKET_GLV_KEY]; +} + export function getSyntheticsListSectionKey(chainId: number) { return [chainId, SYNTHETICS_LIST_SECTION_KEY]; } diff --git a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx index 88de3a3046..32833cea1f 100644 --- a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx +++ b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx @@ -122,9 +122,19 @@ export function SyntheticsStateContextProvider({ const markets = useMarkets(chainId); const marketsInfo = useMarketsInfoRequest(chainId); + + const isPoolsPage = pageType === "pools" || pageType === "dashboard"; + const glvInfo = useGlvPoolsInfo(isPoolsPage, { + marketsInfoData: marketsInfo.marketsInfoData, + tokensData: marketsInfo.tokensData, + chainId: chainId, + account: account, + }); + const { marketTokensData: depositMarketTokensData } = useMarketTokensDataRequest(chainId, { isDeposit: true, account, + glvMarketsData: glvInfo.glvPoolsInfo, }); const positionsConstants = usePositionsConstantsRequest(chainId); const uiFeeFactor = useUiFeeFactor(chainId); @@ -135,14 +145,6 @@ export function SyntheticsStateContextProvider({ isTradePage ); - const isPoolsPage = pageType === "pools" || pageType === "dashboard"; - const glvInfo = useGlvPoolsInfo(isPoolsPage, { - marketsInfoData: marketsInfo.marketsInfoData, - tokensData: marketsInfo.tokensData, - chainId: chainId, - account: account, - }); - const settings = useSettings(); const { isLoading, positionsInfoData } = usePositionsInfoRequest(chainId, { diff --git a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts index af9a5dba99..4380660ceb 100644 --- a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts @@ -1,5 +1,9 @@ +import { getMaxUsdBuyableAmountInMarket, isGlv } from "domain/synthetics/markets/glv"; import { SyntheticsState } from "../SyntheticsStateContextProvider"; -import { createSelectorDeprecated, createSelector } from "../utils"; +import { createSelectorDeprecated, createSelector, createSelectorFactory } from "../utils"; +import { bigintToNumber } from "lib/numbers"; +import ToggleSwitch from "components/ToggleSwitch/ToggleSwitch"; +import { TokensData } from "domain/synthetics/tokens"; export const selectAccount = (s: SyntheticsState) => s.globals.account; export const selectOrdersInfoData = (s: SyntheticsState) => s.globals.ordersInfo.ordersInfoData; diff --git a/src/domain/synthetics/markets/createDepositTxn.ts b/src/domain/synthetics/markets/createDepositTxn.ts index b421a048be..f6b7dd4828 100644 --- a/src/domain/synthetics/markets/createDepositTxn.ts +++ b/src/domain/synthetics/markets/createDepositTxn.ts @@ -9,6 +9,9 @@ import { simulateExecuteTxn } from "../orders/simulateExecuteTxn"; import { TokensData } from "../tokens"; import { UI_FEE_RECEIVER_ACCOUNT } from "config/ui"; import { t } from "@lingui/macro"; +import { useMulticall } from "lib/multicall"; + +import GlvRouter from "abis/GlvRouter.json"; type Params = { account: string; @@ -126,3 +129,104 @@ export async function createDepositTxn(chainId: number, signer: Signer, p: Param }); }); } + +// interface GlvParams { +// account: account, +// glv: params.glv, +// receiver: params.receiver, +// callbackContract: params.callbackContract, +// uiFeeReceiver: params.uiFeeReceiver, +// market: params.market, +// initialLongToken: params.initialLongToken, +// initialShortToken: params.initialShortToken, +// longTokenSwapPath: params.longTokenSwapPath, +// shortTokenSwapPath: params.shortTokenSwapPath + +// export async function createGlvDepositTxn(chainId: number, signer: Signer, p: GlvParams) { +// const contract = getContract(chainId, "GlvRouter"); +// return useMulticall(chainId, "createGlvDepositTxn", { +// refreshInterval: null, +// key: ["createGlvDepositTxn"], +// request: () => { +// return { +// glvs: { +// contractAddress: contract, +// abi: GlvRouter.abi, +// calls: { +// list: { +// methodName: "createGlvDeposit", +// // { +// // "internalType": "address", +// // "name": "receiver", +// // "type": "address" +// // }, +// // { +// // "internalType": "address", +// // "name": "callbackContract", +// // "type": "address" +// // }, +// // { +// // "internalType": "address", +// // "name": "uiFeeReceiver", +// // "type": "address" +// // }, +// // { +// // "internalType": "address", +// // "name": "market", +// // "type": "address" +// // }, +// // { +// // "internalType": "address", +// // "name": "glv", +// // "type": "address" +// // }, +// // { +// // "internalType": "address[]", +// // "name": "longTokenSwapPath", +// // "type": "address[]" +// // }, +// // { +// // "internalType": "address[]", +// // "name": "shortTokenSwapPath", +// // "type": "address[]" +// // }, +// // { +// // "internalType": "uint256", +// // "name": "minLongTokenAmount", +// // "type": "uint256" +// // }, +// // { +// // "internalType": "uint256", +// // "name": "minShortTokenAmount", +// // "type": "uint256" +// // }, +// // { +// // "internalType": "bool", +// // "name": "shouldUnwrapNativeToken", +// // "type": "bool" +// // }, +// // { +// // "internalType": "uint256", +// // "name": "executionFee", +// // "type": "uint256" +// // }, +// // { +// // "internalType": "uint256", +// // "name": "callbackGasLimit", +// // "type": "uint256" +// // } +// params: [{ +// receiver: p.account, +// } + +// ], +// }, +// }, +// }, +// }; +// }, +// parseResponse(result) { +// return result.data.glvs.list.returnValues as GlvList; +// }, +// }); +// } diff --git a/src/domain/synthetics/markets/glv.spec.ts b/src/domain/synthetics/markets/glv.spec.ts index ac8b6f4323..78fd954097 100644 --- a/src/domain/synthetics/markets/glv.spec.ts +++ b/src/domain/synthetics/markets/glv.spec.ts @@ -7,7 +7,7 @@ import { bigMath } from "lib/bigmath"; import { convertToUsd } from "../tokens/utils"; -export function getBuyableAmountGlv(glv: GlvPoolInfo) { +export function getMintableInfoGlv(glv: GlvPoolInfo) { const glvPriceUsd = glv.indexToken.prices.maxPrice; const amountUsd = values(glv.markets).reduce((acc, market) => { diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts index c08397f3f1..470351e6f2 100644 --- a/src/domain/synthetics/markets/glv.ts +++ b/src/domain/synthetics/markets/glv.ts @@ -1,33 +1,75 @@ import values from "lodash/values"; -import { MarketInfo } from "domain/synthetics/markets"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { getSellableMarketToken, MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; +import { GlvMarket, GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; import { bigMath } from "lib/bigmath"; import { convertToUsd } from "../tokens/utils"; +import { TokensData } from "../tokens"; -export function getBuyableAmountGlv(glv: GlvPoolInfo) { +export function getMaxUsdBuyableAmountInMarket(glvPriceUsd: bigint, market: GlvMarket, glv: GlvPoolInfo) { + const gmBalanceUsd = convertToUsd(market.gmBalance, glv.indexToken.decimals, glvPriceUsd) ?? 0n; + + return ( + bigMath.min( + market.maxMarketTokenBalanceUsd, + convertToUsd(market.glvMaxMarketTokenBalanceAmount, glv.indexToken.decimals, glvPriceUsd) ?? 0n + ) - gmBalanceUsd + ); +} + +export function getMintableInfoGlv(glv: GlvPoolInfo) { const glvPriceUsd = glv.indexToken.prices.maxPrice; const amountUsd = values(glv.markets).reduce((acc, market) => { - return ( - acc + - bigMath.min( - market.maxMarketTokenBalanceUsd, - convertToUsd(market.glvMaxMarketTokenBalanceAmount, glv.indexToken.decimals, glvPriceUsd) ?? 0n - ) - ); + return acc + getMaxUsdBuyableAmountInMarket(glvPriceUsd, market, glv); }, 0n); return { mintableAmount: (amountUsd / glvPriceUsd) * 10n ** BigInt(glv.indexToken.decimals), mintableUsd: amountUsd, + // @todo + longDepositCapacityUsd: undefined, + shortDepositCapacityUsd: undefined, + longDepositCapacityAmount: undefined, + shortDepositCapacityAmount: undefined, + }; +} + +export function getSellableInfoGlv(glv: GlvPoolInfo, marketsData?: MarketsInfoData, tokensData?: TokensData) { + const glvPriceUsd = glv.indexToken.prices.maxPrice; + const amountUsd = values(glv.markets).reduce((acc, market) => { + const gmMarket = marketsData?.[market.address]; + + if (!gmMarket) { + console.warn(`Market ${market.address} presented in GLV Vault doesn't exist in the markets data`); + return acc; + } + + const gmMarketToken = tokensData?.[gmMarket.marketTokenAddress]; + + if (!gmMarketToken) { + return acc; + } + + const marketSellableUsd = getSellableMarketToken(gmMarket, gmMarketToken)?.totalUsd ?? 0n; + const gmBalanceUsd = convertToUsd(market.gmBalance, glv.indexToken.decimals, glvPriceUsd) ?? 0n; + + return acc + bigMath.min(marketSellableUsd, gmBalanceUsd); + }, 0n); + + return { + // @todo + maxLongSellableUsd: 0n, + maxShortSellableUsd: 0n, + totalAmount: (amountUsd / glvPriceUsd) * 10n ** BigInt(glv.indexToken.decimals), + totalUsd: amountUsd, }; } -export function isGlv(pool: GlvPoolInfo | MarketInfo): pool is GlvPoolInfo { - return (pool as GlvPoolInfo).isGlv === true; +export function isGlv(pool?: GlvPoolInfo | MarketInfo): pool is GlvPoolInfo { + return Boolean(pool && "isGlv" in pool && pool.isGlv); } export function getGlvMarketBadgeName(name: string) { diff --git a/src/domain/synthetics/markets/types.ts b/src/domain/synthetics/markets/types.ts index a6b7b821fb..08431a783e 100644 --- a/src/domain/synthetics/markets/types.ts +++ b/src/domain/synthetics/markets/types.ts @@ -158,15 +158,15 @@ export type UserEarningsData = { }; export type ContractMarketPrices = { - indexTokenPrice: { + indexTokenPrice?: { min: bigint; max: bigint; }; - longTokenPrice: { + longTokenPrice?: { min: bigint; max: bigint; }; - shortTokenPrice: { + shortTokenPrice?: { min: bigint; max: bigint; }; diff --git a/src/domain/synthetics/markets/useGmMarketsApy.ts b/src/domain/synthetics/markets/useGmMarketsApy.ts index 31c3ebcbee..07cc0b5443 100644 --- a/src/domain/synthetics/markets/useGmMarketsApy.ts +++ b/src/domain/synthetics/markets/useGmMarketsApy.ts @@ -379,10 +379,14 @@ export function useGmMarketsApy(chainId: number): GmGlvTokensAPRResult { }; }); - const total = marketData.reduce((acc, { amountUsd }) => acc + amountUsd, 0n); - const sumApys = marketData.reduce((acc, { amountUsd, apy }) => acc + amountUsd * apy, 0n); + try { + const total = marketData.reduce((acc, { amountUsd }) => acc + amountUsd, 0n); + const sumApys = marketData.reduce((acc, { amountUsd, apy }) => acc + amountUsd * apy, 0n); - acc[indexTokenAddress] = total === 0n ? 0n : sumApys / total; + acc[indexTokenAddress] = total === 0n ? 0n : sumApys / total; + } catch (e) { + debugger; // eslint-disable-line + } return acc; }, {}); }, [glvPoolsInfo, data?.marketsTokensApyData, marketTokensData]); diff --git a/src/domain/synthetics/markets/useMarketTokensData.ts b/src/domain/synthetics/markets/useMarketTokensData.ts index c6548d5360..2813f7145c 100644 --- a/src/domain/synthetics/markets/useMarketTokensData.ts +++ b/src/domain/synthetics/markets/useMarketTokensData.ts @@ -16,6 +16,9 @@ import { getContractMarketPrices } from "./utils"; import SyntheticsReader from "abis/SyntheticsReader.json"; import TokenAbi from "abis/Token.json"; +import { GlvPoolsData } from "../tokens/useGlvPools"; +import { useMemo } from "react"; +import { selectGlvInfo } from "context/SyntheticsStateContext/selectors/globalSelectors"; type MarketTokensDataResult = { marketTokensData?: TokensData; @@ -23,13 +26,13 @@ type MarketTokensDataResult = { export function useMarketTokensDataRequest( chainId: number, - p: { isDeposit: boolean; account?: string } + p: { isDeposit: boolean; account?: string; glvMarketsData?: GlvPoolsData } ): MarketTokensDataResult { - const { isDeposit, account } = p; + const { isDeposit, account, glvMarketsData = {} } = p; const { tokensData } = useTokensDataRequest(chainId); const { marketsData, marketsAddresses } = useMarkets(chainId); - const isDataLoaded = tokensData && marketsAddresses?.length; + const isDataLoaded = tokensData && marketsAddresses?.length && Object.values(glvMarketsData).length > 0; const { data } = useMulticall(chainId, "useMarketTokensData", { key: isDataLoaded ? [account, marketsAddresses.join("-")] : undefined, @@ -137,14 +140,28 @@ export function useMarketTokensDataRequest( }, {} as TokensData), }); + const enrichedData = useMemo(() => { + if (!data || !glvMarketsData || Object.values(glvMarketsData).length === 0) { + return data; + } + + const result = { ...data }; + Object.values(glvMarketsData).forEach((glvMarket) => { + result[glvMarket.indexTokenAddress] = glvMarket.indexToken; + }); + + return result; + }, [data, glvMarketsData]); + return { - marketTokensData: data, + marketTokensData: enrichedData, }; } export function useMarketTokensData(chainId: number, p: { isDeposit: boolean }): MarketTokensDataResult { const { isDeposit } = p; const account = useSelector((s) => s.globals.account); + const glvMarketsData = useSelector(selectGlvInfo); - return useMarketTokensDataRequest(chainId, { isDeposit, account }); + return useMarketTokensDataRequest(chainId, { isDeposit, account, glvMarketsData: glvMarketsData }); } diff --git a/src/domain/synthetics/markets/utils.ts b/src/domain/synthetics/markets/utils.ts index 3f2889054c..e56ab1cca9 100644 --- a/src/domain/synthetics/markets/utils.ts +++ b/src/domain/synthetics/markets/utils.ts @@ -444,19 +444,26 @@ export function marketTokenAmountToUsd(marketInfo: MarketInfo, marketToken: Toke return convertToUsd(amount, marketToken.decimals, price)!; } -export function getContractMarketPrices(tokensData: TokensData, market: Market): ContractMarketPrices | undefined { +export function getContractMarketPrices( + tokensData: TokensData, + market: Pick, "longTokenAddress" | "shortTokenAddress" | "indexTokenAddress"> +): ContractMarketPrices | undefined { const indexToken = getByKey(tokensData, market.indexTokenAddress); const longToken = getByKey(tokensData, market.longTokenAddress); const shortToken = getByKey(tokensData, market.shortTokenAddress); - if (!indexToken || !longToken || !shortToken) { + if ( + (market.indexTokenAddress && !indexToken) || + (market.longTokenAddress && !longToken) || + (market.shortTokenAddress && !shortToken) + ) { return undefined; } return { - indexTokenPrice: convertToContractTokenPrices(indexToken.prices, indexToken.decimals), - longTokenPrice: convertToContractTokenPrices(longToken.prices, longToken.decimals), - shortTokenPrice: convertToContractTokenPrices(shortToken.prices, shortToken.decimals), + indexTokenPrice: indexToken && convertToContractTokenPrices(indexToken.prices, indexToken.decimals), + longTokenPrice: longToken && convertToContractTokenPrices(longToken.prices, longToken.decimals), + shortTokenPrice: shortToken && convertToContractTokenPrices(shortToken.prices, shortToken.decimals), }; } diff --git a/src/domain/synthetics/tokens/useGlvPools.ts b/src/domain/synthetics/tokens/useGlvPools.ts index 137ec3fcfa..8a52ae58b3 100644 --- a/src/domain/synthetics/tokens/useGlvPools.ts +++ b/src/domain/synthetics/tokens/useGlvPools.ts @@ -10,9 +10,9 @@ import { glvShiftMinIntervalKey, isGlvMarketDisabledKey, } from "config/dataStore"; -import { getTokenBySymbol, TOKENS } from "config/tokens"; +import { getTokenBySymbol } from "config/tokens"; import { MulticallRequestConfig, useMulticall } from "lib/multicall"; -import { getGlvMarketName, MarketInfo, MarketsInfoData } from "../markets"; +import { getContractMarketPrices, getGlvMarketName, MarketInfo, MarketsInfoData } from "../markets"; import { TokenData, TokensData } from "./types"; export type GlvList = { @@ -30,13 +30,16 @@ export type GlvPoolsData = { export interface GlvPoolInfo extends MarketInfo { isGlv: true; + indexToken: TokenData & { + contractSymbol: string; + }; marketTokenAddress: string; indexTokenAddress: string; longTokenAddress: string; shortTokenAddress: string; markets: GlvMarket[]; - glvShiftLastExecutedAt: bigint; - glvShiftMinInterval: bigint; + shiftLastExecutedAt: bigint; + shiftMinInterval: bigint; } export interface GlvMarket { @@ -109,6 +112,11 @@ export function useGlvPoolsInfo( } const request = glvs.reduce((acc, { glv, markets }) => { + const contractGlvPrices = getContractMarketPrices(tokensData, { + longTokenAddress: glv.longToken, + shortTokenAddress: glv.shortToken, + }); + acc[glv.glvToken + "-prices"] = { contractAddress: glvReaderAddress, abi: GlvReader.abi, @@ -119,13 +127,12 @@ export function useGlvPoolsInfo( dataStoreAddress, markets, markets.map((market) => { - return [ - marketsInfoData[market].indexToken.prices.minPrice, - marketsInfoData[market].indexToken.prices.maxPrice, - ]; + const contractPrices = getContractMarketPrices(tokensData, marketsInfoData[market]); + + return [contractPrices?.indexTokenPrice!.min, contractPrices?.indexTokenPrice!.min]; }), - [tokensData[glv.longToken].prices.maxPrice, tokensData[glv.longToken].prices.minPrice], - [tokensData[glv.shortToken].prices.maxPrice, tokensData[glv.shortToken].prices.minPrice], + [contractGlvPrices?.longTokenPrice!.max, contractGlvPrices?.longTokenPrice!.min], + [contractGlvPrices?.shortTokenPrice!.max, contractGlvPrices?.shortTokenPrice!.min], glv.glvToken, false, ], @@ -136,13 +143,12 @@ export function useGlvPoolsInfo( dataStoreAddress, markets, markets.map((market) => { - return [ - marketsInfoData[market].indexToken.prices.minPrice, - marketsInfoData[market].indexToken.prices.maxPrice, - ]; + const contractPrices = getContractMarketPrices(tokensData, marketsInfoData[market]); + + return [contractPrices?.indexTokenPrice!.min, contractPrices?.indexTokenPrice!.min]; }), - [tokensData[glv.longToken].prices.maxPrice, tokensData[glv.longToken].prices.minPrice], - [tokensData[glv.shortToken].prices.maxPrice, tokensData[glv.shortToken].prices.minPrice], + [contractGlvPrices?.longTokenPrice!.max, contractGlvPrices?.longTokenPrice!.min], + [contractGlvPrices?.shortTokenPrice!.max, contractGlvPrices?.shortTokenPrice!.min], glv.glvToken, true, ], @@ -162,6 +168,10 @@ export function useGlvPoolsInfo( methodName: "balanceOf", params: [account], }, + symbol: { + methodName: "symbol", + params: [], + }, }, }; @@ -235,24 +245,28 @@ export function useGlvPoolsInfo( const tokenConfig = getTokenBySymbol(chainId, "GLV"); - const indexToken: TokenData = { + const indexToken: TokenData & { + contractSymbol: string; + } = { ...tokenConfig, address: glv.glvToken, prices: { - minPrice: priceMin, - maxPrice: priceMax, + minPrice: priceMin, // 10n ** BigInt(18), + maxPrice: priceMax, // 10n ** BigInt(18), }, totalSupply: totalSupply, // @todo - usdAmountMax: usdAmountMax, - usdAmountMin: usdAmountMin, + // usdAmountMax: usdAmountMax, + // usdAmountMin: usdAmountMin, balance: data[glv.glvToken + "-tokenData"].balance.returnValues[0], - ...data[glv.glvToken + "-tokenData"].returnValues, + contractSymbol: data[glv.glvToken + "-tokenData"].symbol.returnValues[0], }; result[glv.glvToken] = { ...glv, ...data[glv.glvToken + "-info"].returnValues, + shiftLastExecutedAt: data[glv.glvToken + "-info"].glvShiftLastExecutedAt.returnValues[0], + shiftMinInterval: data[glv.glvToken + "-info"].glvShiftMinInterval.returnValues[0], isGlv: true, indexToken: indexToken, longToken: tokensData[glv.longToken], @@ -267,17 +281,21 @@ export function useGlvPoolsInfo( isDisabled: markets.every( (market) => data[glv.glvToken + "-" + market + "-info"].isGlvMarketDisabled.returnValues[0] ), - markets: markets.map((market) => { - const marketData = data[glv.glvToken + "-" + market + "-info"]; - const marketBalance = data[glv.glvToken + "-" + market + "-gm-balance"].balance.returnValues[0]; - return { - address: market, - isDisabled: marketData.isGlvMarketDisabled.returnValues[0], - maxMarketTokenBalanceUsd: marketData.maxMarketTokenBalanceUsd.returnValues[0], - glvMaxMarketTokenBalanceAmount: marketData.glvMaxMarketTokenBalanceAmount.returnValues[0], - gmBalance: marketBalance, - }; - }), + markets: markets + .map((market) => { + const marketData = data[glv.glvToken + "-" + market + "-info"]; + const marketBalance = data[glv.glvToken + "-" + market + "-gm-balance"].balance.returnValues[0]; + return { + address: market, + isDisabled: marketData.isGlvMarketDisabled.returnValues[0], + maxMarketTokenBalanceUsd: marketData.maxMarketTokenBalanceUsd.returnValues[0], + glvMaxMarketTokenBalanceAmount: marketData.glvMaxMarketTokenBalanceAmount.returnValues[0], + gmBalance: marketBalance, + }; + }) + .sort((a, b) => { + return a.gmBalance > b.gmBalance ? -1 : 1; + }), }; }); return result; diff --git a/src/domain/synthetics/trade/useAvailableTokenOptions.ts b/src/domain/synthetics/trade/useAvailableTokenOptions.ts index 55bbb5de4d..6b9ac1b0e1 100644 --- a/src/domain/synthetics/trade/useAvailableTokenOptions.ts +++ b/src/domain/synthetics/trade/useAvailableTokenOptions.ts @@ -4,6 +4,7 @@ import { InfoTokens, Token, getMidPrice } from "domain/tokens"; import { getByKey } from "lib/objects"; import { useMemo } from "react"; import { TokenData, TokensData, adaptToV1InfoTokens, convertToUsd } from "../tokens"; +import { isGlv } from "../markets/glv"; export type AvailableTokenOptions = { tokensMap: { [address: string]: Token }; @@ -43,6 +44,10 @@ export function useAvailableTokenOptions( const shortTokensWithPoolValue: { [address: string]: bigint } = {}; for (const marketInfo of marketsInfo) { + if (isGlv(marketInfo)) { + continue; + } + const longToken = marketInfo.longToken; const shortToken = marketInfo.shortToken; const indexToken = marketInfo.indexToken; diff --git a/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts b/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts index cc248f83e1..ddb6e4b709 100644 --- a/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts +++ b/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts @@ -3,7 +3,8 @@ import { useMemo } from "react"; import { EMPTY_ARRAY, getByKey } from "lib/objects"; -import type { MarketInfo, MarketsInfoData } from "../markets"; +import type { MarketInfo, PoolsInfoData } from "../markets"; +import { isGlv } from "../markets/glv"; import { type TokenData, type TokensData, convertToUsd } from "../tokens"; const DEFAULT_VALUE = { @@ -12,7 +13,7 @@ const DEFAULT_VALUE = { }; export function sortMarketsWithIndexToken( - marketsInfoData: MarketsInfoData | undefined, + marketsInfoData: PoolsInfoData | undefined, marketTokensData: TokensData | undefined ) { if (!marketsInfoData || !marketTokensData) { @@ -31,18 +32,29 @@ export function sortMarketsWithIndexToken( const marketInfoData = getByKey(marketsInfoData, market.marketTokenAddress)!; return !marketInfoData.isDisabled; }) - .map((market) => getByKey(marketTokensData, market.marketTokenAddress)!); + .map((market) => ({ + isGlv: isGlv(market), + token: getByKey(marketTokensData, market.marketTokenAddress)!, + })); }) .filter((markets) => markets.length > 0); const sortedGroups = allMarkets!.sort((a, b) => { - const totalMarketSupplyA = a.reduce((acc, market) => { + if (a[0].isGlv && !b[0].isGlv) { + return -1; + } + + if (!a[0].isGlv && b[0].isGlv) { + return 1; + } + + const totalMarketSupplyA = a.reduce((acc, { token: market }) => { const totalSupplyUsd = convertToUsd(market?.totalSupply, market?.decimals, market?.prices.minPrice); acc = acc + (totalSupplyUsd ?? 0n); return acc; }, 0n); - const totalMarketSupplyB = b.reduce((acc, market) => { + const totalMarketSupplyB = b.reduce((acc, { token: market }) => { const totalSupplyUsd = convertToUsd(market?.totalSupply, market?.decimals, market?.prices.minPrice); acc = acc + (totalSupplyUsd ?? 0n); return acc; @@ -53,11 +65,14 @@ export function sortMarketsWithIndexToken( // Sort markets within each group by total supply const sortedMarkets = sortedGroups.map((markets) => { - return markets.sort((a, b) => { - const totalSupplyUsdA = convertToUsd(a.totalSupply, a.decimals, a.prices.minPrice)!; - const totalSupplyUsdB = convertToUsd(b.totalSupply, b.decimals, b.prices.minPrice)!; - return totalSupplyUsdA > totalSupplyUsdB ? -1 : 1; - }); + return markets + .sort(({ token: a }, { token: b }) => { + const totalSupplyUsdA = convertToUsd(a.totalSupply, a.decimals, a.prices.minPrice)!; + const totalSupplyUsdB = convertToUsd(b.totalSupply, b.decimals, b.prices.minPrice)!; + + return totalSupplyUsdA > totalSupplyUsdB ? -1 : 1; + }) + .map((e) => e.token); }); // Flatten the sorted markets array @@ -68,11 +83,12 @@ export function sortMarketsWithIndexToken( }; } -function useSortedPoolsWithIndexToken(marketsInfoData?: MarketsInfoData, marketTokensData?: TokensData) { +function useSortedPoolsWithIndexToken(marketsInfoData?: PoolsInfoData, marketTokensData?: TokensData) { const sortedMarketsWithIndexToken = useMemo( () => sortMarketsWithIndexToken(marketsInfoData, marketTokensData), [marketsInfoData, marketTokensData] ); + return sortedMarketsWithIndexToken; } diff --git a/src/domain/synthetics/trade/utils/deposit.ts b/src/domain/synthetics/trade/utils/deposit.ts index 7b5f74c207..9c048f091d 100644 --- a/src/domain/synthetics/trade/utils/deposit.ts +++ b/src/domain/synthetics/trade/utils/deposit.ts @@ -4,6 +4,7 @@ import { TokenData, convertToTokenAmount, convertToUsd, getMidPrice } from "doma import { bigMath } from "lib/bigmath"; import { applyFactor } from "lib/numbers"; import { DepositAmounts } from "../types"; +import { isGlv } from "../../markets/glv"; export function getDepositAmounts(p: { marketInfo: MarketInfo; diff --git a/src/lib/multicall/useMulticall.ts b/src/lib/multicall/useMulticall.ts index abc23a2cdc..0b3f3f6bc1 100644 --- a/src/lib/multicall/useMulticall.ts +++ b/src/lib/multicall/useMulticall.ts @@ -121,7 +121,6 @@ export function useMulticall, TResul const response = successDataByChainIdRef.current[chainId]; if (!response) { - console.log("----------->", responseOrFailure); throw new Error(`Multicall response is empty`); } diff --git a/src/lib/numbers.ts b/src/lib/numbers.ts index e6f858478c..9c69189bef 100644 --- a/src/lib/numbers.ts +++ b/src/lib/numbers.ts @@ -542,19 +542,24 @@ export function formatPercentageDisplay(percentage: number, hideThreshold?: numb return `${percentage}%`; } -export function formatAmountHuman(amount: BigNumberish | undefined, tokenDecimals: number, showDollar = false) { +export function formatAmountHuman( + amount: BigNumberish | undefined, + tokenDecimals: number, + showDollar = false, + displayDecimals = 1 +) { const n = Number(formatAmount(amount, tokenDecimals)); const isNegative = n < 0; const absN = Math.abs(n); const sign = showDollar ? "$" : ""; if (absN >= 1000000) { - return `${isNegative ? "-" : ""}${sign}${(absN / 1000000).toFixed(1)}M`; + return `${isNegative ? "-" : ""}${sign}${(absN / 1000000).toFixed(displayDecimals)}M`; } if (absN >= 1000) { - return `${isNegative ? "-" : ""}${sign}${(absN / 1000).toFixed(1)}K`; + return `${isNegative ? "-" : ""}${sign}${(absN / 1000).toFixed(displayDecimals)}K`; } - return `${isNegative ? "-" : ""}${sign}${absN.toFixed(1)}`; + return `${isNegative ? "-" : ""}${sign}${absN.toFixed(displayDecimals)}`; } diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index f5144c1a4e..96f79aba7a 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "Position Gebühr" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "Siehe Status." #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "Du kannst ETH von anderen Netzwerken zu Arbitrum transferieren, indem du eine der folgenden Optionen nutzt:" @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "{0} GLP sind für Vesting reserviert worden." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "Insgesamt migrierte Assets" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "Kollateral" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "Staken übermittelt! <0>Status anzeigen." msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "Gehe Long..." msgid "Total Rebates" msgstr "Rabatte insgesamt" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "Transfer übermittelt" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "Verzicht auf Gewinn nicht geprüft" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "Keine offene Position, der Auftrag kann nur ausgeführt werden, wenn ein msgid "Short Positions" msgstr "Short Positionen" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "Der Mark-Preis hat sich geändert. Erhöhe dein zulässiges Slippage, in #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "Konnte {0} {longOrShortText} nicht verringern, +{1} USD, Akzeptabler Pre msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "NETTO-RATE / 1 H" @@ -2689,6 +2728,10 @@ msgstr "Der esGMX (IOU) Token ist übertragbar. Du kannst den Token zu deiner Wa msgid "Self-transfer not supported" msgstr "Selbstübertragungen werden nicht unterstützt" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "Verringert {tokenSymbol} {longOrShortText}, -{0} USD." @@ -2742,6 +2785,10 @@ msgstr "Hebelwirkung" msgid "Enable orders sent." msgstr "Freigabe von Orders gesendet." +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "Anspruch gescheitert." msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "Markterhöhungsanfrage" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "Vesting mit GMX auf Arbitrum" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "Orders gekündigt." +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "Nach Inanspruchnahme werden die esGMX-Tokens innerhalb von 7 Tagen auf dein Konto im ausgewählten Netzwerk überwiesen." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "Finanzberichte und Protokollanalyse" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "Strategien für dezentralisierte Optionen" msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "Netzwerke" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "Orderupdate übermittelt!" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "Swap Order übermittelt!" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "Ausführungspreis für die Order." msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "Telegram Gruppe" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "Keine offenen Stellen" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "Min. erforderliches Kollateral" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "Die max. Hebelwirkung von 100x wurde überschritten, das verbleibende Kollateral wird nach Abzug von Verlusten und Gebühren wurde auf dein Konto zurücküberwiesen:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "Nicht genügend verfügbare Liquidität, um den Auftrag zu erfüllen." @@ -6197,6 +6292,7 @@ msgstr "Trigger-Preis" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "Verfügbarer Betrag zur Einzahlung in GLP." msgid "Download" msgstr "Download" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "Migrieren fehlgeschlagen" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "Swap fehlgeschlagen." -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "GMX Community-Diskussion" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "" @@ -6547,6 +6650,7 @@ msgstr "Long" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "Markt Swap fehlgeschlagen" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "Es sind nur Buchstaben, Zahlen und Unterstriche erlaubt." @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "Bonus Tokens" msgid "Transaction failed" msgstr "Transaktion fehlgeschlagen" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index 760b0744f7..5f60159cd1 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -74,6 +74,10 @@ msgstr "Decrease the withdraw size to match the max. <0>Read more.<1/><2/><3 msgid "Position Fee" msgstr "Position Fee" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "Rebalance Frequency" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "Subaccount generation failed" @@ -182,6 +186,10 @@ msgstr "V2 Arbitrum" msgid "GMX transfers not yet enabled" msgstr "GMX transfers not yet enabled" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "day" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "View status." #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "Buyable" @@ -427,6 +436,10 @@ msgstr "Realized PnL" msgid "Discord account: <0>@gmx_feedback" msgstr "Discord account: <0>@gmx_feedback" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "{hours} hours" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "You can transfer ETH from other networks to Arbitrum using any of the below options:" @@ -784,6 +797,10 @@ msgstr "Deposited" msgid "{0} GLP have been reserved for vesting." msgstr "{0} GLP have been reserved for vesting." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "Selling {symbol}..." + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "Total Assets Migrated" msgid "({0}% of {feesTypeName})" msgstr "({0}% of {feesTypeName})" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "Buy {operationTokenSymbol}" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "Avalanche Max. APY: {0}" msgid "Collateral" msgstr "Collateral" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "week" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "Base APY" @@ -976,7 +1001,7 @@ msgstr "Stake submitted! <0>View status." msgid "Short Liq." msgstr "Short Liq." -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." @@ -1110,7 +1135,7 @@ msgstr "Longing..." msgid "Total Rebates" msgstr "Total Rebates" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." @@ -1225,6 +1250,7 @@ msgstr "Transfer Submitted" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "Shift GM" @@ -1610,7 +1636,6 @@ msgstr "Accrued Negative Funding Fee" msgid "Forfeit profit not checked" msgstr "Forfeit profit not checked" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "Buy GM" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "GMX Alerts" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -1751,6 +1777,10 @@ msgstr "Affiliates" msgid "Max allowed actions" msgstr "Max allowed actions" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "Every" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." @@ -1764,6 +1794,10 @@ msgstr "No open position, order cannot be executed unless a position is opened" msgid "Short Positions" msgstr "Short Positions" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "Buying {symbol}..." + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" @@ -1802,7 +1836,7 @@ msgstr "We value your experience and insights and invite you to participate in a #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "The mark price has changed, consider increasing your Allowed Slippage by #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "Could not decrease {0} {longOrShortText}, +{1} USD, Acceptable Price: { msgid "Top-up" msgstr "Top-up" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "Vault" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "NET RATE / 1 H" @@ -2689,6 +2728,10 @@ msgstr "The esGMX (IOU) token is transferrable. You can add the token to your wa msgid "Self-transfer not supported" msgstr "Self-transfer not supported" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "{col2}" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." @@ -2742,6 +2785,10 @@ msgstr "Leverage" msgid "Enable orders sent." msgstr "Enable orders sent." +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "The subaccount has no funds." @@ -2844,6 +2891,10 @@ msgstr "Claim failed." msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "{col3}" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "The Max Network Fee is set to a higher value to handle potential increas msgid "Start Unrealized PnL" msgstr "Start Unrealized PnL" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "AMOUNT" @@ -3005,6 +3056,10 @@ msgstr "Request Market Increase" msgid "Edit {0}" msgstr "Edit {0}" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "hour" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "Vest with GMX on Arbitrum" @@ -3054,6 +3109,10 @@ msgstr "<0>Set Recommended Impact: {0}." msgid "Orders cancelled." msgstr "Orders cancelled." +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "Last Rebalance" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "V2 Claim" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "Subaccount activation failed" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "COMP." +#~ msgid "COMP." +#~ msgstr "COMP." #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "Updating order" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "Buy GLV" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "Financial reports and protocol analytics" @@ -3745,6 +3808,11 @@ msgstr "Accrued Borrow Fee" msgid "PnL Analysis" msgstr "PnL Analysis" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "COMP" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3882,6 +3950,10 @@ msgstr "Decentralized Options Strategies" msgid "Address copied to your clipboard" msgstr "Address copied to your clipboard" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "{days} days" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3906,6 +3978,10 @@ msgstr "Close submitted!" msgid "Insufficient {0} liquidity" msgstr "Insufficient {0} liquidity" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "{seconds} seconds" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4089,6 +4165,7 @@ msgstr "Networks" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "{0}: {1}, Price: {priceDisplay}" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4365,6 +4442,10 @@ msgstr "Order updated!" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "{weeks} weeks" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "The previously authorized maximum number of actions has been reached for One-Click Trading." @@ -4461,6 +4542,7 @@ msgstr "Swap Order submitted!" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4529,6 +4611,10 @@ msgstr "Execution price for the order." msgid "wstETH APR" msgstr "wstETH APR" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "second" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "Telegram Group" @@ -4784,6 +4870,10 @@ msgstr "LONG LIQ." msgid "No open positions" msgstr "No open positions" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "Sell GLV" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "STIP.b Retroactive Bonus" @@ -4836,6 +4926,7 @@ msgstr "There is no liquidation price, as the position's collateral value will i msgid "Min. required Collateral" msgstr "Min. required Collateral" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "Search Pool" @@ -5626,6 +5717,10 @@ msgstr "Unknown shift GM order" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "Shifting {symbol}..." + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "Not enough Available Liquidity to fill the Order." @@ -6203,6 +6298,7 @@ msgstr "Trigger Price" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "Sellable" @@ -6246,6 +6342,10 @@ msgstr "Available amount to deposit into GLP." msgid "Download" msgstr "Download" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "{col1}" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "Migration failed" @@ -6312,7 +6412,7 @@ msgstr "Realized Base PnL" msgid "Swap failed." msgstr "Swap failed." -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." @@ -6338,6 +6438,10 @@ msgstr "Telegram account" msgid "SOON" msgstr "SOON" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "Sell {operationTokenSymbol}" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "Liquidation price would cross mark price." @@ -6479,7 +6583,6 @@ msgstr "Confirm Claim" msgid "GMX community discussion" msgstr "GMX community discussion" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "Sell GM" @@ -6553,6 +6656,7 @@ msgstr "Long" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6733,6 +6837,10 @@ msgstr "Traders" msgid "{ordersText} cancelled" msgstr "{ordersText} cancelled" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "{minutes} minutes" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "Limit price below Mark Price" @@ -6864,6 +6972,10 @@ msgstr "Fees exceed Pay amount" msgid "Failed Market Swap" msgstr "Failed Market Swap" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "minute" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "Only letters, numbers and underscores are allowed." @@ -6877,6 +6989,7 @@ msgid "Referral code submitted!" msgstr "Referral code submitted!" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7181,7 +7294,7 @@ msgstr "Bonus Tokens" msgid "Transaction failed" msgstr "Transaction failed" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "COLLATERAL" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index b8eb654131..beffb70471 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "Comisión de Posición" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "Ver estado." #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "Puedes transferir ETH desde otras redes a Arbitrum usando cualquiera de las siguientes opciones:" @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "{0} GLP se han reservado para adquisiciones." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "Activos Totales Migrados" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "Garantía" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "Stakeo enviado! <0>Ver estado." msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "Entrando a largo..." msgid "Total Rebates" msgstr "Total de Reembolsos" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "Transferencia Enviada" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "Renuncia de ganancias no marcada" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "No hay posiciones abiertas, la orden no se puede ejecutar sino se abre u msgid "Short Positions" msgstr "Posiciones en Corto" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "El precio de referencia ha cambiado, considera incrementar el deslizamie #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "" msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "NETO TASA / 1 H" @@ -2689,6 +2728,10 @@ msgstr "El token esGMX (IOU) es transferible. Puedes agregar el token a tu carte msgid "Self-transfer not supported" msgstr "No se admite la autotransferencia" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "Reducido {tokenSymbol} {longOrShortText}, -{0} USD." @@ -2742,6 +2785,10 @@ msgstr "Apalancamiento" msgid "Enable orders sent." msgstr "Activación de órdenes enviado." +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "Reclamación fallida." msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "Solicitar incremento del mercado" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "Adquiera con GMX en Arbitrum" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "Órdenes canceladas." +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "Tras reclamar, los tokens esGMX serán enviados a su cuenta en la red seleccionada dentro de 7 días." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "Reportes financieros y análisis de datos del protocolo" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "Estrategias de Opciones Descentralizadas" msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "Redes" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "¡Orden actualizada!" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "¡Orden de Intercambio enviada!" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "Precio de ejecución para la orden." msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "Grupo de Telegram" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "No hay posiciones abiertas" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "Garantía mínima requerida" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "El apalancamiento máximo de 100x ha sido superado, la garantía restante después de restar las pérdidas y comisiones ha sido enviada de vuelta a tu cuenta:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "No hay suficiente liquidez disponible para llenar la orden." @@ -6197,6 +6292,7 @@ msgstr "Precio de Activación" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "Cantidad disponible para depositar en GLP." msgid "Download" msgstr "Descargar" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "Migración fallida" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "Falló el Intercambio." -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "Debate comunitario de GMX" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "" @@ -6547,6 +6650,7 @@ msgstr "Largo" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "Intercambio de Mercado Fallido" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "Solo letras, números y guiones bajos están permitidos" @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "Tokens adicionales" msgid "Transaction failed" msgstr "Transacción fallida" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 456f6fcd49..8c5470e112 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "Frais de position" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "Voir le statut" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "Vous pouvez transférer ETH provenant d'autres réseaux vers Arbitrum en utilisant l'une des options ci-dessous:" @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "{0} GLP ont été réservés pour le vesting." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "Actifs totaux migrés" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "Collatéral" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "Staking soumis ! <0>Voir le statut." msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "Long en cours..." msgid "Total Rebates" msgstr "Remise totale" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "Transfert soumis" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "Renoncer aux profits non vérifiés" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "Pas de position ouverte, l'ordre ne peut être exécuté que si une posi msgid "Short Positions" msgstr "Positions Shorts" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "Le prix du marché a changé, envisagez d'augmenter votre marge autoris #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "" msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "TAUX NET / 1 H" @@ -2689,6 +2728,10 @@ msgstr "Le jeton esGMX (IOU - reconnaissance de dette) est transférable. Vous msgid "Self-transfer not supported" msgstr "Auto-transfert non supporté" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "{tokenSymbol} {longOrShortText} diminué, -{0} USD." @@ -2742,6 +2785,10 @@ msgstr "Levier" msgid "Enable orders sent." msgstr "Activation des ordres envoyée." +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "Réclamation échouée." msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "Demander une augmentation du marché" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "Vester avec GMX sur Arbitrum" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "Ordres annulés." +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "Après la réclamation, les tokens esGMX seront déposés sur votre compte sur le réseau sélectionné dans les 7 jours." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "Rapports financiers et analyses de protocoles" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "Stratégies d'options décentralisées" msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "Réseaux" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "Ordre actualisé !" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "Ordre d'échange soumis !" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "Prix d'exécution pour l'ordre." msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "Groupe Telegram" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "Pas de position ouverte" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "Collatéral min. requis" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "Le levier maximum de 100x a été dépassé, le collatéral restant, après déduction des pertes et des frais, a été renvoyé sur votre compte:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "Pas assez de liquidité disponible pour remplir l'ordre." @@ -6197,6 +6292,7 @@ msgstr "Prix de déclenchement" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "Somme disponible à déposer dans GLP." msgid "Download" msgstr "Télécharger" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "Migration échouée" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "échange échoué." -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "Discussion de la communauté GMX" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "" @@ -6547,6 +6650,7 @@ msgstr "Long" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "Échange de marché échoué" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "Les lettres, les chiffres et les caractères de soulignement sont autorisés." @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "Tokens Bonus" msgid "Transaction failed" msgstr "Transaction échouée" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 2ac8a17db8..d4e34f2c50 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "ポジション手数料" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "状況を見る" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "以下の選択肢のいずれかを使い、ETHを他のネットワークからArbitrumへ送ることができます。" @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "{0} GLPがべスティングのためにリザーブされました。" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "移行された全アセット" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "担保" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "ステーク申し込み完了! <0>状況を確認する" msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "ロング中..." msgid "Total Rebates" msgstr "リベート総額" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "移転申し込み完了" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "利益喪失がチェックされていません" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "オープンのポジションはありません。オープンのポジ msgid "Short Positions" msgstr "ショートポジション" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "マーク価格が変化したため、アドレスの横に表示され #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "{0} {longOrShortText}を減らせませんでした +{1} USD, 受け入 msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "1時間あたりのネットレート" @@ -2689,6 +2728,10 @@ msgstr "esGMX (IOU)は移転可能です。自分のウォレットに加えて msgid "Self-transfer not supported" msgstr "自分への移転はサポートされていません" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "{tokenSymbol} {longOrShortText}の減額 -{0} USD" @@ -2742,6 +2785,10 @@ msgstr "レバレッジ" msgid "Enable orders sent." msgstr "注文有効化申し込み完了。" +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "請求できませんでした。" msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "市場増加リクエスト" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "ArbitrumでGMXを使ってべスティングする" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "注文がキャンセルされました。" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "請求後7日以内に指定のネットワーク上のあなたのアカウントにesGMXトークンがエアドロップされます" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "財務情報とプロトコル分析" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "分散型オプションストラテジー" msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "ネットワーク" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "注文更新完了!" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "スワップ注文提出済!" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "注文の執行価格" msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "Telegramグループ" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "オープンのポジションはありません" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "最低必要担保" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "最大レバレッジ100倍を超過し、損失と手数料を差し引き後に残った担保はアカウントに返送されました:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "注文を執行するための利用可能な流動性が不足しています。" @@ -6197,6 +6292,7 @@ msgstr "トリガー価格" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "GLPに入金可能な金額" msgid "Download" msgstr "ダウンロード" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "移行できませんでした" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "スワップできませんでした。" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "GMXのコミュニティ対話" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "" @@ -6547,6 +6650,7 @@ msgstr "ロング" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "マーケットスワップ失敗" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "英数字とアンダースコア記号のみ使用できます。" @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "ボーナストークン" msgid "Transaction failed" msgstr "取引に失敗しました" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index fc13578cac..9b662c80ef 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "포지션 수수료" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "상태 보기." #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "아래의 옵션중 하나를 사용해, ETH를 Arbitrum에 보낼 수 있습니다." @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "{0} GLP가 베스팅을 위해 리저브되었습니다." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "총 이전된 자산" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "담보" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "스테이킹 제출완료! <0>상태 보기." msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "롱 실행중..." msgid "Total Rebates" msgstr "총 소개 보수" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "전송 제출 완료" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "상실 이익이 확인되지 않았습니다." -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "열려있는 포지션이 없습니다. 열려있는 포지션이 없는 msgid "Short Positions" msgstr "숏 포지션" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "시장 평균가가 변화되었습니다. 귀하의 주소 옆에 \"... #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "{0} {longOrShortText}을 감소시키지 못했습니다, +{1} USD, 허 msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "1시간 당 순 수수료율" @@ -2689,6 +2728,10 @@ msgstr "\"esGMX (IOU) 토큰의 주소는 {esGmxIouAddress} 입니다." msgid "Self-transfer not supported" msgstr "자신에게 전송하는 것은 지원되지 않습니다" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "{tokenSymbol} {longOrShortText} 감소, -{0} USD." @@ -2742,6 +2785,10 @@ msgstr "레버리지" msgid "Enable orders sent." msgstr "주문 유효화 제출 완료" +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "수령 실패" msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "마켓 증가 요청" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "Arbitrum에서 GMX로 베스팅하기" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "주문 취소" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "수령 후, esGMX 토큰은 7일 이내에 선택한 네트워크의 계정으로 에어드랍됩니다." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "금융 보고서 및 프로토콜 분석" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "탈중앙화 옵션 전략" msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "네트워크" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "주문 업데이트됨!" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "스왑 주문 제출 완료!" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "주문의 실행 가격입니다." msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "텔레그램 그룹" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "열려있는 포지션이 없습니다" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "최소 필요 담보" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "최대 레버리지 100x를 초과하였습니다. 손실과 수수료를 제외한 나머지 담보 자산은 귀하의 계정으로 반환되었습니다:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "주문을 채울만한 충분한 유동성이 없습니다." @@ -6197,6 +6292,7 @@ msgstr "트리거 가격" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "GLP에 예치할 수 있는 양" msgid "Download" msgstr "다운로드" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "이전 실패" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "스왑 실패." -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "GMX 커뮤니티 토론" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "" @@ -6547,6 +6650,7 @@ msgstr "롱" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "시장 스왑 실패" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "문자, 숫자 및 언더스코어만 가능합니다" @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "보너스 토큰" msgid "Transaction failed" msgstr "트랜잭션 실패" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index 3b4e5b8ca9..1b6bd9f247 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "" @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "" msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "" msgid "Total Rebates" msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "" msgid "Short Positions" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "" #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "" @@ -2221,6 +2256,10 @@ msgstr "" msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "" @@ -2689,6 +2728,10 @@ msgstr "" msgid "Self-transfer not supported" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "" @@ -2742,6 +2785,10 @@ msgstr "" msgid "Enable orders sent." msgstr "" +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "" msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "" msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "" msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "" @@ -6197,6 +6292,7 @@ msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "" msgid "Download" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "" @@ -6547,6 +6650,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "" @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "" msgid "Transaction failed" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 240e96af87..ebba857db2 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "Комиссия за позицию" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "Посмотреть статус" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "Вы можете перевести ETH в Arbitrum, используя любой из приведенных ниже вариантов." @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "{0} GLP были зарезервированы для вестинга." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "Общая сумма Перенесенных Активов" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "Залог" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "Стакинг принята! <0>Смотреть статус." msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "Лонгин..." msgid "Total Rebates" msgstr "Всего Ребайтов" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "Перевод Подтверждён" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "Неустойка за непроверенную прибыль" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "Купить GM" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "Нет открытой позиции, ордер не может бы msgid "Short Positions" msgstr "Позиция Шорта" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "Цена отметки изменилась, подумайте об у #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "Не удалось уменьшить {0} {longOrShortText}, +{1} USD, msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "ЧИСТАЯ СТАВКА / 1 Ч" @@ -2689,6 +2728,10 @@ msgstr "Токен esGMX является переводимым. При жел msgid "Self-transfer not supported" msgstr "Самостоятельный перевод не поддерживается" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "Уменьшено {tokenSymbol} {longOrShortText}, -{0} USD." @@ -2742,6 +2785,10 @@ msgstr "Плечо" msgid "Enable orders sent." msgstr "Активировать отправку ордера." +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "Запрос не прошел." msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "Запрос на рыночное увеличение" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "Вестинг GMX на Arbitrum" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "Ордера отменены" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "После подачи заявки токены esGMX будут перечислены на ваш счет в выбранной сети в течение 7 дней." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "Финансовые отчеты и аналитика протоколов" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "Децентрализованные Опционные Стратеги msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "Сети" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "Ордер обновлён!" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "Обменный Ордер подан!" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "Цена исполнения ордера." msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "Группа в Телеграмме" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "Нет открытых позиций" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "Минимально требуемый залог" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "Максимальное кредитное плечо 100x было превышено, оставшийся залог после вычета убытков и комиссий был отправлен обратно на ваш счет:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "Недостаточно доступной ликвидности для выполнения ордера." @@ -6197,6 +6292,7 @@ msgstr "Цена триггера" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "Доступная сумма для пополнения GLP." msgid "Download" msgstr "Загрузить" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "Перенос не удался" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "Обмен не выполнен" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "Обсуждения в сообществе GMX" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "Продать GM" @@ -6547,6 +6650,7 @@ msgstr "Лонг" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "Рыночный обмен не удался" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "Допускаются только буквы, цифры и знаки подчеркивания." @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "Бонусные токены" msgid "Transaction failed" msgstr "Транзакция не прошла" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 8d675fd4ab..c4bab4c5ea 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -74,6 +74,10 @@ msgstr "" msgid "Position Fee" msgstr "仓位费用" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Rebalance Frequency" +msgstr "" + #: src/components/Synthetics/StatusNotification/SubaccountNotification.tsx msgid "Subaccount generation failed" msgstr "" @@ -182,6 +186,10 @@ msgstr "" msgid "GMX transfers not yet enabled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "day" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts #: src/pages/LeaderboardPage/components/LeaderboardNavigation.tsx msgid "EIP-4844, 13-20 Mar" @@ -251,6 +259,7 @@ msgstr "查看状况" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Buyable" msgstr "" @@ -427,6 +436,10 @@ msgstr "" msgid "Discord account: <0>@gmx_feedback" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{hours} hours" +msgstr "" + #: src/pages/BuyGMX/BuyGMX.tsx msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" msgstr "您可以使用以下任何一种方式将ETH从其他网络转移到Arbitrum:" @@ -784,6 +797,10 @@ msgstr "" msgid "{0} GLP have been reserved for vesting." msgstr "{0}GLP已被保留用于授权" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Selling {symbol}..." +msgstr "" + #: src/components/Glp/GlpSwap.js #: src/components/Glp/GlpSwap.js msgid "Buy with {0}" @@ -821,6 +838,10 @@ msgstr "迁移的资产总额" msgid "({0}% of {feesTypeName})" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buy {operationTokenSymbol}" +msgstr "" + #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx #: src/pages/Dashboard/DashboardV2.tsx @@ -950,6 +971,10 @@ msgstr "" msgid "Collateral" msgstr "抵押品" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "week" +msgstr "" + #: src/components/AprInfo/AprInfo.tsx msgid "Base APY" msgstr "" @@ -976,7 +1001,7 @@ msgstr "质押送出! <0>查看状况" msgid "Short Liq." msgstr "" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {composition} as per the composition displayed." msgstr "" @@ -1110,7 +1135,7 @@ msgstr "做多中" msgid "Total Rebates" msgstr "返利总额" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" @@ -1225,6 +1250,7 @@ msgstr "送出转移" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Shift GM" msgstr "" @@ -1610,7 +1636,6 @@ msgstr "" msgid "Forfeit profit not checked" msgstr "未检查没收利润" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Buy GM" msgstr "" @@ -1628,6 +1653,7 @@ msgid "GMX Alerts" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -1751,6 +1777,10 @@ msgstr "" msgid "Max allowed actions" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Every" +msgstr "" + #: src/pages/Stake/StakeV2.tsx msgid "Convert esGMX tokens to GMX tokens.<0/>Please read the <1>vesting details before using the vaults." msgstr "" @@ -1764,6 +1794,10 @@ msgstr "没有未结头寸,除非有头寸,否则订单不能被执行" msgid "Short Positions" msgstr "做空仓位" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Buying {symbol}..." +msgstr "" + #: src/components/Exchange/TradeHistory.js msgid "Could not increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2}  USD" msgstr "" @@ -1802,7 +1836,7 @@ msgstr "" #: src/components/Migration/Migration.js #: src/components/Referrals/AddAffiliateCode.js #: src/components/Referrals/JoinReferralCode.js -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/domain/synthetics/trade/utils/validation.ts @@ -2134,6 +2168,7 @@ msgstr "标价已改变, 请考虑点击你地址旁的 \"...\" 图示来增加 #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "TVL" msgstr "TVL" @@ -2221,6 +2256,10 @@ msgstr "无法降低 {0} {longOrShortText}, +{1} USD, 能接受的价钱: {2}" msgid "Top-up" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Vault" +msgstr "" + #: src/components/Synthetics/MarketsList/MarketsList.tsx msgid "NET RATE / 1 H" msgstr "净率/1小时" @@ -2689,6 +2728,10 @@ msgstr "esGMX(IOU)代币是可以转让的,如果你愿意,你可以把 msgid "Self-transfer not supported" msgstr "不支持自行转让" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col2}" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Decreased {tokenSymbol} {longOrShortText}, -{0} USD." msgstr "已减少{tokenSymbol} {longOrShortText}, -{0} USD" @@ -2742,6 +2785,10 @@ msgstr "杠杆" msgid "Enable orders sent." msgstr "启用指令发送" +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx +msgid "This token is a vault of automatically rebalanced GM tokens that accrue fees from leverage trading and swaps from the included markets." +msgstr "" + #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "The subaccount has no funds." msgstr "" @@ -2844,6 +2891,10 @@ msgstr "领取失败" msgid "Accrued Price Impact Rebates. They will become Claimable after some time.<0/><1/><2>Read more." msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col3}" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Positions{0}" @@ -2965,7 +3016,7 @@ msgstr "" msgid "Start Unrealized PnL" msgstr "" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "AMOUNT" msgstr "" @@ -3005,6 +3056,10 @@ msgstr "要求市场增加" msgid "Edit {0}" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "hour" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.js msgid "Vest with GMX on Arbitrum" msgstr "在Arbitrum上授权GMX" @@ -3054,6 +3109,10 @@ msgstr "" msgid "Orders cancelled." msgstr "订单取消" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "Last Rebalance" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "V2 Claim" msgstr "" @@ -3112,8 +3171,8 @@ msgid "Subaccount activation failed" msgstr "" #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx -msgid "COMP." -msgstr "" +#~ msgid "COMP." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "You have no GMX tokens to claim." @@ -3417,6 +3476,10 @@ msgstr "" msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." msgstr "申领后,esGMX代币将在7天内空投到您所选网络的账户中" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Buy GLV" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Financial reports and protocol analytics" msgstr "财务报告和协议分析" @@ -3742,6 +3805,11 @@ msgstr "" msgid "PnL Analysis" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "COMP" +msgstr "" + #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Longs" @@ -3879,6 +3947,10 @@ msgstr "去中心化选策略" msgid "Address copied to your clipboard" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{days} days" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx @@ -3903,6 +3975,10 @@ msgstr "" msgid "Insufficient {0} liquidity" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{seconds} seconds" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js #: src/pages/Ecosystem/Ecosystem.js msgid "Creator" @@ -4086,6 +4162,7 @@ msgstr "网络" msgid "{0}: {1}, Price: {priceDisplay}" msgstr "" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx #: src/pages/Dashboard/DashboardV2.tsx msgid "POOL" @@ -4362,6 +4439,10 @@ msgstr "指令已更新" msgid "You will be short {indexSymbol} from your short position, while being long {collateralSymbol} from your {collateralSymbol} collateral. The liquidation price will vary based on the price of {collateralSymbol}." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{weeks} weeks" +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBoxRows/OneClickTrading.tsx msgid "The previously authorized maximum number of actions has been reached for One-Click Trading." msgstr "" @@ -4458,6 +4539,7 @@ msgstr "交易订单送出" #: src/components/Exchange/PositionsList.js #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderList/OrderList.tsx @@ -4526,6 +4608,10 @@ msgstr "指令的执行价格" msgid "wstETH APR" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "second" +msgstr "" + #: src/pages/Ecosystem/Ecosystem.js msgid "Telegram Group" msgstr "电报群" @@ -4781,6 +4867,10 @@ msgstr "" msgid "No open positions" msgstr "没有未结头寸" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +msgid "Sell GLV" +msgstr "" + #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Retroactive Bonus" msgstr "" @@ -4833,6 +4923,7 @@ msgstr "" msgid "Min. required Collateral" msgstr "最低要求抵押品" +#: src/components/MarketSelector/GmSelectorForGlv.tsx #: src/components/MarketSelector/PoolSelector.tsx msgid "Search Pool" msgstr "" @@ -5623,6 +5714,10 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "超过100倍的最大杠杆率,扣除损失和费用后的剩余抵押物已发回你的账户:" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Shifting {symbol}..." +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough Available Liquidity to fill the Order." msgstr "没有足够的可用流动性来填补订单。" @@ -6197,6 +6292,7 @@ msgstr "触发价格" #: src/components/Synthetics/MarketStats/MarketStats.tsx #: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx msgid "Sellable" msgstr "" @@ -6240,6 +6336,10 @@ msgstr "可供存入GLP的金额" msgid "Download" msgstr "下载" +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx +msgid "{col1}" +msgstr "" + #: src/components/Migration/Migration.js msgid "Migration failed" msgstr "转移失败" @@ -6306,7 +6406,7 @@ msgstr "" msgid "Swap failed." msgstr "交易失败" -#: src/components/Synthetics/MarketStats/MarketDescription.tsx +#: src/components/Synthetics/MarketStats/components/MarketDescription.tsx msgid "This token automatically accrues fees from swaps for the {0}/{1} market. It is also exposed to {2} and {3} as per the composition displayed." msgstr "" @@ -6332,6 +6432,10 @@ msgstr "" msgid "SOON" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +msgid "Sell {operationTokenSymbol}" +msgstr "" + #: src/components/Exchange/PositionEditor.js msgid "Liquidation price would cross mark price." msgstr "" @@ -6473,7 +6577,6 @@ msgstr "" msgid "GMX community discussion" msgstr "GMX社区讨论" -#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx msgid "Sell GM" msgstr "" @@ -6547,6 +6650,7 @@ msgstr "做多" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx #: src/components/Synthetics/MarketsList/NetFeeTooltip.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/TradeBox/MarketPoolSelectorRow.tsx @@ -6727,6 +6831,10 @@ msgstr "" msgid "{ordersText} cancelled" msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "{minutes} minutes" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Limit price below Mark Price" msgstr "" @@ -6858,6 +6966,10 @@ msgstr "" msgid "Failed Market Swap" msgstr "市场交换失败" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "minute" +msgstr "" + #: src/components/Referrals/referralsHelper.js msgid "Only letters, numbers and underscores are allowed." msgstr "只允许使用字母、数字和下底线" @@ -6871,6 +6983,7 @@ msgid "Referral code submitted!" msgstr "" #: src/components/Synthetics/MarketStats/MarketStats.tsx +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx #: src/components/Synthetics/PoolsList/PoolsList.tsx msgid "APY" @@ -7175,7 +7288,7 @@ msgstr "奖励代币" msgid "Transaction failed" msgstr "交易失败" -#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +#: src/components/Synthetics/MarketStats/components/CompositionTable.tsx msgid "COLLATERAL" msgstr "" diff --git a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx index 9ac687a8c6..d8d57cf176 100644 --- a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx +++ b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx @@ -1,9 +1,12 @@ import { Trans } from "@lingui/macro"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import { Mode, Operation } from "components/Synthetics/GmSwap/GmSwapBox/types"; -import { getSyntheticsDepositMarketKey } from "config/localStorage"; -import { selectDepositMarketTokensData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { getSyntheticsDepositGlvMarketKey, getSyntheticsDepositMarketKey } from "config/localStorage"; +import { + selectDepositMarketTokensData, + selectPoolsData, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { MarketsInfoData, useMarketsInfoRequest, useMarketTokensData } from "domain/synthetics/markets"; import { useGmMarketsApy } from "domain/synthetics/markets/useGmMarketsApy"; @@ -23,12 +26,13 @@ import { GmSwapBox } from "components/Synthetics/GmSwap/GmSwapBox/GmSwapBox"; import { MarketStatsWithComposition } from "components/Synthetics/MarketStats/MarketStatsWithComposition"; import "./MarketPoolsPage.scss"; +import { isGlv } from "domain/synthetics/markets/glv"; export function MarketPoolsPage() { const { chainId } = useChainId(); const gmSwapBoxRef = useRef(null); - const { marketsInfoData = EMPTY_OBJECT as MarketsInfoData } = useMarketsInfoRequest(chainId); + const marketsInfoData = useSelector(selectPoolsData); const depositMarketTokensData = useSelector(selectDepositMarketTokensData); const { marketTokensData: withdrawalMarketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); @@ -39,24 +43,29 @@ export function MarketPoolsPage() { const [operation, setOperation] = useState(Operation.Deposit); let [mode, setMode] = useState(Mode.Single); - const [selectedMarketKey, setSelectedMarketKey] = useLocalStorageSerializeKey( + const [selectedMarketGmKey, setSelectedMarketGmKey] = useLocalStorageSerializeKey( getSyntheticsDepositMarketKey(chainId), undefined ); + const [selectedGlvGmMarketKey, setSelectedGlvGmMarketKey] = useLocalStorageSerializeKey( + getSyntheticsDepositGlvMarketKey(chainId), + undefined + ); + useEffect(() => { - const newAvailableModes = getGmSwapBoxAvailableModes(operation, getByKey(marketsInfoData, selectedMarketKey)); + const newAvailableModes = getGmSwapBoxAvailableModes(operation, getByKey(marketsInfoData, selectedMarketGmKey)); if (!newAvailableModes.includes(mode)) { setMode(newAvailableModes[0]); } - }, [marketsInfoData, mode, operation, selectedMarketKey]); + }, [marketsInfoData, mode, operation, selectedMarketGmKey]); - const marketInfo = getByKey(marketsInfoData, selectedMarketKey); + const marketInfo = getByKey(marketsInfoData, selectedMarketGmKey); const marketToken = getTokenData( operation === Operation.Deposit ? depositMarketTokensData : withdrawalMarketTokensData, - selectedMarketKey + selectedMarketGmKey ); return ( @@ -82,17 +91,20 @@ export function MarketPoolsPage() {
Date: Tue, 27 Aug 2024 22:59:19 +0400 Subject: [PATCH 04/49] adding deposit glv --- .../MarketSelector/GmSelectorForGlv.tsx | 4 +- .../Synthetics/BridgingInfo/BridgingInfo.tsx | 33 -- .../GmAssetDropdown/GmAssetDropdown.tsx | 10 +- src/components/Synthetics/GmList/GmList.tsx | 16 +- .../Synthetics/GmList/MintableAmount.tsx | 4 +- .../Synthetics/GmList/sortGmTokensByField.tsx | 31 +- .../Synthetics/GmList/sortGmTokensDefault.tsx | 7 +- .../GmDepositWithdrawalBox.tsx | 40 +- .../GmDepositWithdrawalBox/InfoRows.tsx | 4 +- .../GmDepositWithdrawalBox/useFees.tsx | 58 ++- .../useSubmitButtonState.tsx | 31 +- .../Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx | 4 +- .../GmSwap/GmSwapBox/showMarketToast.tsx | 10 +- .../GmSwapBox/useUpdateByQueryParams.tsx | 11 +- .../Synthetics/MarketStats/MarketStats.tsx | 397 ------------------ .../MarketStatsWithComposition.tsx | 10 +- .../MarketStats/components/CompositionBar.tsx | 22 +- .../components/CompositionTable.tsx | 10 +- .../MarketTokenSelector.tsx | 25 +- .../GmStatusNotification.tsx | 22 +- src/components/TokenIcon/TokenIcon.tsx | 10 +- .../TokenSelector/TokenSelector.tsx | 13 +- src/config/contracts.ts | 11 +- src/config/dataStore.ts | 3 + src/config/markets.ts | 12 +- src/config/tokens.ts | 2 + .../SyntheticsEventsProvider.tsx | 17 +- .../SyntheticsStateContextProvider.tsx | 10 +- .../selectors/globalSelectors.ts | 6 +- src/domain/synthetics/fees/types.ts | 3 + src/domain/synthetics/fees/useGasLimits.ts | 21 + .../fees/utils/estimateOraclePriceCount.ts | 8 + .../synthetics/fees/utils/executionFee.ts | 46 ++ .../synthetics/markets/createDepositTxn.ts | 238 ++++++----- src/domain/synthetics/markets/glv.spec.ts | 41 -- src/domain/synthetics/markets/glv.ts | 11 +- src/domain/synthetics/markets/types.ts | 6 +- .../synthetics/markets/useGmMarketsApy.ts | 20 +- .../synthetics/markets/useMarketTokensData.ts | 4 +- src/domain/synthetics/markets/utils.ts | 6 +- .../synthetics/orders/simulateExecuteTxn.tsx | 47 ++- .../{useGlvPools.ts => useGlvMarkets.ts} | 14 +- .../trade/useSortedPoolsWithIndexToken.ts | 6 +- src/domain/synthetics/trade/utils/deposit.ts | 1 - src/img/ic_gm_24.svg | 15 + src/locales/de/messages.po | 10 +- src/locales/en/messages.po | 10 +- src/locales/es/messages.po | 10 +- src/locales/fr/messages.po | 10 +- src/locales/ja/messages.po | 10 +- src/locales/ko/messages.po | 10 +- src/locales/pseudo/messages.po | 10 +- src/locales/ru/messages.po | 10 +- src/locales/zh/messages.po | 10 +- 54 files changed, 635 insertions(+), 775 deletions(-) delete mode 100644 src/components/Synthetics/MarketStats/MarketStats.tsx rename src/domain/synthetics/tokens/{useGlvPools.ts => useGlvMarkets.ts} (96%) create mode 100644 src/img/ic_gm_24.svg diff --git a/src/components/MarketSelector/GmSelectorForGlv.tsx b/src/components/MarketSelector/GmSelectorForGlv.tsx index caf92ca6e6..8b9ab68f59 100644 --- a/src/components/MarketSelector/GmSelectorForGlv.tsx +++ b/src/components/MarketSelector/GmSelectorForGlv.tsx @@ -19,7 +19,7 @@ import TokenIcon from "components/TokenIcon/TokenIcon"; import Modal from "../Modal/Modal"; import { useGlvGmMarketsWithComposition } from "components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import "./MarketSelector.scss"; import { CommonPoolSelectorProps, MarketOption } from "./types"; @@ -27,7 +27,7 @@ import { PoolListItem } from "./PoolListItem"; type Props = Omit & { isDeposit: boolean; - glvMarketInfo?: GlvPoolInfo; + glvMarketInfo?: GlvMarketInfo; onSelectGmMarket?: (market: MarketInfo) => void; }; diff --git a/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx b/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx index ea1a7bbcce..0966427e78 100644 --- a/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx +++ b/src/components/Synthetics/BridgingInfo/BridgingInfo.tsx @@ -1,6 +1,5 @@ import { Trans } from "@lingui/macro"; import ExternalLink from "components/ExternalLink/ExternalLink"; -import Tooltip from "components/Tooltip/Tooltip"; import { getBridgingOptionsForToken } from "config/bridging"; import { getChainName } from "config/chains"; @@ -9,38 +8,6 @@ type Props = { tokenSymbol?: string; }; -export default function BridgingInfoG(props: Props) { - const { chainId, tokenSymbol } = props; - const chainName = getChainName(chainId); - const bridgingOptions = getBridgingOptionsForToken(tokenSymbol); - - if (!tokenSymbol || !bridgingOptions) return null; - - return ( - ( - <> - - Bridge {tokenSymbol} to {chainName} using any of the options below: - -
-
- {bridgingOptions.map((option, i) => { - const bridgeLink = option.generateLink(chainId); - return ( - - {option?.name} - - ); - })} - - )} - /> - ); -} - export function BridgingInfo(props: Props) { const { chainId, tokenSymbol } = props; const chainName = getChainName(chainId); diff --git a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx index 765544ad98..70f1bed1ea 100644 --- a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx +++ b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx @@ -7,10 +7,10 @@ import { createBreakpoint } from "react-use"; import { getExplorerUrl } from "config/chains"; import { getIcon } from "config/icons"; -import { MarketInfo, PoolsInfoData, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; +import { MarketInfo, AllMarketsInfoData, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; import { TokenData, TokensData, getTokenData } from "domain/synthetics/tokens"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { useChainId } from "lib/chains"; import { getByKey } from "lib/objects"; import useWallet, { WalletClient } from "lib/wallets/useWallet"; @@ -23,12 +23,12 @@ import "./GmAssetDropdown.scss"; type Props = { token?: TokenData; - marketsInfoData?: PoolsInfoData; + marketsInfoData?: AllMarketsInfoData; position?: Placement; tokensData?: TokensData; }; -function renderMarketName(market?: MarketInfo | GlvPoolInfo) { +function renderMarketName(market?: MarketInfo | GlvMarketInfo) { if (!market) { return null; } @@ -81,7 +81,7 @@ export default function GmAssetDropdown({ token, marketsInfoData, tokensData, po as="div" ref={refs.setFloating} style={floatingStyles} - className="z-10 rounded-4 border border-gray-800 bg-slate-800 outline-none" + className="border z-10 rounded-4 border-gray-800 bg-slate-800 outline-none" > {market && ( diff --git a/src/components/Synthetics/GmList/GmList.tsx b/src/components/Synthetics/GmList/GmList.tsx index 44e475a5b6..1ff7767606 100644 --- a/src/components/Synthetics/GmList/GmList.tsx +++ b/src/components/Synthetics/GmList/GmList.tsx @@ -18,7 +18,7 @@ import { selectShiftAvailableMarkets } from "context/SyntheticsStateContext/sele import { useSelector } from "context/SyntheticsStateContext/utils"; import { MarketTokensAPRData, - PoolsInfoData, + AllMarketsInfoData, getMarketIndexName, getMarketPoolName, getMintableMarketTokens, @@ -196,7 +196,7 @@ export function GmList({ {currentData.length > 0 && currentData.map((token) => ( - diff --git a/src/components/Synthetics/GmList/MintableAmount.tsx b/src/components/Synthetics/GmList/MintableAmount.tsx index 7e452e429b..f100a5bd83 100644 --- a/src/components/Synthetics/GmList/MintableAmount.tsx +++ b/src/components/Synthetics/GmList/MintableAmount.tsx @@ -7,7 +7,7 @@ import { formatTokenAmount, formatTokenAmountWithUsd, formatUsd } from "lib/numb import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; import { TokenData } from "domain/synthetics/tokens"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { TokenValuesInfoCell } from "./TokenValuesInfoCell"; export function MintableAmount({ @@ -27,7 +27,7 @@ export function MintableAmount({ shortDepositCapacityAmount?: bigint; } | undefined; - market: MarketInfo | GlvPoolInfo; + market: MarketInfo | GlvMarketInfo; token: TokenData; longToken?: TokenData; shortToken?: TokenData; diff --git a/src/components/Synthetics/GmList/sortGmTokensByField.tsx b/src/components/Synthetics/GmList/sortGmTokensByField.tsx index 954287eb5f..523ce3ec7e 100644 --- a/src/components/Synthetics/GmList/sortGmTokensByField.tsx +++ b/src/components/Synthetics/GmList/sortGmTokensByField.tsx @@ -2,16 +2,16 @@ import values from "lodash/values"; import type { SortDirection } from "components/Sorter/Sorter"; import { getMarketListingDate } from "config/markets"; -import { MarketTokensAPRData, PoolsInfoData, getMintableMarketTokens } from "domain/synthetics/markets"; +import { MarketTokensAPRData, AllMarketsInfoData, getMintableMarketTokens } from "domain/synthetics/markets"; import { getIsBaseApyReadyToBeShown } from "domain/synthetics/markets/getIsBaseApyReadyToBeShown"; +import { getMintableInfoGlv, isGlv } from "domain/synthetics/markets/glv"; import { convertToUsd, type TokensData } from "domain/synthetics/tokens"; import type { SortField } from "./GmList"; import { sortGmTokensDefault } from "./sortGmTokensDefault"; -import { getMintableInfoGlv, isGlv } from "domain/synthetics/markets/glv"; export function sortGmTokensByField({ chainId, - poolsInfo, + marketsInfo, marketTokensData, orderBy, direction, @@ -21,7 +21,7 @@ export function sortGmTokensByField({ glvMarketsTokensApyData, }: { chainId: number; - poolsInfo: PoolsInfoData; + marketsInfo: AllMarketsInfoData; marketTokensData: TokensData; orderBy: SortField; direction: SortDirection; @@ -30,7 +30,7 @@ export function sortGmTokensByField({ marketsTokensLidoAprData: MarketTokensAPRData | undefined; glvMarketsTokensApyData: MarketTokensAPRData | undefined; }) { - const glvTokens = values(poolsInfo) + const glvTokens = values(marketsInfo) .filter(isGlv) .map((pool) => pool.indexToken); const gmTokens = values(marketTokensData).concat(glvTokens); @@ -50,11 +50,11 @@ export function sortGmTokensByField({ if (orderBy === "buyable") { return gmTokens.sort((a, b) => { - const poolA = poolsInfo[a.address]; - const poolB = poolsInfo[b.address]; + const marketA = marketsInfo[a.address]; + const marketB = marketsInfo[b.address]; - const mintableA = isGlv(poolA) ? getMintableInfoGlv(poolA) : getMintableMarketTokens(poolA, a); - const mintableB = isGlv(poolB) ? getMintableInfoGlv(poolB) : getMintableMarketTokens(poolB, b); + const mintableA = isGlv(marketA) ? getMintableInfoGlv(marketA) : getMintableMarketTokens(marketA, a); + const mintableB = isGlv(marketB) ? getMintableInfoGlv(marketB) : getMintableMarketTokens(marketB, b); return (mintableA?.mintableUsd ?? 0n) > (mintableB?.mintableUsd ?? 0n) ? directionMultiplier @@ -73,6 +73,9 @@ export function sortGmTokensByField({ if (orderBy === "apy") { return gmTokens.sort((a, b) => { + const marketA = marketsInfo[a.address]; + const marketB = marketsInfo[b.address]; + const bonusAprA = marketsTokensIncentiveAprData?.[a.address] ?? 0n; const lidoAprA = marketsTokensLidoAprData?.[a.address] ?? 0n; let aprA = bonusAprA + lidoAprA; @@ -87,9 +90,17 @@ export function sortGmTokensByField({ aprB += marketsTokensApyData?.[b.address] ?? 0n; } + if (isGlv(marketA)) { + aprA = glvMarketsTokensApyData?.[a.address] ?? 0n; + } + + if (isGlv(marketB)) { + aprB = glvMarketsTokensApyData?.[b.address] ?? 0n; + } + return aprA > aprB ? directionMultiplier : -directionMultiplier; }); } - return sortGmTokensDefault(poolsInfo, marketTokensData); + return sortGmTokensDefault(marketsInfo, marketTokensData); } diff --git a/src/components/Synthetics/GmList/sortGmTokensDefault.tsx b/src/components/Synthetics/GmList/sortGmTokensDefault.tsx index 0dfe453cc0..660f7ed5fd 100644 --- a/src/components/Synthetics/GmList/sortGmTokensDefault.tsx +++ b/src/components/Synthetics/GmList/sortGmTokensDefault.tsx @@ -2,7 +2,7 @@ import entries from "lodash/entries"; import values from "lodash/values"; import type { Address } from "viem"; -import type { PoolsInfoData } from "domain/synthetics/markets"; +import type { AllMarketsInfoData } from "domain/synthetics/markets"; import { TokenData, TokensData, convertToUsd } from "domain/synthetics/tokens"; import { isGlv } from "domain/synthetics/markets/glv"; @@ -12,7 +12,7 @@ import { isGlv } from "domain/synthetics/markets/glv"; * 2. If non-zero balance, by balance descending * 3. If zero balance, by total supply USD descending */ -export function sortGmTokensDefault(marketsInfoData: PoolsInfoData, marketTokensData: TokensData) { +export function sortGmTokensDefault(marketsInfoData: AllMarketsInfoData, marketTokensData: TokensData) { if (marketsInfoData === undefined || marketTokensData === undefined) { return []; } @@ -26,9 +26,6 @@ export function sortGmTokensDefault(marketsInfoData: PoolsInfoData, marketTokens } = {} as any; for (const market of values(marketsInfoData)) { - // if (market.indexTokenAddress === "0xDD06Cd6694FeB4222FD1a4146d118078D672d7EB") { - // debugger; // eslint-disable-line - // } if (market.isDisabled) { continue; } diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx index 6199f6ab58..73453afea5 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -35,6 +35,7 @@ import { useGmDepositWithdrawalBoxState } from "./useGmDepositWithdrawalBoxState import { useUpdateInputAmounts } from "./useUpdateInputAmounts"; import { useUpdateTokens } from "./useUpdateTokens"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import { PoolSelector } from "components/MarketSelector/PoolSelector"; @@ -43,13 +44,12 @@ import TokenSelector from "components/TokenSelector/TokenSelector"; import { selectPoolsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { isGlv } from "domain/synthetics/markets/glv"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; import { Swap } from "../Swap"; import { InfoRows } from "./InfoRows"; import { useFees } from "./useFees"; import { useSubmitButtonState } from "./useSubmitButtonState"; -export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: GlvPoolInfo }) { +export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: GlvMarketInfo }) { const { selectedMarketAddress: marketAddress, operation, @@ -116,7 +116,14 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv const indexName = marketInfo && getMarketIndexName(marketInfo); - let firstToken = getTokenData(tokensData, firstTokenAddress); + const allTokensData = useMemo(() => { + return { + ...tokensData, + ...marketTokensData, + }; + }, [tokensData, marketTokensData]); + + let firstToken = getTokenData(allTokensData, firstTokenAddress); let firstTokenAmount = parseValue(firstTokenInputValue, firstToken?.decimals || 0); const firstTokenUsd = convertToUsd( firstTokenAmount, @@ -124,7 +131,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv isDeposit ? firstToken?.prices?.minPrice : firstToken?.prices?.maxPrice ); - let secondToken = getTokenData(tokensData, secondTokenAddress); + let secondToken = getTokenData(allTokensData, secondTokenAddress); let secondTokenAmount = parseValue(secondTokenInputValue, secondToken?.decimals || 0); const secondTokenUsd = convertToUsd( secondTokenAmount, @@ -276,13 +283,13 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv ]); const { longCollateralLiquidityUsd, shortCollateralLiquidityUsd } = useMemo(() => { - if (!marketInfo || isGlvMarket) return {}; + if (!underlyingGmMarket || isGlvMarket) return {}; return { - longCollateralLiquidityUsd: getAvailableUsdLiquidityForCollateral(marketInfo, true), - shortCollateralLiquidityUsd: getAvailableUsdLiquidityForCollateral(marketInfo, false), + longCollateralLiquidityUsd: getAvailableUsdLiquidityForCollateral(underlyingGmMarket, true), + shortCollateralLiquidityUsd: getAvailableUsdLiquidityForCollateral(underlyingGmMarket, false), }; - }, [marketInfo, isGlvMarket]); + }, [underlyingGmMarket, isGlvMarket]); const amounts = useDepositWithdrawalAmounts({ isDeposit, @@ -303,6 +310,10 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv gasPrice, isDeposit, tokensData, + isGlv: isGlvMarket, + glvMarket: marketInfo as GlvMarketInfo, + // @todo + isMarketTokenDeposit: false, }); const isHighPriceImpact = @@ -317,6 +328,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv isHighPriceImpact, isHighPriceImpactAccepted, marketInfo: underlyingGmMarket, + vaultInfo: marketInfo as GlvMarketInfo, marketToken: marketToken!, operation, shouldDisableValidation: shouldDisableValidationForTesting, @@ -333,6 +345,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv shortTokenLiquidityUsd: shortCollateralLiquidityUsd, marketTokensData, isGlv: Boolean(isGlvMarket), + selectedGlvGmMarket, }); const firstTokenShowMaxButton = @@ -477,14 +490,6 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv [firstToken, onFocusedCollateralInputChange, setFirstTokenInputValue] ); - const handleFormSubmit = useCallback( - (e: React.FormEvent) => { - e.preventDefault(); - submitState.onSubmit?.(); - }, - [submitState] - ); - const marketTokenInputClickMax = useCallback(() => { if (marketToken?.balance) { const formattedGMBalance = formatAmountFree(marketToken.balance, marketToken.decimals); @@ -589,7 +594,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv return ( <> -
+
void; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx index f06c1b714e..41b1aa2a44 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx @@ -1,7 +1,10 @@ import { useMemo } from "react"; -import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; + +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { estimateExecuteDepositGasLimit, + estimateExecuteGlvDepositGasLimit, + estimateExecuteGlvWithdrawalGasLimit, estimateExecuteWithdrawalGasLimit, FeeItem, GasLimitsConfig, @@ -9,12 +12,15 @@ import { getFeeItem, getTotalFeeItem, } from "domain/synthetics/fees"; -import { TokensData } from "domain/synthetics/tokens"; -import { GmSwapFees } from "domain/synthetics/trade"; import { estimateDepositOraclePriceCount, + estimateGlvDepositOraclePriceCount, + estimateGlvWithdrawalOraclePriceCount, estimateWithdrawalOraclePriceCount, } from "domain/synthetics/fees/utils/estimateOraclePriceCount"; +import { TokensData } from "domain/synthetics/tokens"; +import { GmSwapFees } from "domain/synthetics/trade"; +import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; export const useFees = ({ amounts, @@ -23,6 +29,9 @@ export const useFees = ({ gasPrice, isDeposit, tokensData, + glvMarket, + isGlv, + isMarketTokenDeposit, }: { amounts: ReturnType; chainId: number; @@ -30,6 +39,9 @@ export const useFees = ({ gasPrice: bigint | undefined; isDeposit: boolean; tokensData: TokensData | undefined; + glvMarket: GlvMarketInfo | undefined; + isGlv; + isMarketTokenDeposit: boolean; }) => { return useMemo(() => { if (!gasLimits || gasPrice === undefined || !tokensData || !amounts) { @@ -54,14 +66,38 @@ export const useFees = ({ uiFee, }; - const gasLimit = isDeposit - ? estimateExecuteDepositGasLimit(gasLimits, { - initialLongTokenAmount: amounts.longTokenAmount, - initialShortTokenAmount: amounts.shortTokenAmount, - }) - : estimateExecuteWithdrawalGasLimit(gasLimits, {}); + let gasLimit; + let oraclePriceCount; + + const glvMarketsCount = BigInt(glvMarket?.markets?.length ?? 0); - const oraclePriceCount = isDeposit ? estimateDepositOraclePriceCount(0) : estimateWithdrawalOraclePriceCount(0); + if (isGlv) { + gasLimit = isDeposit + ? estimateExecuteGlvDepositGasLimit(gasLimits, { + marketsCount: glvMarketsCount, + initialLongTokenAmount: amounts.longTokenAmount, + initialShortTokenAmount: amounts.shortTokenAmount, + isMarketTokenDeposit: isMarketTokenDeposit, + }) + : estimateExecuteGlvWithdrawalGasLimit(gasLimits, { + marketsCount: glvMarketsCount, + }); + } else { + gasLimit = isDeposit + ? estimateExecuteDepositGasLimit(gasLimits, { + initialLongTokenAmount: amounts.longTokenAmount, + initialShortTokenAmount: amounts.shortTokenAmount, + }) + : estimateExecuteWithdrawalGasLimit(gasLimits, {}); + } + + if (isGlv) { + oraclePriceCount = isDeposit + ? estimateGlvDepositOraclePriceCount(glvMarketsCount) + : estimateGlvWithdrawalOraclePriceCount(glvMarketsCount); + } else { + oraclePriceCount = isDeposit ? estimateDepositOraclePriceCount(0) : estimateWithdrawalOraclePriceCount(0); + } const executionFee = getExecutionFee(chainId, gasLimits, tokensData, gasLimit, gasPrice, oraclePriceCount); @@ -69,5 +105,5 @@ export const useFees = ({ fees, executionFee, }; - }, [amounts, chainId, gasLimits, gasPrice, isDeposit, tokensData]); + }, [amounts, chainId, gasLimits, gasPrice, isDeposit, tokensData, glvMarket, isGlv, isMarketTokenDeposit]); }; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx index 3d34821f22..19b4f4213a 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx @@ -7,7 +7,7 @@ import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSe import { useSelector } from "context/SyntheticsStateContext/utils"; import { useHasOutdatedUi } from "domain/legacy"; import { ExecutionFee } from "domain/synthetics/fees"; -import { createDepositTxn, createWithdrawalTxn, MarketInfo } from "domain/synthetics/markets"; +import { createDepositTxn, createGlvDepositTxn, createWithdrawalTxn, MarketInfo } from "domain/synthetics/markets"; import { createShiftTxn } from "domain/synthetics/markets/createShiftTxn"; import { getNeedTokenApprove, @@ -24,12 +24,14 @@ import { useCallback, useMemo, useState } from "react"; import { Operation } from "../types"; import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; import { useFees } from "./useFees"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; interface Props { amounts: ReturnType; fees: ReturnType["fees"]; isDeposit: boolean; marketInfo?: MarketInfo; + vaultInfo?: GlvMarketInfo; marketToken: TokenData; operation: Operation; longToken: TokenData | undefined; @@ -58,6 +60,7 @@ interface Props { marketTokensData?: TokensData; executionFee: ExecutionFee | undefined; isGlv: boolean; + selectedGlvGmMarket?: string; } const processingTextMap = { @@ -93,6 +96,8 @@ export const useSubmitButtonState = ({ marketTokensData, executionFee, isGlv, + selectedGlvGmMarket, + vaultInfo, }: Props) => { const chainId = useSelector(selectChainId); const routerAddress = getContract(chainId, "SyntheticsRouter"); @@ -248,6 +253,27 @@ export const useSubmitButtonState = ({ ? initialLongTokenAddress : shortToken?.address || marketInfo.shortTokenAddress; + if (isGlv && selectedGlvGmMarket && vaultInfo) { + return createGlvDepositTxn(chainId, signer, { + account, + initialLongTokenAddress, + initialShortTokenAddress, + minGlvTokens: marketTokenAmount, + glv: vaultInfo.indexTokenAddress, + longTokenSwapPath: [], + shortTokenSwapPath: [], + longTokenAmount: longTokenAmount ?? 0n, + shortTokenAmount: shortTokenAmount ?? 0n, + market: selectedGlvGmMarket, + executionFee: executionFee.feeTokenAmount, + skipSimulation: shouldDisableValidation, + tokensData, + setPendingTxns, + setPendingDeposit, + isMarketTokenDeposit: longToken?.symbol === "GM", + }); + } + return createDepositTxn(chainId, signer, { account, initialLongTokenAddress, @@ -282,6 +308,9 @@ export const useSubmitButtonState = ({ chainId, setPendingDeposit, setPendingTxns, + selectedGlvGmMarket, + isGlv, + vaultInfo, ] ); diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx index 4b154e4ae5..5ba654ff76 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx @@ -14,7 +14,7 @@ import { GmShiftBox } from "./GmShiftBox/GmShiftBox"; import { selectPoolsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { isGlv } from "domain/synthetics/markets/glv"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { GmSwapBoxDepositWithdrawal } from "./GmDepositWithdrawalBox/GmDepositWithdrawalBox"; import "./GmSwapBox.scss"; @@ -115,7 +115,7 @@ export function GmSwapBox(p: GmSwapBoxProps) { {operation === Operation.Deposit || operation === Operation.Withdrawal ? (
- GM: {indexName} + {isGlvMarket ? "GLV" : "GM"}: {indexName} [{poolName}]
{" "} selected in order form diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx index d1bbd7377e..b721664b73 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx @@ -5,13 +5,14 @@ import { useEffect, useMemo } from "react"; import { useHistory } from "react-router-dom"; import { convertTokenAddress, getTokenBySymbolSafe } from "config/tokens"; -import { selectChainId, selectMarketsInfoData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectChainId, selectPoolsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectShiftAvailableMarkets } from "context/SyntheticsStateContext/selectors/shiftSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets/utils"; import { helperToast } from "lib/helperToast"; import { getMatchingValueFromObject } from "lib/objects"; import useSearchParams from "lib/useSearchParams"; +import { isGlv } from "../../../../domain/synthetics/markets/glv"; import { Mode, Operation } from "./types"; type SearchParams = { @@ -41,7 +42,7 @@ export function useUpdateByQueryParams({ const shiftAvailableMarkets = useSelector(selectShiftAvailableMarkets); const chainId = useSelector(selectChainId); - const marketsInfo = useSelector(selectMarketsInfoData); + const marketsInfo = useSelector(selectPoolsData); const markets = useMemo(() => values(marketsInfo), [marketsInfo]); useEffect( @@ -84,18 +85,18 @@ export function useUpdateByQueryParams({ if (scroll === "1") { window.scrollTo({ top: 0, left: 0 }); } - if ((marketAddress || pool) && markets.length > 0) { if (marketAddress && isAddress(marketAddress)) { const marketInfo = markets.find((market) => market.marketTokenAddress.toLowerCase() === marketAddress); if (marketInfo) { onSelectMarket(marketInfo.marketTokenAddress); - const indexName = getMarketIndexName(marketInfo); + const isGlvMarket = isGlv(marketInfo); + const indexName = isGlvMarket ? marketInfo.name : getMarketIndexName(marketInfo); const poolName = getMarketPoolName(marketInfo); helperToast.success(
- GM: {indexName} + {isGlvMarket ? "GLV" : "GM"}: {indexName} [{poolName}]
{" "} selected in order form diff --git a/src/components/Synthetics/MarketStats/MarketStats.tsx b/src/components/Synthetics/MarketStats/MarketStats.tsx deleted file mode 100644 index 82acd33a0f..0000000000 --- a/src/components/Synthetics/MarketStats/MarketStats.tsx +++ /dev/null @@ -1,397 +0,0 @@ -import { Trans, t } from "@lingui/macro"; -import { useMemo } from "react"; -import { zeroAddress } from "viem"; - -import { getBridgingOptionsForToken } from "config/bridging"; -import { - MarketInfo, - MarketTokensAPRData, - MarketsInfoData, - getMarketIndexName, - getMarketPoolName, - getMaxPoolUsd, - getMintableMarketTokens, - getPoolUsdWithoutPnl, - getSellableMarketToken, -} from "domain/synthetics/markets"; -import { TokenData, TokensData, convertToTokenAmount, convertToUsd } from "domain/synthetics/tokens"; -import { useChainId } from "lib/chains"; -import { BN_ZERO, formatTokenAmountWithUsd, formatUsd } from "lib/numbers"; -import { getByKey } from "lib/objects"; -import MarketTokenSelector from "../MarketTokenSelector/MarketTokenSelector"; - -import { AprInfo } from "components/AprInfo/AprInfo"; -import { CardRow } from "components/CardRow/CardRow"; -import ExternalLink from "components/ExternalLink/ExternalLink"; -import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; -import Tooltip from "components/Tooltip/Tooltip"; -import BridgingInfo from "../BridgingInfo/BridgingInfo"; - -import "./MarketStats.scss"; - -type Props = { - marketsInfoData?: MarketsInfoData; - marketTokensData?: TokensData; - marketInfo?: MarketInfo; - marketToken?: TokenData; - marketsTokensApyData: MarketTokensAPRData | undefined; - marketsTokensIncentiveAprData: MarketTokensAPRData | undefined; - marketsTokensLidoAprData: MarketTokensAPRData | undefined; -}; - -const MARKET_STATS_DECIMALS = 4; - -export function MarketStats(p: Props) { - const { - marketInfo, - marketToken, - marketsTokensApyData, - marketsInfoData, - marketTokensData, - marketsTokensIncentiveAprData, - marketsTokensLidoAprData, - } = p; - const { chainId } = useChainId(); - - const marketPrice = marketToken?.prices?.maxPrice; - const marketBalance = marketToken?.balance; - const marketBalanceUsd = convertToUsd(marketBalance, marketToken?.decimals, marketPrice); - - const marketTotalSupply = marketToken?.totalSupply; - const marketTotalSupplyUsd = convertToUsd(marketTotalSupply, marketToken?.decimals, marketPrice); - - const { longToken, shortToken, longPoolAmount, shortPoolAmount } = marketInfo || {}; - - const mintableInfo = marketInfo && marketToken ? getMintableMarketTokens(marketInfo, marketToken) : undefined; - const sellableInfo = marketInfo && marketToken ? getSellableMarketToken(marketInfo, marketToken) : undefined; - - const maxLongSellableTokenAmount = convertToTokenAmount( - sellableInfo?.maxLongSellableUsd, - longToken?.decimals, - longToken?.prices.minPrice - ); - - const maxShortSellableTokenAmount = convertToTokenAmount( - sellableInfo?.maxShortSellableUsd, - shortToken?.decimals, - shortToken?.prices.minPrice - ); - - const longPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, true, "midPrice") : undefined; - const shortPoolAmountUsd = marketInfo ? getPoolUsdWithoutPnl(marketInfo, false, "midPrice") : undefined; - - const apy = getByKey(marketsTokensApyData, marketInfo?.marketTokenAddress); - const incentiveApr = getByKey(marketsTokensIncentiveAprData, marketInfo?.marketTokenAddress); - const lidoApr = getByKey(marketsTokensLidoAprData, marketInfo?.marketTokenAddress); - const indexName = marketInfo && getMarketIndexName(marketInfo); - const poolName = marketInfo && getMarketPoolName(marketInfo); - - const bridgingOptionsForLongToken = getBridgingOptionsForToken(longToken?.symbol); - const shouldShowMoreInfoForLongToken = Boolean(bridgingOptionsForLongToken); - - const bridgingOptionsForShortToken = getBridgingOptionsForToken(shortToken?.symbol); - const shouldShowMoreInfoForShortToken = Boolean(bridgingOptionsForShortToken); - - const maxLongTokenValue = useMemo( - () => [ - formatTokenAmountWithUsd( - mintableInfo?.longDepositCapacityAmount, - mintableInfo?.longDepositCapacityUsd, - longToken?.symbol, - longToken?.decimals - ), - marketInfo - ? `(${formatUsd(getPoolUsdWithoutPnl(marketInfo, true, "midPrice"))} / ${formatUsd(getMaxPoolUsd(marketInfo, true))})` - : "", - ], - [ - longToken?.decimals, - longToken?.symbol, - marketInfo, - mintableInfo?.longDepositCapacityAmount, - mintableInfo?.longDepositCapacityUsd, - ] - ); - const maxShortTokenValue = useMemo( - () => [ - formatTokenAmountWithUsd( - mintableInfo?.shortDepositCapacityAmount, - mintableInfo?.shortDepositCapacityUsd, - shortToken?.symbol, - shortToken?.decimals - ), - marketInfo - ? `(${formatUsd(getPoolUsdWithoutPnl(marketInfo, false, "midPrice"))} / ${formatUsd(getMaxPoolUsd(marketInfo, false))})` - : "", - ], - [ - marketInfo, - mintableInfo?.shortDepositCapacityAmount, - mintableInfo?.shortDepositCapacityUsd, - shortToken?.decimals, - shortToken?.symbol, - ] - ); - - return ( -
- -
-
- - {indexName} - [{poolName}] -
- ) : ( - "..." - ) - } - /> - { - return ( -
- - GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the - pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged - between traders. -
-
- - Read more about GM token pricing - - . -
-
- ); - }} - /> - } - /> - - - - - } - /> - - - - - {marketInfo?.isSameCollaterals ? ( - - {marketInfo?.longToken.symbol} can be used to buy GM for this market up to the specified buying - caps. - - ) : ( - - {marketInfo?.longToken.symbol} and {marketInfo?.shortToken.symbol} can be used to buy GM for - this market up to the specified buying caps. - - )} - -
-
- - -
- -
- } - /> - ) : ( - "..." - ) - } - /> - - - {marketInfo?.isSameCollaterals ? ( - - GM can be sold for {longToken?.symbol} for this market up to the specified selling caps. The - remaining tokens in the pool are reserved for currently open positions. - - ) : ( - - GM can be sold for {longToken?.symbol} and {shortToken?.symbol} for this market up to the - specified selling caps. The remaining tokens in the pool are reserved for currently open - positions. - - )} -
-
- - {!marketInfo?.isSameCollaterals && ( - - )} -
- } - /> - } - /> - -
- {marketInfo?.isSameCollaterals ? ( - <> - - - {shouldShowMoreInfoForLongToken && ( - } - /> - )} - - ) : ( - <> - - - {shouldShowMoreInfoForLongToken && ( - } - /> - )} -
- - - {shouldShowMoreInfoForShortToken && ( - } - /> - )} - - )} -
-
- ); -} diff --git a/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx index 64305ba90e..0d1ce32533 100644 --- a/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +++ b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx @@ -294,6 +294,7 @@ export function MarketStatsWithComposition(p: Props) { })} > ... + ) : (

Composition

- +
diff --git a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx index c68bef54f7..717ee9f3dd 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx @@ -2,21 +2,18 @@ import { useMemo } from "react"; import { TOKEN_COLOR_MAP } from "config/tokens"; -import { selectTokensData } from "context/SyntheticsStateContext/selectors/globalSelectors"; -import { useSelector } from "context/SyntheticsStateContext/utils"; - -import { getPoolUsdWithoutPnl, MarketInfo } from "domain/synthetics/markets"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { getPoolUsdWithoutPnl, MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; import { bigMath } from "lib/bigmath"; interface CompositionBarProps { - marketInfo?: MarketInfo | GlvPoolInfo; + marketInfo?: MarketInfo | GlvMarketInfo; + marketsInfoData?: MarketsInfoData; } -export function CompositionBar({ marketInfo }: CompositionBarProps) { - const tokensData = useSelector(selectTokensData); +export function CompositionBar({ marketInfo, marketsInfoData }: CompositionBarProps) { const data = useMemo(() => { if (!marketInfo) { return []; @@ -24,11 +21,10 @@ export function CompositionBar({ marketInfo }: CompositionBarProps) { if (isGlv(marketInfo)) { return marketInfo.markets.map((market) => { + const token = marketsInfoData?.[market.address]?.indexToken.symbol; return { value: market.gmBalance, - color: tokensData?.[market.address]?.symbol - ? TOKEN_COLOR_MAP[tokensData?.[market.address]?.symbol] - : TOKEN_COLOR_MAP.default, + color: token ? TOKEN_COLOR_MAP[token] : TOKEN_COLOR_MAP.default, }; }); } @@ -47,7 +43,7 @@ export function CompositionBar({ marketInfo }: CompositionBarProps) { color: shortToken ? TOKEN_COLOR_MAP[shortToken?.symbol] || TOKEN_COLOR_MAP.default : TOKEN_COLOR_MAP.default, }, ]; - }, [marketInfo, tokensData]); + }, [marketInfo, marketsInfoData]); const sum = data.reduce((acc, { value }) => acc + (value ?? 0n), 0n); const percents = data.map(({ value }) => (value === undefined || sum === 0n ? 0n : bigMath.mulDiv(value, 100n, sum))); @@ -64,7 +60,7 @@ export function CompositionBar({ marketInfo }: CompositionBarProps) { return (
); diff --git a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx index 66894e86a0..6d2daa76e2 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx @@ -10,7 +10,7 @@ import { useSelector } from "context/SyntheticsStateContext/utils"; import { getPoolUsdWithoutPnl, MarketInfo } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; import { TokenData } from "domain/synthetics/tokens"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { getMarketIndexName } from "../../../../domain/synthetics/markets/utils"; import { ExchangeTd, ExchangeTh, ExchangeTheadTr, ExchangeTr } from "../../OrderList/ExchangeTable"; @@ -18,7 +18,7 @@ import { useGlvGmMarketsWithComposition } from "../hooks/useMarketGlvGmMarketsCo import { USD_DECIMALS } from "@/config/factors"; interface CompositionTableGmProps { - marketInfo?: MarketInfo | GlvPoolInfo; + marketInfo?: MarketInfo | GlvMarketInfo; } interface GmTableConfig { @@ -107,12 +107,12 @@ export function CompositionTableGm({ marketInfo }: CompositionTableGmProps) { } return ( - + {getMarketIndexName({ indexToken: pool.indexToken, isSpotOnly: false })} @@ -122,7 +122,7 @@ export function CompositionTableGm({ marketInfo }: CompositionTableGmProps) { {formatAmountHuman(tvl[0], USD_DECIMALS, true, 0)}/{formatAmountHuman(tvl[1], USD_DECIMALS, true, 0)} - {comp.toString()} + {comp.toFixed(2)} ); diff --git a/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx b/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx index fd047b08e6..b865741f5f 100644 --- a/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +++ b/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -10,6 +10,7 @@ import { MarketInfo, MarketTokensAPRData, MarketsInfoData, + getGlvMarketSubtitle, getMarketIndexName, getMarketPoolName, getMintableMarketTokens, @@ -40,7 +41,7 @@ import { SelectorBaseMobileHeaderContent, useSelectorClose, } from "../SelectorBase/SelectorBase"; -import { getGlvMarketBadgeName, isGlv } from "domain/synthetics/markets/glv"; +import { getGlvMarketBadgeName, getMintableInfoGlv, getSellableInfoGlv, isGlv } from "domain/synthetics/markets/glv"; type Props = { chainId: number; @@ -84,7 +85,6 @@ export default function MarketTokenSelector(props: Props) { {currentMarketInfo ? ( <> -
+
{isGlvMarket ? ( GLV: {currentMarketInfo.name} @@ -106,7 +106,9 @@ export default function MarketTokenSelector(props: Props) {
- GMX Market Tokens + {isGlvMarket + ? getGlvMarketSubtitle(chainId, currentMarketInfo.indexTokenAddress) + : "GMX Market Tokens"}
@@ -161,6 +163,7 @@ function MarketTokenSelectorInternal(props: Props) { marketsTokensLidoAprData, orderBy, direction, + marketTokensData: marketTokensData, }); const close = useSelectorClose(); @@ -319,6 +322,7 @@ function useFilterSortTokensInfo({ tab, marketsInfoData, favoriteTokens, + marketTokensData, marketsTokensAPRData, marketsTokensIncentiveAprData, marketsTokensLidoAprData, @@ -329,6 +333,7 @@ function useFilterSortTokensInfo({ sortedMarketsByIndexToken: TokenData[]; searchKeyword: string; tab: GmTokenFavoritesTabOption; + marketTokensData: TokensData | undefined; marketsInfoData: MarketsInfoData | undefined; favoriteTokens: string[]; marketsTokensAPRData: MarketTokensAPRData | undefined; @@ -363,12 +368,17 @@ function useFilterSortTokensInfo({ return filteredTokens.map((market) => { const marketInfo = getByKey(marketsInfoData, market?.address)!; - const mintableInfo = getMintableMarketTokens(marketInfo, market); - const sellableInfo = getSellableMarketToken(marketInfo, market); + + const isGlvMarket = isGlv(marketInfo); + + const mintableInfo = isGlvMarket ? getMintableInfoGlv(marketInfo) : getMintableMarketTokens(marketInfo, market); + const sellableInfo = isGlvMarket + ? getSellableInfoGlv(marketInfo, marketsInfoData, marketTokensData) + : getSellableMarketToken(marketInfo, market); const apr = getByKey(marketsTokensAPRData, market?.address); const incentiveApr = getByKey(marketsTokensIncentiveAprData, marketInfo?.marketTokenAddress); const lidoApr = getByKey(marketsTokensLidoAprData, marketInfo?.marketTokenAddress); - const indexName = getMarketIndexName(marketInfo); + const indexName = isGlvMarket ? marketInfo.name : getMarketIndexName(marketInfo); const poolName = getMarketPoolName(marketInfo); return { market, @@ -391,6 +401,7 @@ function useFilterSortTokensInfo({ sortedMarketsByIndexToken, marketsTokensLidoAprData, tab, + marketTokensData, ]); const sortedTokensInfo = useMemo(() => { diff --git a/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx b/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx index 3e264139ac..1c3f986477 100644 --- a/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +++ b/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx @@ -17,6 +17,7 @@ import { getByKey } from "lib/objects"; import { useEffect, useMemo, useState } from "react"; import { useToastAutoClose } from "./useToastAutoClose"; import { StatusNotification } from "./StatusNotification"; +import { isGlv } from "domain/synthetics/markets/glv"; export type Props = { toastTimestamp: number; @@ -142,7 +143,8 @@ export function GmStatusNotification({ } const marketInfo = getByKey(marketsInfoData, pendingDepositData.marketAddress); - const indexName = marketInfo ? getMarketIndexName(marketInfo) : ""; + const isGlvMarket = marketInfo && isGlv(marketInfo); + const indexName = marketInfo ? (isGlvMarket ? marketInfo.name : getMarketIndexName(marketInfo)) : ""; const poolName = marketInfo ? getMarketPoolName(marketInfo) : ""; let tokensText = ""; @@ -158,8 +160,8 @@ export function GmStatusNotification({ return (
- Buying GM: {indexName} - [{poolName}] + Buying {isGlvMarket ? "GLV" : "GM"}: {indexName} + {poolName && [{poolName}]}
{" "} with {tokensText}
@@ -170,14 +172,15 @@ export function GmStatusNotification({ } const marketInfo = getByKey(marketsInfoData, pendingWithdrawalData.marketAddress); - const indexName = marketInfo ? getMarketIndexName(marketInfo) : ""; + const isGlvMarket = marketInfo && isGlv(marketInfo); + const indexName = marketInfo ? (isGlvMarket ? marketInfo.name : getMarketIndexName(marketInfo)) : ""; const poolName = marketInfo ? getMarketPoolName(marketInfo) : ""; return (
- Selling GM: {indexName} - [{poolName}] + Selling {isGlvMarket ? "GLV" : "GM"}: {indexName} + {poolName && [{poolName}]}
); @@ -191,6 +194,7 @@ export function GmStatusNotification({ const fromPoolName = fromMarketInfo ? getMarketPoolName(fromMarketInfo) : ""; const toMarketInfo = getByKey(marketsInfoData, pendingShiftData.toMarket); + const isGlvToMarket = toMarketInfo && isGlv(toMarketInfo); const toIndexName = toMarketInfo ? getMarketIndexName(toMarketInfo) : ""; const toPoolName = toMarketInfo ? getMarketPoolName(toMarketInfo) : ""; @@ -203,8 +207,10 @@ export function GmStatusNotification({ {" "} to{" "} - GM: {toIndexName} - [{toPoolName}] + + {isGlvToMarket ? "GLV" : "GM"}: {toIndexName} + + {toPoolName && [{toPoolName}]} ); diff --git a/src/components/TokenIcon/TokenIcon.tsx b/src/components/TokenIcon/TokenIcon.tsx index 836dc1ce8e..e965f44939 100644 --- a/src/components/TokenIcon/TokenIcon.tsx +++ b/src/components/TokenIcon/TokenIcon.tsx @@ -36,7 +36,7 @@ function TokenIcon({ className, symbol, displaySize, importSize = 24, badge }: P if (badge) { if (typeof badge === "string") { sub = ( - + {badge} ); @@ -44,14 +44,14 @@ function TokenIcon({ className, symbol, displaySize, importSize = 24, badge }: P sub = ( {badge[0]} {badge[0]} {img} diff --git a/src/components/TokenSelector/TokenSelector.tsx b/src/components/TokenSelector/TokenSelector.tsx index aed55da085..aec93414be 100644 --- a/src/components/TokenSelector/TokenSelector.tsx +++ b/src/components/TokenSelector/TokenSelector.tsx @@ -28,6 +28,7 @@ type Props = { tokenAddress: string; tokens: Token[]; infoTokens?: InfoTokens; + tokenInfo?: TokenInfo; showMintingCap?: boolean; mintingCap?: bigint; disabled?: boolean; @@ -45,12 +46,14 @@ type Props = { export default function TokenSelector(props: Props) { const [isModalVisible, setIsModalVisible] = useState(false); const [searchKeyword, setSearchKeyword] = useState(""); - let tokenInfo: TokenInfo | undefined; + let tokenInfo: TokenInfo | undefined = props.tokenInfo; - try { - tokenInfo = getToken(props.chainId, props.tokenAddress); - } catch (e) { - // ...ignore unsupported tokens + if (!tokenInfo) { + try { + tokenInfo = getToken(props.chainId, props.tokenAddress); + } catch (e) { + // ...ignore unsupported tokens + } } const { diff --git a/src/config/contracts.ts b/src/config/contracts.ts index f6fa1e929b..913f3442f4 100644 --- a/src/config/contracts.ts +++ b/src/config/contracts.ts @@ -3,6 +3,7 @@ import { DataStore__factory } from "typechain-types/factories/DataStore__factory import { ExchangeRouter__factory } from "typechain-types/factories/ExchangeRouter__factory"; import { Multicall__factory } from "typechain-types/factories/Multicall__factory"; import { ARBITRUM, ARBITRUM_GOERLI, AVALANCHE, AVALANCHE_FUJI, BSС_MAINNET, BSС_TESTNET } from "./chains"; +import { GlvRouter__factory } from "@/typechain-types"; const { ZeroAddress } = ethers; @@ -135,7 +136,7 @@ const CONTRACTS = { // @todo GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", - GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", + GlvRouter: "0x7db700C1D73E2eBF94904cE07D1702Ca4d50d3d0", Multicall: "0x6d85594c9BD6b0833bC85AE62B360654A1e52D70", }, @@ -195,7 +196,7 @@ const CONTRACTS = { SyntheticsRouter: "0x7452c558d45f8afC8c83dAe62C3f8A5BE19c71f6", // @todo GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", - GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", + GlvRouter: "0x7db700C1D73E2eBF94904cE07D1702Ca4d50d3d0", Multicall: "0x842ec2c7d803033edf55e478f461fc547bc54eb2", }, @@ -256,7 +257,7 @@ const CONTRACTS = { SyntheticsRouter: "0x820F5FfC5b525cD4d88Cd91aCf2c28F16530Cc68", // @todo GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", - GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", + GlvRouter: "0x7db700C1D73E2eBF94904cE07D1702Ca4d50d3d0", Multicall: "0xcA11bde05977b3631167028862bE2a173976CA11", }, @@ -316,7 +317,8 @@ const CONTRACTS = { Timelock: ZeroAddress, GlvReader: "0x8B44C7771CAa8AaA3Fe64C8BdAB29ee392122D13", - GlvRouter: "0x535c0AAd85937d3Db9EBaB2cdB38F8186bb7F3C0", + GlvRouter: "0x7db700C1D73E2eBF94904cE07D1702Ca4d50d3d0", + GlvVault: "0x76f93b5240DF811a3fc32bEDd58daA5784e46C96", Multicall: "0x0f53e512b49202a37c81c6085417C9a9005F2196", }, @@ -345,3 +347,4 @@ function makeGetContract; + default: string; +} = { [ARBITRUM]: {}, [ARBITRUM_GOERLI]: {}, [AVALANCHE]: {}, [AVALANCHE_FUJI]: { - "0xDD06Cd6694FeB4222FD1a4146d118078D672d7EB": "High Caps", + "0xDD06Cd6694FeB4222FD1a4146d118078D672d7EB": { + name: "High Caps", + subtitle: "Core ETH Markets Vault", + }, }, default: "GLV", -} as const; +}; diff --git a/src/config/tokens.ts b/src/config/tokens.ts index b00ddb79e5..d693044987 100644 --- a/src/config/tokens.ts +++ b/src/config/tokens.ts @@ -1041,6 +1041,8 @@ export const TOKEN_COLOR_MAP = { XRP: "#23292f", LTC: "#16182e", OP: "#ff0421", + DOT: "#e6007a", + TEST: "#2d3ed7", default: "#6062a6", }; diff --git a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx index 888d5c01cf..44f273fe6e 100644 --- a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx +++ b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx @@ -57,6 +57,7 @@ import { WithdrawalCreatedEventData, WithdrawalStatuses, } from "./types"; +import { useGlvMarketsInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; export const SyntheticsEventsContext = createContext({}); @@ -73,6 +74,19 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) const { tokensData } = useTokensDataRequest(chainId); const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { glvMarketInfo } = useGlvMarketsInfo(true, { + marketsInfoData, + tokensData, + chainId, + account: currentAccount, + }); + + const allMarketsData = useMemo(() => { + return { + ...marketsInfoData, + ...glvMarketInfo, + }; + }, [marketsInfoData, glvMarketInfo]); const [orderStatuses, setOrderStatuses] = useState({}); const [depositStatuses, setDepositStatuses] = useState({}); @@ -631,7 +645,7 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) helperToast.success( , @@ -704,6 +718,7 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) shiftStatuses, tokensData, withdrawalStatuses, + allMarketsData, ]); return {children}; diff --git a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx index 00d9c6ee0f..bf77296478 100644 --- a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx +++ b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx @@ -21,6 +21,7 @@ import { usePositionsInfoRequest, } from "domain/synthetics/positions"; import { TokensData } from "domain/synthetics/tokens"; +import { useGlvMarketsInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { ConfirmationBoxState, useConfirmationBoxState } from "domain/synthetics/trade/useConfirmationBoxState"; import { PositionEditorState, usePositionEditorState } from "domain/synthetics/trade/usePositionEditorState"; import { PositionSellerState, usePositionSellerState } from "domain/synthetics/trade/usePositionSellerState"; @@ -35,7 +36,6 @@ import { ReactNode, useCallback, useMemo, useState } from "react"; import { useParams } from "react-router-dom"; import { Context, createContext, useContext, useContextSelector } from "use-context-selector"; import { LeaderboardState, useLeaderboardState } from "./useLeaderboardState"; -import { GlvPoolsData, useGlvPoolsInfo } from "domain/synthetics/tokens/useGlvPools"; export type SyntheticsPageType = | "accounts" @@ -61,7 +61,7 @@ export type SyntheticsState = { uiFeeFactor: bigint; userReferralInfo: UserReferralInfo | undefined; depositMarketTokensData: TokensData | undefined; - glvInfo: ReturnType; + glvInfo: ReturnType; closingPositionKey: string | undefined; setClosingPositionKey: (key: string | undefined) => void; @@ -124,8 +124,8 @@ export function SyntheticsStateContextProvider({ const markets = useMarkets(chainId); const marketsInfo = useMarketsInfoRequest(chainId); - const isPoolsPage = pageType === "pools" || pageType === "dashboard"; - const glvInfo = useGlvPoolsInfo(isPoolsPage, { + const shouldFetchGlvMarkets = pageType === "pools" || pageType === "dashboard" || pageType === "earn"; + const glvInfo = useGlvMarketsInfo(shouldFetchGlvMarkets, { marketsInfoData: marketsInfo.marketsInfoData, tokensData: marketsInfo.tokensData, chainId: chainId, @@ -135,7 +135,7 @@ export function SyntheticsStateContextProvider({ const { marketTokensData: depositMarketTokensData } = useMarketTokensDataRequest(chainId, { isDeposit: true, account, - glvMarketsData: glvInfo.glvPoolsInfo, + glvMarketsData: glvInfo.glvMarketInfo, }); const { positionsConstants } = usePositionsConstantsRequest(chainId); const { uiFeeFactor } = useUiFeeFactorRequest(chainId); diff --git a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts index 185a804024..35871386e7 100644 --- a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts @@ -15,14 +15,14 @@ export const selectUserReferralInfo = (s: SyntheticsState) => s.globals.userRefe export const selectChainId = (s: SyntheticsState) => s.globals.chainId; export const selectDepositMarketTokensData = (s: SyntheticsState) => s.globals.depositMarketTokensData; -export const selectGlvInfo = (s: SyntheticsState) => s.globals.glvInfo.glvPoolsInfo; +export const selectGlvInfo = (s: SyntheticsState) => s.globals.glvInfo.glvMarketInfo; export const selectGlvInfoLoading = (s: SyntheticsState) => s.globals.glvInfo.isLoading; export const selectPoolsData = createSelector((q) => { - const glvPoolsInfo = q(selectGlvInfo); + const glvMarketInfo = q(selectGlvInfo); const marketsInfoData = q(selectMarketsInfoData); return { - ...glvPoolsInfo, + ...glvMarketInfo, ...marketsInfoData, }; }); diff --git a/src/domain/synthetics/fees/types.ts b/src/domain/synthetics/fees/types.ts index 26705202e2..daa21c02da 100644 --- a/src/domain/synthetics/fees/types.ts +++ b/src/domain/synthetics/fees/types.ts @@ -30,4 +30,7 @@ export type GasLimitsConfig = { estimatedGasFeeBaseAmount: bigint; estimatedGasFeePerOraclePrice: bigint; estimatedFeeMultiplierFactor: bigint; + glvDepositGasLimit: bigint; + glvWithdrawalGasLimit: bigint; + glvPerMarketGasLimit: bigint; }; diff --git a/src/domain/synthetics/fees/useGasLimits.ts b/src/domain/synthetics/fees/useGasLimits.ts index 5c227b8c72..e77bca7525 100644 --- a/src/domain/synthetics/fees/useGasLimits.ts +++ b/src/domain/synthetics/fees/useGasLimits.ts @@ -3,8 +3,14 @@ import { ESTIMATED_GAS_FEE_BASE_AMOUNT_V2_1, ESTIMATED_GAS_FEE_MULTIPLIER_FACTOR, ESTIMATED_GAS_FEE_PER_ORACLE_PRICE, + GLV_DEPOSIT_GAS_LIMIT, + GLV_PER_MARKET_GAS_LIMIT, + GLV_WITHDRAWAL_GAS_LIMIT, decreaseOrderGasLimitKey, depositGasLimitKey, + glvDepositGasLimitKey, + glvPerMarketGasLimitKey, + glvWithdrawalGasLimitKey, increaseOrderGasLimitKey, shiftGasLimitKey, singleSwapGasLimitKey, @@ -73,6 +79,18 @@ export function useGasLimits(chainId: number): GasLimitsConfig | undefined { methodName: "getUint", params: [ESTIMATED_GAS_FEE_MULTIPLIER_FACTOR], }, + glvDepositGasLimit: { + methodName: "getUint", + params: [GLV_DEPOSIT_GAS_LIMIT], + }, + glvWithdrawalGasLimit: { + methodName: "getUint", + params: [GLV_WITHDRAWAL_GAS_LIMIT], + }, + glvPerMarketGasLimit: { + methodName: "getUint", + params: [GLV_PER_MARKET_GAS_LIMIT], + }, }, }, }), @@ -95,6 +113,9 @@ export function useGasLimits(chainId: number): GasLimitsConfig | undefined { estimatedGasFeeBaseAmount: getBigInt("estimatedGasFeeBaseAmount"), estimatedGasFeePerOraclePrice: getBigInt("estimatedGasFeePerOraclePrice"), estimatedFeeMultiplierFactor: getBigInt("estimatedFeeMultiplierFactor"), + glvDepositGasLimit: getBigInt("glvDepositGasLimit"), + glvWithdrawalGasLimit: getBigInt("glvWithdrawalGasLimit"), + glvPerMarketGasLimit: getBigInt("glvPerMarketGasLimit"), }; }, }); diff --git a/src/domain/synthetics/fees/utils/estimateOraclePriceCount.ts b/src/domain/synthetics/fees/utils/estimateOraclePriceCount.ts index 50c988f17f..b1d7c584d9 100644 --- a/src/domain/synthetics/fees/utils/estimateOraclePriceCount.ts +++ b/src/domain/synthetics/fees/utils/estimateOraclePriceCount.ts @@ -14,3 +14,11 @@ export function estimateOrderOraclePriceCount(swapsCount: number): bigint { export function estimateShiftOraclePriceCount(): bigint { return 4n; } + +export function estimateGlvDepositOraclePriceCount(marketCount: bigint, swapsCount = 0n) { + return 2n + marketCount + swapsCount; +} + +export function estimateGlvWithdrawalOraclePriceCount(marketCount: bigint, swapsCount = 0n) { + return 2n + marketCount + swapsCount; +} diff --git a/src/domain/synthetics/fees/utils/executionFee.ts b/src/domain/synthetics/fees/utils/executionFee.ts index 95d5443dc7..87f9cadf05 100644 --- a/src/domain/synthetics/fees/utils/executionFee.ts +++ b/src/domain/synthetics/fees/utils/executionFee.ts @@ -80,6 +80,52 @@ export function estimateExecuteDepositGasLimit( return gasLimits.depositMultiToken + (deposit.callbackGasLimit ?? 0n) + gasForSwaps; } +export function estimateExecuteGlvDepositGasLimit( + gasLimits: GasLimitsConfig, + { + marketsCount, + isMarketTokenDeposit, + initialLongTokenAmount, + initialShortTokenAmount, + }: { + isMarketTokenDeposit; + marketsCount: bigint; + initialLongTokenAmount: bigint; + initialShortTokenAmount: bigint; + } +) { + const gasPerGlvPerMarket = gasLimits.glvPerMarketGasLimit; + const gasForGlvMarkets = gasPerGlvPerMarket * marketsCount; + const glvDepositGasLimit = gasLimits.glvDepositGasLimit; + const gasLimit = glvDepositGasLimit + gasForGlvMarkets; + + if (isMarketTokenDeposit) { + return gasLimit; + } + + if (initialLongTokenAmount == 0n || initialShortTokenAmount === 0n) { + return gasLimit + gasLimits.depositSingleToken; + } + + return gasLimit + gasLimits.depositMultiToken; +} + +export function estimateExecuteGlvWithdrawalGasLimit( + gasLimits: GasLimitsConfig, + { + marketsCount, + }: { + marketsCount: bigint; + } +) { + const gasPerGlvPerMarket = gasLimits.glvPerMarketGasLimit; + const gasForGlvMarkets = gasPerGlvPerMarket * marketsCount; + const glvWithdrawalGasLimit = gasLimits.glvWithdrawalGasLimit; + const gasLimit = glvWithdrawalGasLimit + gasForGlvMarkets; + + return gasLimit + gasLimits.withdrawalMultiToken; +} + /** * Only GM withdrawals. Do not confuse with decrease with zero delta size. * diff --git a/src/domain/synthetics/markets/createDepositTxn.ts b/src/domain/synthetics/markets/createDepositTxn.ts index 43a4132971..d97e3ef32c 100644 --- a/src/domain/synthetics/markets/createDepositTxn.ts +++ b/src/domain/synthetics/markets/createDepositTxn.ts @@ -1,15 +1,14 @@ -import { getContract } from "config/contracts"; -import { Signer, ethers } from "ethers"; -import { callContract } from "lib/contracts"; +import { t } from "@lingui/macro"; import ExchangeRouter from "abis/ExchangeRouter.json"; +import { getContract } from "config/contracts"; import { NATIVE_TOKEN_ADDRESS, convertTokenAddress } from "config/tokens"; +import { UI_FEE_RECEIVER_ACCOUNT } from "config/ui"; import { SetPendingDeposit } from "context/SyntheticsEvents"; -import { applySlippageToMinOut } from "../trade"; +import { Signer, ethers } from "ethers"; +import { callContract } from "lib/contracts"; import { simulateExecuteTxn } from "../orders/simulateExecuteTxn"; import { TokensData } from "../tokens"; -import { UI_FEE_RECEIVER_ACCOUNT } from "config/ui"; -import { t } from "@lingui/macro"; -import { useMulticall } from "lib/multicall"; +import { applySlippageToMinOut } from "../trade"; import GlvRouter from "abis/GlvRouter.json"; @@ -132,103 +131,128 @@ export async function createDepositTxn(chainId: number, signer: Signer, p: Param }); } -// interface GlvParams { -// account: account, -// glv: params.glv, -// receiver: params.receiver, -// callbackContract: params.callbackContract, -// uiFeeReceiver: params.uiFeeReceiver, -// market: params.market, -// initialLongToken: params.initialLongToken, -// initialShortToken: params.initialShortToken, -// longTokenSwapPath: params.longTokenSwapPath, -// shortTokenSwapPath: params.shortTokenSwapPath - -// export async function createGlvDepositTxn(chainId: number, signer: Signer, p: GlvParams) { -// const contract = getContract(chainId, "GlvRouter"); -// return useMulticall(chainId, "createGlvDepositTxn", { -// refreshInterval: null, -// key: ["createGlvDepositTxn"], -// request: () => { -// return { -// glvs: { -// contractAddress: contract, -// abi: GlvRouter.abi, -// calls: { -// list: { -// methodName: "createGlvDeposit", -// // { -// // "internalType": "address", -// // "name": "receiver", -// // "type": "address" -// // }, -// // { -// // "internalType": "address", -// // "name": "callbackContract", -// // "type": "address" -// // }, -// // { -// // "internalType": "address", -// // "name": "uiFeeReceiver", -// // "type": "address" -// // }, -// // { -// // "internalType": "address", -// // "name": "market", -// // "type": "address" -// // }, -// // { -// // "internalType": "address", -// // "name": "glv", -// // "type": "address" -// // }, -// // { -// // "internalType": "address[]", -// // "name": "longTokenSwapPath", -// // "type": "address[]" -// // }, -// // { -// // "internalType": "address[]", -// // "name": "shortTokenSwapPath", -// // "type": "address[]" -// // }, -// // { -// // "internalType": "uint256", -// // "name": "minLongTokenAmount", -// // "type": "uint256" -// // }, -// // { -// // "internalType": "uint256", -// // "name": "minShortTokenAmount", -// // "type": "uint256" -// // }, -// // { -// // "internalType": "bool", -// // "name": "shouldUnwrapNativeToken", -// // "type": "bool" -// // }, -// // { -// // "internalType": "uint256", -// // "name": "executionFee", -// // "type": "uint256" -// // }, -// // { -// // "internalType": "uint256", -// // "name": "callbackGasLimit", -// // "type": "uint256" -// // } -// params: [{ -// receiver: p.account, -// } - -// ], -// }, -// }, -// }, -// }; -// }, -// parseResponse(result) { -// return result.data.glvs.list.returnValues as GlvList; -// }, -// }); -// } +interface CreateGlvDepositParams { + account: string; + glv: string; + market: string; + + longTokenAmount: bigint; + shortTokenAmount: bigint; + + initialLongTokenAddress: string; + initialShortTokenAddress: string; + + shortTokenSwapPath: string[]; + longTokenSwapPath: string[]; + + minGlvTokens: bigint; + + executionFee: bigint; + + tokensData: TokensData; + skipSimulation?: boolean; + metricId?: string; + setPendingTxns: (txns: any) => void; + setPendingDeposit: SetPendingDeposit; + isMarketTokenDeposit: boolean; +} + +export async function createGlvDepositTxn(chainId: number, signer: Signer, p: CreateGlvDepositParams) { + const contract = new ethers.Contract(getContract(chainId, "GlvRouter"), GlvRouter.abi, signer); + const depositVaultAddress = getContract(chainId, "GlvVault"); + + const isNativeLongDeposit = Boolean( + p.initialLongTokenAddress === NATIVE_TOKEN_ADDRESS && p.longTokenAmount != undefined && p.longTokenAmount > 0 + ); + const isNativeShortDeposit = Boolean( + p.initialShortTokenAddress === NATIVE_TOKEN_ADDRESS && p.shortTokenAmount != undefined && p.shortTokenAmount > 0 + ); + + let wntDeposit = 0n; + + if (isNativeLongDeposit) { + wntDeposit = wntDeposit + p.longTokenAmount!; + } + + if (isNativeShortDeposit) { + wntDeposit = wntDeposit + p.shortTokenAmount!; + } + + const shouldUnwrapNativeToken = isNativeLongDeposit || isNativeShortDeposit; + + const wntAmount = p.executionFee + wntDeposit; + + const initialLongTokenAddress = convertTokenAddress(chainId, p.initialLongTokenAddress, "wrapped"); + const initialShortTokenAddress = convertTokenAddress(chainId, p.initialShortTokenAddress, "wrapped"); + + const multicall = [ + { method: "sendWnt", params: [depositVaultAddress, wntAmount] }, + !isNativeLongDeposit && p.longTokenAmount > 0 + ? { method: "sendTokens", params: [p.initialLongTokenAddress, depositVaultAddress, p.longTokenAmount] } + : undefined, + + !isNativeShortDeposit && p.shortTokenAmount > 0 + ? { method: "sendTokens", params: [p.initialShortTokenAddress, depositVaultAddress, p.shortTokenAmount] } + : undefined, + { + method: "createGlvDeposit", + params: [ + { + glv: p.glv, + market: p.market, + receiver: p.account, + callbackContract: ethers.ZeroAddress, + uiFeeReceiver: UI_FEE_RECEIVER_ACCOUNT ?? ethers.ZeroAddress, + initialLongToken: initialLongTokenAddress, + initialShortToken: initialShortTokenAddress, + longTokenSwapPath: [], + shortTokenSwapPath: [], + minGlvTokens: p.minGlvTokens, + executionFee: p.executionFee, + callbackGasLimit: 0n, + shouldUnwrapNativeToken, + isMarketTokenDeposit: p.isMarketTokenDeposit, + }, + ], + }, + ]; + + const encodedPayload = multicall + .filter(Boolean) + .map((call) => contract.interface.encodeFunctionData(call!.method, call!.params)); + + if (!p.skipSimulation) { + await simulateExecuteTxn(chainId, { + account: p.account, + primaryPriceOverrides: {}, + tokensData: p.tokensData, + createMulticallPayload: encodedPayload, + method: "simulateExecuteGlvDeposit", + errorTitle: t`Deposit error.`, + value: wntAmount, + }); + } + + return; + // return callContract(chainId, contract, "multicall", [encodedPayload], { + // value: wntAmount, + // hideSentMsg: true, + // hideSuccessMsg: true, + // metricId: p.metricId, + // setPendingTxns: p.setPendingTxns, + // }).then(() => { + // debugger; // eslint-disable-line + // p.setPendingDeposit({ + // account: p.account, + // marketAddress: p.glv, + // initialLongTokenAddress, + // initialShortTokenAddress, + // longTokenSwapPath: p.longTokenSwapPath, + // shortTokenSwapPath: p.shortTokenSwapPath, + // minMarketTokens: p.minGlvTokens, + // shouldUnwrapNativeToken, + // initialLongTokenAmount: p.longTokenAmount, + // initialShortTokenAmount: p.shortTokenAmount, + // }); + // }); +} diff --git a/src/domain/synthetics/markets/glv.spec.ts b/src/domain/synthetics/markets/glv.spec.ts index 78fd954097..e69de29bb2 100644 --- a/src/domain/synthetics/markets/glv.spec.ts +++ b/src/domain/synthetics/markets/glv.spec.ts @@ -1,41 +0,0 @@ -import values from "lodash/values"; - -import { MarketInfo } from "domain/synthetics/markets"; -import { GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; - -import { bigMath } from "lib/bigmath"; - -import { convertToUsd } from "../tokens/utils"; - -export function getMintableInfoGlv(glv: GlvPoolInfo) { - const glvPriceUsd = glv.indexToken.prices.maxPrice; - - const amountUsd = values(glv.markets).reduce((acc, market) => { - debugger; // eslint-disable-line - return ( - acc + - bigMath.min( - market.maxMarketTokenBalanceUsd, - convertToUsd(market.glvMaxMarketTokenBalanceAmount, glv.indexToken.decimals, glvPriceUsd) ?? 0n - ) - ); - }, 0n); - - return { - mintableAmount: (amountUsd / glvPriceUsd) * 10n ** BigInt(glv.indexToken.decimals), - mintableUsd: amountUsd, - }; -} - -export function isGlv(pool: GlvPoolInfo | MarketInfo): pool is GlvPoolInfo { - return (pool as GlvPoolInfo).isGlv === true; -} - -export function getGlvMarketBadgeName(name: string) { - return name.split(" ").length > 1 - ? name - .split(" ") - .map((w) => w[0].toUpperCase()) - .join("") - : name.slice(0, 3).toUpperCase(); -} diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts index 470351e6f2..dcd2e28297 100644 --- a/src/domain/synthetics/markets/glv.ts +++ b/src/domain/synthetics/markets/glv.ts @@ -1,14 +1,14 @@ import values from "lodash/values"; import { getSellableMarketToken, MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; -import { GlvMarket, GlvPoolInfo } from "domain/synthetics/tokens/useGlvPools"; +import { GlvMarket, GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { bigMath } from "lib/bigmath"; import { convertToUsd } from "../tokens/utils"; import { TokensData } from "../tokens"; -export function getMaxUsdBuyableAmountInMarket(glvPriceUsd: bigint, market: GlvMarket, glv: GlvPoolInfo) { +export function getMaxUsdBuyableAmountInMarket(glvPriceUsd: bigint, market: GlvMarket, glv: GlvMarketInfo) { const gmBalanceUsd = convertToUsd(market.gmBalance, glv.indexToken.decimals, glvPriceUsd) ?? 0n; return ( @@ -19,7 +19,7 @@ export function getMaxUsdBuyableAmountInMarket(glvPriceUsd: bigint, market: GlvM ); } -export function getMintableInfoGlv(glv: GlvPoolInfo) { +export function getMintableInfoGlv(glv: GlvMarketInfo) { const glvPriceUsd = glv.indexToken.prices.maxPrice; const amountUsd = values(glv.markets).reduce((acc, market) => { @@ -37,12 +37,13 @@ export function getMintableInfoGlv(glv: GlvPoolInfo) { }; } -export function getSellableInfoGlv(glv: GlvPoolInfo, marketsData?: MarketsInfoData, tokensData?: TokensData) { +export function getSellableInfoGlv(glv: GlvMarketInfo, marketsData?: MarketsInfoData, tokensData?: TokensData) { const glvPriceUsd = glv.indexToken.prices.maxPrice; const amountUsd = values(glv.markets).reduce((acc, market) => { const gmMarket = marketsData?.[market.address]; if (!gmMarket) { + // eslint-disable-next-line no-console console.warn(`Market ${market.address} presented in GLV Vault doesn't exist in the markets data`); return acc; } @@ -68,7 +69,7 @@ export function getSellableInfoGlv(glv: GlvPoolInfo, marketsData?: MarketsInfoDa }; } -export function isGlv(pool?: GlvPoolInfo | MarketInfo): pool is GlvPoolInfo { +export function isGlv(pool?: GlvMarketInfo | MarketInfo): pool is GlvMarketInfo { return Boolean(pool && "isGlv" in pool && pool.isGlv); } diff --git a/src/domain/synthetics/markets/types.ts b/src/domain/synthetics/markets/types.ts index 08431a783e..cb341072fc 100644 --- a/src/domain/synthetics/markets/types.ts +++ b/src/domain/synthetics/markets/types.ts @@ -1,5 +1,5 @@ import { TokenData } from "domain/synthetics/tokens"; -import { GlvPoolInfo } from "../tokens/useGlvPools"; +import { GlvMarketInfo } from "../tokens/useGlvMarkets"; export type PnlFactorType = "FOR_DEPOSITS" | "FOR_WITHDRAWALS" | "FOR_TRADERS"; @@ -134,8 +134,8 @@ export type MarketsInfoData = { [marketAddress: string]: MarketInfo; }; -export type PoolsInfoData = { - [marketAddress: string]: MarketInfo | GlvPoolInfo; +export type AllMarketsInfoData = { + [marketAddress: string]: MarketInfo | GlvMarketInfo; }; export type MarketTokensAPRData = { diff --git a/src/domain/synthetics/markets/useGmMarketsApy.ts b/src/domain/synthetics/markets/useGmMarketsApy.ts index bb9b069c53..d01b56adc0 100644 --- a/src/domain/synthetics/markets/useGmMarketsApy.ts +++ b/src/domain/synthetics/markets/useGmMarketsApy.ts @@ -23,6 +23,7 @@ import { getTokenBySymbolSafe } from "config/tokens"; import TokenAbi from "abis/Token.json"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { selectGlvInfo } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { convertToUsd } from "../tokens/utils"; type RawCollectedFee = { cumulativeFeeUsdPerPoolValue: string; @@ -208,7 +209,7 @@ function useIncentivesBonusApr(chainId: number, marketsInfoData: MarketsInfoData export function useGmMarketsApy(chainId: number): GmGlvTokensAPRResult { const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); const { marketsInfoData } = useMarketsInfoRequest(chainId); - const glvPoolsInfo = useSelector(selectGlvInfo); + const glvMarketInfo = useSelector(selectGlvInfo); const marketAddresses = useMarketAddresses(marketsInfoData); const client = getSubsquidGraphClient(chainId); @@ -362,16 +363,17 @@ export function useGmMarketsApy(chainId: number): GmGlvTokensAPRResult { const marketsTokensIncentiveAprData = useIncentivesBonusApr(chainId, marketsInfoData); const glvApyInfoData = useMemo(() => { - if (!glvPoolsInfo || !data?.marketsTokensApyData) { + if (!glvMarketInfo || !data?.marketsTokensApyData) { return {}; } - return Object.values(glvPoolsInfo).reduce((acc, { markets, indexTokenAddress }) => { - // @todo recheck when will buy something + return Object.values(glvMarketInfo).reduce((acc, { markets, indexTokenAddress }) => { const marketData = markets.map((market) => { const apy = data.marketsTokensApyData[market.address]; const marketBalance = market.gmBalance; - const amountUsd = marketBalance * (marketTokensData?.[market.address].prices.minPrice ?? 0n); + const price = marketTokensData?.[market.address].prices.minPrice ?? 0n; + const decimals = marketTokensData?.[market.address].decimals ?? 0; + const amountUsd = convertToUsd(marketBalance, decimals, price) ?? 0n; return { apy, @@ -381,15 +383,17 @@ export function useGmMarketsApy(chainId: number): GmGlvTokensAPRResult { try { const total = marketData.reduce((acc, { amountUsd }) => acc + amountUsd, 0n); - const sumApys = marketData.reduce((acc, { amountUsd, apy }) => acc + amountUsd * apy, 0n); + const sumApys = marketData.reduce((acc, { amountUsd, apy }) => { + return acc + amountUsd * apy; + }, 0n); acc[indexTokenAddress] = total === 0n ? 0n : sumApys / total; } catch (e) { - debugger; // eslint-disable-line + return acc; } return acc; }, {}); - }, [glvPoolsInfo, data?.marketsTokensApyData, marketTokensData]); + }, [glvMarketInfo, data?.marketsTokensApyData, marketTokensData]); return { glvApyInfoData, diff --git a/src/domain/synthetics/markets/useMarketTokensData.ts b/src/domain/synthetics/markets/useMarketTokensData.ts index eb945f1ecf..a475b3786f 100644 --- a/src/domain/synthetics/markets/useMarketTokensData.ts +++ b/src/domain/synthetics/markets/useMarketTokensData.ts @@ -16,7 +16,7 @@ import { getContractMarketPrices } from "./utils"; import SyntheticsReader from "abis/SyntheticsReader.json"; import TokenAbi from "abis/Token.json"; -import { GlvPoolsData } from "../tokens/useGlvPools"; +import { GlvMarketsData } from "../tokens/useGlvMarkets"; import { useMemo } from "react"; import { selectGlvInfo } from "context/SyntheticsStateContext/selectors/globalSelectors"; @@ -26,7 +26,7 @@ type MarketTokensDataResult = { export function useMarketTokensDataRequest( chainId: number, - p: { isDeposit: boolean; account?: string; glvMarketsData?: GlvPoolsData } + p: { isDeposit: boolean; account?: string; glvMarketsData?: GlvMarketsData } ): MarketTokensDataResult { const { isDeposit, account, glvMarketsData = {} } = p; const { tokensData } = useTokensDataRequest(chainId); diff --git a/src/domain/synthetics/markets/utils.ts b/src/domain/synthetics/markets/utils.ts index 99ef1628a2..0aa1ee2e44 100644 --- a/src/domain/synthetics/markets/utils.ts +++ b/src/domain/synthetics/markets/utils.ts @@ -19,7 +19,11 @@ export function getMarketFullName(p: { longToken: Token; shortToken: Token; inde } export function getGlvMarketName(chainId: number, address: string) { - return GLV_MARKETS?.[chainId]?.[address] || GLV_MARKETS.default; + return GLV_MARKETS?.[chainId]?.[address]?.name || GLV_MARKETS.default; +} + +export function getGlvMarketSubtitle(chainId: number, address: string) { + return GLV_MARKETS?.[chainId]?.[address]?.subtitle || ""; } export function getMarketIndexName(p: { indexToken: Token; isSpotOnly: boolean }) { diff --git a/src/domain/synthetics/orders/simulateExecuteTxn.tsx b/src/domain/synthetics/orders/simulateExecuteTxn.tsx index c2ebc7c529..9f67054648 100644 --- a/src/domain/synthetics/orders/simulateExecuteTxn.tsx +++ b/src/domain/synthetics/orders/simulateExecuteTxn.tsx @@ -1,7 +1,13 @@ import { Trans, t } from "@lingui/macro"; import CustomErrors from "abis/CustomErrors.json"; import { ToastifyDebug } from "components/ToastifyDebug/ToastifyDebug"; -import { getContract, getDataStoreContract, getMulticallContract, getExchangeRouterContract } from "config/contracts"; +import { + getContract, + getDataStoreContract, + getMulticallContract, + getExchangeRouterContract, + getGlvRouterContract, +} from "config/contracts"; import { NONCE_KEY, orderKey } from "config/dataStore"; import { convertTokenAddress } from "config/tokens"; import { TokenPrices, TokensData, convertToContractPrice, getTokenData } from "domain/synthetics/tokens"; @@ -23,7 +29,12 @@ type SimulateExecuteParams = { primaryPriceOverrides: PriceOverrides; tokensData: TokensData; value: bigint; - method?: "simulateExecuteDeposit" | "simulateExecuteWithdrawal" | "simulateExecuteOrder" | "simulateExecuteShift"; + method?: + | "simulateExecuteDeposit" + | "simulateExecuteWithdrawal" + | "simulateExecuteOrder" + | "simulateExecuteShift" + | "simulateExecuteGlvDeposit"; errorTitle?: string; swapPricingType?: SwapPricingType; }; @@ -37,6 +48,7 @@ export async function simulateExecuteTxn(chainId: number, p: SimulateExecutePara const dataStore = getDataStoreContract(chainId, provider); const multicall = getMulticallContract(chainId, provider); const exchangeRouter = getExchangeRouterContract(chainId, provider); + const glvRouter = getGlvRouterContract(chainId, provider); const result = await multicall.blockAndAggregate.staticCall([ { target: dataStoreAddress, callData: dataStore.interface.encodeFunctionData("getUint", [NONCE_KEY]) }, @@ -91,6 +103,10 @@ export async function simulateExecuteTxn(chainId: number, p: SimulateExecutePara simulationPayloadData.push( exchangeRouter.interface.encodeFunctionData("simulateExecuteShift", [nextKey, simulationPriceParams]) ); + } else if (method === "simulateExecuteGlvDeposit") { + simulationPayloadData.push( + glvRouter.interface.encodeFunctionData("simulateExecuteGlvDeposit", [nextKey, simulationPriceParams]) + ); } else { throw new Error(`Unknown method: ${method}`); } @@ -100,33 +116,28 @@ export async function simulateExecuteTxn(chainId: number, p: SimulateExecutePara const tenderlyConfig = getTenderlyConfig(); if (tenderlyConfig) { - await simulateTxWithTenderly( - chainId, - exchangeRouter as BaseContract, - p.account, - "multicall", - [simulationPayloadData], - { - value: p.value, - comment: `calling ${method}`, - } - ); + const router = method === "simulateExecuteGlvDeposit" ? glvRouter : exchangeRouter; + await simulateTxWithTenderly(chainId, router as BaseContract, p.account, "multicall", [simulationPayloadData], { + value: p.value, + comment: `calling ${method}`, + }); } try { - await exchangeRouter.multicall.staticCall(simulationPayloadData, { + const router = method === "simulateExecuteGlvDeposit" ? glvRouter : exchangeRouter; + + await router.multicall(simulationPayloadData, { value: p.value, - blockTag: blockNumber, - from: p.account, + gasLimit: 15_000_000, + // blockTag: blockNumber, + // from: p.account, }); } catch (txnError) { const customErrors = new ethers.Contract(ethers.ZeroAddress, CustomErrors.abi); - let msg: React.ReactNode = undefined; try { const errorData = extractDataFromError(txnError?.info?.error?.message) ?? extractDataFromError(txnError?.message); - if (!errorData) throw new Error("No data found in error."); const parsedError = customErrors.interface.parseError(errorData); diff --git a/src/domain/synthetics/tokens/useGlvPools.ts b/src/domain/synthetics/tokens/useGlvMarkets.ts similarity index 96% rename from src/domain/synthetics/tokens/useGlvPools.ts rename to src/domain/synthetics/tokens/useGlvMarkets.ts index 8a52ae58b3..8d85ae2dc8 100644 --- a/src/domain/synthetics/tokens/useGlvPools.ts +++ b/src/domain/synthetics/tokens/useGlvMarkets.ts @@ -24,11 +24,11 @@ export type GlvList = { markets: string[]; }[]; -export type GlvPoolsData = { - [key in string]: GlvPoolInfo; +export type GlvMarketsData = { + [key in string]: GlvMarketInfo; }; -export interface GlvPoolInfo extends MarketInfo { +export interface GlvMarketInfo extends MarketInfo { isGlv: true; indexToken: TokenData & { contractSymbol: string; @@ -61,7 +61,7 @@ type GlvsRequestConfig = MulticallRequestConfig<{ }; }>; -export function useGlvPoolsInfo( +export function useGlvMarketsInfo( enabled: boolean, deps: { marketsInfoData: MarketsInfoData | undefined; @@ -101,7 +101,7 @@ export function useGlvPoolsInfo( const shouldRequest = enabled && glvs && marketsInfoData && tokensData && account; - const { data: glvPoolsInfo, isLoading: isLoadingGlvsInfo } = useMulticall<{}, GlvPoolsData | undefined>( + const { data: glvMarketInfo, isLoading: isLoadingGlvsInfo } = useMulticall<{}, GlvMarketsData | undefined>( chainId, "useGlvMarketsInfos", { @@ -234,7 +234,7 @@ export function useGlvPoolsInfo( return undefined; } - const result: GlvPoolsData = {}; + const result: GlvMarketsData = {}; glvs.forEach(({ glv, markets }) => { const pricesMax = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; const pricesMin = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; @@ -304,7 +304,7 @@ export function useGlvPoolsInfo( ); return { - glvPoolsInfo, + glvMarketInfo, isLoading: isLoadingGlvs || isLoadingGlvsInfo, }; } diff --git a/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts b/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts index ddb6e4b709..e6285fa1f2 100644 --- a/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts +++ b/src/domain/synthetics/trade/useSortedPoolsWithIndexToken.ts @@ -3,7 +3,7 @@ import { useMemo } from "react"; import { EMPTY_ARRAY, getByKey } from "lib/objects"; -import type { MarketInfo, PoolsInfoData } from "../markets"; +import type { MarketInfo, AllMarketsInfoData } from "../markets"; import { isGlv } from "../markets/glv"; import { type TokenData, type TokensData, convertToUsd } from "../tokens"; @@ -13,7 +13,7 @@ const DEFAULT_VALUE = { }; export function sortMarketsWithIndexToken( - marketsInfoData: PoolsInfoData | undefined, + marketsInfoData: AllMarketsInfoData | undefined, marketTokensData: TokensData | undefined ) { if (!marketsInfoData || !marketTokensData) { @@ -83,7 +83,7 @@ export function sortMarketsWithIndexToken( }; } -function useSortedPoolsWithIndexToken(marketsInfoData?: PoolsInfoData, marketTokensData?: TokensData) { +function useSortedPoolsWithIndexToken(marketsInfoData?: AllMarketsInfoData, marketTokensData?: TokensData) { const sortedMarketsWithIndexToken = useMemo( () => sortMarketsWithIndexToken(marketsInfoData, marketTokensData), [marketsInfoData, marketTokensData] diff --git a/src/domain/synthetics/trade/utils/deposit.ts b/src/domain/synthetics/trade/utils/deposit.ts index 9c048f091d..7b5f74c207 100644 --- a/src/domain/synthetics/trade/utils/deposit.ts +++ b/src/domain/synthetics/trade/utils/deposit.ts @@ -4,7 +4,6 @@ import { TokenData, convertToTokenAmount, convertToUsd, getMidPrice } from "doma import { bigMath } from "lib/bigmath"; import { applyFactor } from "lib/numbers"; import { DepositAmounts } from "../types"; -import { isGlv } from "../../markets/glv"; export function getDepositAmounts(p: { marketInfo: MarketInfo; diff --git a/src/img/ic_gm_24.svg b/src/img/ic_gm_24.svg new file mode 100644 index 0000000000..98b9d9d6bf --- /dev/null +++ b/src/img/ic_gm_24.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index a63cbde6a0..fd4fe6b598 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -300,6 +300,7 @@ msgstr "VERFÜGBAR" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "Token suchen" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "Referral Code existiert nicht" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index d496ace980..1cf16edf20 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -300,6 +300,7 @@ msgstr "AVAILABLE" msgid "Confirm Settle" msgstr "Confirm Settle" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "Deposit error." @@ -607,6 +608,11 @@ msgstr "Search Token" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "Buy GMX using Decentralized Exchange Aggregators:" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." @@ -6561,8 +6567,8 @@ msgstr "Referral Code does not exist" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 42ce71d357..2d60522657 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -300,6 +300,7 @@ msgstr "DISPONIBLE" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "Buscar Token" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "El Código de Referido no existe" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 8180b224c2..f74733ac96 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -300,6 +300,7 @@ msgstr "DISPONIBLE" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "Rechercher le token" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "Ce code de parrainage n'existe pas" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 5e147d7679..65f8ba7d01 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -300,6 +300,7 @@ msgstr "利用可能" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "トークン検索" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "紹介コードが存在しません" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 16a5515b6e..1bddb66775 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -300,6 +300,7 @@ msgstr "사용가능" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "토큰 찾기" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "추천인 코드가 존재하지 않습니다" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index 15839c8449..f03ffa20df 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -300,6 +300,7 @@ msgstr "" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index dfc842208f..8241dc776e 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -300,6 +300,7 @@ msgstr "ДОСТУПНО" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "Искать Токен" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "Реферальный Код не существует" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index cbd2c42217..e72ee2fd1e 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -300,6 +300,7 @@ msgstr "可用的" msgid "Confirm Settle" msgstr "" +#: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createDepositTxn.ts msgid "Deposit error." msgstr "" @@ -607,6 +608,11 @@ msgstr "搜索代币" msgid "Buy GMX using Decentralized Exchange Aggregators:" msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +msgid "<0>{0}: <1>{indexName}<2>[{poolName}] <3>selected in order form" +msgstr "" + #: src/components/Synthetics/MarketStats/MarketStats.tsx msgid "GM token pricing is affected by the backing tokens, fees and price impact amounts collected, the pending PnL of open positions, and borrowing fees. It excludes funding fees, which are exchanged between traders.<0/><1/><2>Read more about GM token pricing." msgstr "" @@ -6555,8 +6561,8 @@ msgstr "推荐代码不存在" #: src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx -msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" -msgstr "" +#~ msgid "<0>GM: <1>{indexName}<2>[{poolName}] <3>selected in order form" +#~ msgstr "" #: src/pages/Ecosystem/Ecosystem.jsx msgid "GMX staking calculator" From 9a9677ad35f6947fc530ac0c0be79b5af789514a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Wed, 28 Aug 2024 16:09:39 +0400 Subject: [PATCH 05/49] fix pick realGmMarket when no marketSelected --- .../GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx index 73453afea5..6a6eebe2bf 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -252,7 +252,11 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv * but here marketInfo may be a Vault market */ const { underlyingGmMarket, marketToken, marketTokenUsd, marketTokenAmount } = useMemo(() => { - const realGmMarket = isGlvMarket && selectedGlvGmMarket ? marketsInfoData[selectedGlvGmMarket] : marketInfo; + const realGmMarket = isGlvMarket + ? selectedGlvGmMarket + ? marketsInfoData[selectedGlvGmMarket] + : marketsInfoData[(marketInfo as GlvMarketInfo).markets[0].address] + : marketInfo; const marketToken = getTokenData( isDeposit ? depositMarketTokensData : withdrawalMarketTokensData, From 2020edd515cfce9768ad2a2bfadbec06ac771c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Wed, 28 Aug 2024 18:51:35 +0400 Subject: [PATCH 06/49] updated buy glv --- src/components/Synthetics/GmList/GmList.tsx | 6 +- .../GmDepositWithdrawalBox.tsx | 67 ++++++++++++++++--- .../GmDepositWithdrawalBox/InfoRows.tsx | 4 +- .../useDepositWithdrawalAmounts.tsx | 11 ++- .../useSubmitButtonState.tsx | 19 +++++- .../useUpdateInputAmounts.tsx | 20 ++++-- .../Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx | 4 +- .../GmSwapBox/useUpdateByQueryParams.tsx | 4 +- .../MarketStats/components/CompositionBar.tsx | 48 +++++++------ .../useMarketGlvGmMarketsCompositions.ts | 4 +- .../SyntheticsEventsProvider.tsx | 65 ++++++++++++++++++ .../selectors/globalSelectors.ts | 2 +- .../WebsocketContext/subscribeToEvents.ts | 3 + src/domain/synthetics/fees/useGasLimits.ts | 3 - .../synthetics/markets/createDepositTxn.ts | 47 ++++++------- .../synthetics/orders/simulateExecuteTxn.tsx | 7 +- .../trade/useAvailableTokenOptions.ts | 31 +++++++-- src/domain/synthetics/trade/utils/deposit.ts | 5 ++ src/locales/de/messages.po | 63 ++++++++--------- src/locales/en/messages.po | 63 ++++++++--------- src/locales/es/messages.po | 63 ++++++++--------- src/locales/fr/messages.po | 63 ++++++++--------- src/locales/ja/messages.po | 63 ++++++++--------- src/locales/ko/messages.po | 63 ++++++++--------- src/locales/pseudo/messages.po | 63 ++++++++--------- src/locales/ru/messages.po | 63 ++++++++--------- src/locales/zh/messages.po | 63 ++++++++--------- src/pages/MarketPoolsPage/MarketPoolsPage.tsx | 4 +- 28 files changed, 512 insertions(+), 409 deletions(-) diff --git a/src/components/Synthetics/GmList/GmList.tsx b/src/components/Synthetics/GmList/GmList.tsx index 1ff7767606..d3aa5f159a 100644 --- a/src/components/Synthetics/GmList/GmList.tsx +++ b/src/components/Synthetics/GmList/GmList.tsx @@ -12,7 +12,7 @@ import { useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks import { selectChainId, selectGlvInfoLoading, - selectPoolsData, + selectAllMarketsData, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectShiftAvailableMarkets } from "context/SyntheticsStateContext/selectors/shiftSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; @@ -71,7 +71,7 @@ export function GmList({ isDeposit, }: Props) { const chainId = useSelector(selectChainId); - const poolsInfo = useSelector(selectPoolsData); + const poolsInfo = useSelector(selectAllMarketsData); const glvsLoading = useSelector(selectGlvInfoLoading); const tokensData = useTokensData(); const { marketTokensData } = useMarketTokensData(chainId, { isDeposit }); @@ -360,7 +360,7 @@ function GmListItem({ isShiftAvailable: boolean; }) { const chainId = useSelector(selectChainId); - const marketsInfoData = useSelector(selectPoolsData); + const marketsInfoData = useSelector(selectAllMarketsData); const tokensData = useTokensData(); const userEarnings = useUserEarnings(chainId); const daysConsidered = useDaysConsideredInMarketsApr(); diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx index 73453afea5..aa68319431 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -41,13 +41,16 @@ import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import { PoolSelector } from "components/MarketSelector/PoolSelector"; import TokenWithIcon from "components/TokenIcon/TokenWithIcon"; import TokenSelector from "components/TokenSelector/TokenSelector"; -import { selectPoolsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectAllMarketsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { isGlv } from "domain/synthetics/markets/glv"; import { Swap } from "../Swap"; import { InfoRows } from "./InfoRows"; import { useFees } from "./useFees"; import { useSubmitButtonState } from "./useSubmitButtonState"; +import { ApproveTokenButton } from "@/components/ApproveTokenButton/ApproveTokenButton"; +import { useHighExecutionFeeConsent } from "@/domain/synthetics/trade/useHighExecutionFeeConsent"; +import { getContract } from "@/config/contracts"; export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: GlvMarketInfo }) { const { @@ -72,14 +75,20 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv const gasPrice = useGasPrice(chainId); const { uiFeeFactor } = useUiFeeFactorRequest(chainId); // #endregion + // #region Selectors - const marketsInfoData = useSelector(selectPoolsData); + const marketsInfoData = useSelector(selectAllMarketsData); const { marketsInfo: sortedMarketsInfoByIndexToken } = useSortedPoolsWithIndexToken( marketsInfoData, depositMarketTokensData ); + const isDeposit = operation === Operation.Deposit; const tokensData = useTokensData(); - const { infoTokens } = useAvailableTokenOptions(chainId, { marketsInfoData, tokensData }); + const { infoTokens } = useAvailableTokenOptions(chainId, { + marketsInfoData, + tokensData, + marketTokens: isDeposit ? depositMarketTokensData : withdrawalMarketTokensData, + }); // #region State const gmTokenFavoritesContext = useGmTokensFavorites(); @@ -104,7 +113,6 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv const nativeToken = getByKey(tokensData, NATIVE_TOKEN_ADDRESS); const minResidualAmount = getMinResidualAmount(nativeToken?.decimals, nativeToken?.prices?.maxPrice); - const isDeposit = operation === Operation.Deposit; const isWithdrawal = operation === Operation.Withdrawal; const isSingle = mode === Mode.Single; const isPair = mode === Mode.Pair; @@ -116,6 +124,10 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv const indexName = marketInfo && getMarketIndexName(marketInfo); + const routerAddress = useMemo(() => { + return getContract(chainId, "SyntheticsRouter"); + }, [chainId]); + const allTokensData = useMemo(() => { return { ...tokensData, @@ -152,6 +164,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv address: string; value: string; amount?: bigint; + isGm?: boolean; usd?: bigint; token?: TokenData; setValue: (val: string) => void; @@ -160,6 +173,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv if (firstTokenAddress) { inputs.push({ address: firstTokenAddress, + isGm: firstToken?.symbol === "GM", value: firstTokenInputValue, setValue: setFirstTokenInputValue, amount: firstTokenAmount, @@ -172,6 +186,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv inputs.push({ address: secondTokenAddress, value: secondTokenInputValue, + isGm: false, setValue: setSecondTokenInputValue, amount: secondTokenAmount, usd: secondTokenUsd, @@ -179,7 +194,9 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv }); } - const longTokenInputState = inputs.find((input) => getTokenPoolType(marketInfo, input.address) === "long"); + const longTokenInputState = inputs.find((input) => { + return input.token?.symbol === "GM" || getTokenPoolType(marketInfo, input.address) === "long"; + }); const shortTokenInputState = inputs.find((input) => getTokenPoolType(marketInfo, input.address) === "short"); return { @@ -211,7 +228,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv const result = [longToken]; - if (isGlvMarket) { + if (isGlvMarket && !isPair) { return [ longToken, shortToken, @@ -243,7 +260,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv return result; }, - [marketInfo, tokensData, isGlvMarket, marketTokensData, marketsInfoData] + [marketInfo, tokensData, isGlvMarket, marketTokensData, marketsInfoData, isPair] ); /** @@ -252,7 +269,11 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv * but here marketInfo may be a Vault market */ const { underlyingGmMarket, marketToken, marketTokenUsd, marketTokenAmount } = useMemo(() => { - const realGmMarket = isGlvMarket && selectedGlvGmMarket ? marketsInfoData[selectedGlvGmMarket] : marketInfo; + const realGmMarket = isGlvMarket + ? selectedGlvGmMarket + ? marketsInfoData[selectedGlvGmMarket] + : marketsInfoData[(marketInfo as GlvMarketInfo).markets[0].address] + : marketInfo; const marketToken = getTokenData( isDeposit ? depositMarketTokensData : withdrawalMarketTokensData, @@ -301,6 +322,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv uiFeeFactor, focusedInput, isWithdrawal, + marketTokensData, }); const { fees, executionFee } = useFees({ @@ -316,11 +338,16 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv isMarketTokenDeposit: false, }); + const { element: highExecutionFeeAcknowledgement, isHighFeeConsentError } = useHighExecutionFeeConsent( + executionFee?.feeUsd + ); + const isHighPriceImpact = (fees?.swapPriceImpact?.deltaUsd ?? 0) < 0 && bigMath.abs(fees?.swapPriceImpact?.bps ?? 0n) >= HIGH_PRICE_IMPACT_BPS; const submitState = useSubmitButtonState({ + routerAddress, amounts, executionFee, fees, @@ -346,6 +373,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv marketTokensData, isGlv: Boolean(isGlvMarket), selectedGlvGmMarket, + isHighFeeConsentError, }); const firstTokenShowMaxButton = @@ -701,6 +729,29 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv onMarketChange={onMarketChange} /> + {submitState.tokensToApprove && submitState.tokensToApprove.length > 0 && ( +
+ {submitState.tokensToApprove.map((address) => { + const token = getTokenData(allTokensData, address)!; + let marketTokenData = address === marketToken?.address && getByKey(marketsInfoData, marketToken?.address); + return ( +
+ +
+ ); + })} +
+ )} + + {highExecutionFeeAcknowledgement ? ( +
{highExecutionFeeAcknowledgement}
+ ) : null} +
- - ); } diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx index fdef3a1abb..15231422b6 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx @@ -1,12 +1,14 @@ +import { isGlv } from "@/domain/synthetics/markets/glv"; +import type { AllMarketsInfoData, MarketInfo } from "domain/synthetics/markets/types"; + import { EMPTY_ARRAY } from "lib/objects"; -import type { MarketInfo, MarketsInfoData } from "domain/synthetics/markets/types"; export function getShiftAvailableRelatedMarkets({ marketsInfoData, sortedMarketsInfoByIndexToken, marketTokenAddress, }: { - marketsInfoData: MarketsInfoData | undefined; + marketsInfoData: AllMarketsInfoData | undefined; sortedMarketsInfoByIndexToken: MarketInfo[]; marketTokenAddress?: string; }) { @@ -27,11 +29,25 @@ export function getShiftAvailableRelatedMarkets({ const longTokenAddress = currentMarketInfo.longTokenAddress; const shortTokenAddress = currentMarketInfo.shortTokenAddress; - return sortedMarketsInfoByIndexToken.filter((marketInfo) => { + const gmToGmShiftRelatedMarkets = sortedMarketsInfoByIndexToken.filter((marketInfo) => { + if (isGlv(marketInfo)) { + return false; + } + const isSame = marketInfo.marketTokenAddress === marketTokenAddress; const isRelated = marketInfo.longTokenAddress === longTokenAddress && marketInfo.shortTokenAddress === shortTokenAddress; return !isSame && isRelated; }); + + const relatedGlvMarkets = sortedMarketsInfoByIndexToken.filter((marketInfo) => { + if (isGlv(marketInfo)) { + return marketInfo.markets.some((market) => market.address === marketTokenAddress); + } + + return false; + }); + + return [...gmToGmShiftRelatedMarkets, ...relatedGlvMarkets]; } diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx index 1dfd068bb5..129bbf8f7d 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -1,38 +1,54 @@ -import { t } from "@lingui/macro"; +import { plural, t } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; -import { useMemo, type Dispatch, type SetStateAction } from "react"; +import uniq from "lodash/uniq"; +import { useMemo } from "react"; -import { selectAccount, selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; -import { useSelector } from "context/SyntheticsStateContext/utils"; +import { ExecutionFee } from "@/domain/synthetics/fees"; +import { getNeedTokenApprove, getTokenData, useTokensAllowanceData } from "@/domain/synthetics/tokens"; import { useHasOutdatedUi } from "domain/legacy"; import type { MarketInfo } from "domain/synthetics/markets/types"; -import type { TokenData } from "domain/synthetics/tokens/types"; +import type { TokenData, TokensData } from "domain/synthetics/tokens/types"; import type { GmSwapFees } from "domain/synthetics/trade/types"; import type { ShiftAmounts } from "domain/synthetics/trade/utils/shift"; import { getCommonError, getGmShiftError } from "domain/synthetics/trade/utils/validation"; +import { selectAccount, selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; + +import { useShiftTransactions } from "./useShiftTransactions"; + export function useShiftSubmitState({ - selectedMarketInfo, - selectedToken, amounts, - toMarketInfo, - toToken, + executionFee, fees, + isHighFeeConsentError, isHighPriceImpact, isHighPriceImpactAccepted, - setIsConfirmationBoxVisible, + marketTokenUsd, + payTokenAddresses, + routerAddress, + selectedMarketInfo, + selectedToken, shouldDisableValidationForTesting, + tokensData, + toMarketInfo, + toToken, }: { - selectedMarketInfo: MarketInfo | undefined; - selectedToken: TokenData | undefined; amounts: ShiftAmounts | undefined; - toMarketInfo: MarketInfo | undefined; - toToken: TokenData | undefined; + executionFee: ExecutionFee | undefined; fees: GmSwapFees | undefined; + isHighFeeConsentError: boolean | undefined; isHighPriceImpact: boolean; isHighPriceImpactAccepted: boolean; - setIsConfirmationBoxVisible: Dispatch>; + marketTokenUsd: bigint | undefined; + payTokenAddresses: string[]; + routerAddress: string; + selectedMarketInfo: MarketInfo | undefined; + selectedToken: TokenData | undefined; shouldDisableValidationForTesting: boolean; + tokensData: TokensData | undefined; + toMarketInfo: MarketInfo | undefined; + toToken: TokenData | undefined; }) { const chainId = useSelector(selectChainId); const account = useSelector(selectAccount); @@ -40,11 +56,85 @@ export function useShiftSubmitState({ const { openConnectModal } = useConnectModal(); + const { isSubmitting, onSubmit } = useShiftTransactions({ + fromMarketToken: selectedToken, + fromMarketTokenAmount: amounts?.fromTokenAmount, + fromMarketTokenUsd: amounts?.fromTokenUsd, + marketToken: toToken, + marketTokenAmount: amounts?.toTokenAmount, + shouldDisableValidation: shouldDisableValidationForTesting, + tokensData, + executionFee, + marketTokenUsd, + }); + + const { tokensAllowanceData } = useTokensAllowanceData(chainId, { + spenderAddress: routerAddress, + tokenAddresses: payTokenAddresses, + }); + + const tokensToApprove = useMemo( + function getTokensToApprove() { + const addresses: string[] = []; + + if (!tokensAllowanceData) { + return addresses; + } + + if ( + amounts?.fromTokenAmount !== undefined && + amounts?.fromTokenAmount > 0 && + selectedToken && + getNeedTokenApprove(tokensAllowanceData, selectedToken.address, amounts?.fromTokenAmount) + ) { + addresses.push(selectedToken.address); + } + + return uniq(addresses); + }, + [selectedToken, amounts?.fromTokenAmount, tokensAllowanceData] + ); + return useMemo(() => { + if (isSubmitting) { + return { + text: t`Submitting...`, + disabled: true, + tokensToApprove, + }; + } + if (!account) { return { text: t`Connect Wallet`, onSubmit: () => openConnectModal?.(), + tokensToApprove, + }; + } + + if (isHighFeeConsentError) { + return { + text: t`High Network Fee not yet acknowledged`, + disabled: true, + tokensToApprove, + }; + } + + if (tokensToApprove.length > 0 && selectedToken) { + const symbols = tokensToApprove.map((address) => { + const token = getTokenData(tokensData, address); + return token?.symbol; + }); + + const symbolsText = symbols.join(", "); + + return { + text: plural(symbols.length, { + one: `Pending ${symbolsText} approval`, + other: `Pending ${symbolsText} approvals`, + }), + disabled: true, + tokensToApprove, }; } @@ -72,15 +162,12 @@ export function useShiftSubmitState({ const error = commonError || shiftError; - const onSubmit = () => { - setIsConfirmationBoxVisible(true); - }; - if (error) { return { text: error, error, - isDisabled: !shouldDisableValidationForTesting, + disabled: !shouldDisableValidationForTesting, + tokensToApprove, onSubmit, }; } @@ -88,6 +175,7 @@ export function useShiftSubmitState({ return { text: t`Shift GM`, onSubmit, + tokensToApprove, }; }, [ account, @@ -107,7 +195,11 @@ export function useShiftSubmitState({ isHighPriceImpact, isHighPriceImpactAccepted, openConnectModal, - setIsConfirmationBoxVisible, shouldDisableValidationForTesting, + onSubmit, + isSubmitting, + tokensToApprove, + tokensData, + isHighFeeConsentError, ]); } diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftTransactions.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftTransactions.tsx new file mode 100644 index 0000000000..2fc50a16ef --- /dev/null +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftTransactions.tsx @@ -0,0 +1,101 @@ +import { useCallback, useState } from "react"; + +import { DEFAULT_SLIPPAGE_AMOUNT } from "@/config/factors"; +import { useSyntheticsEvents } from "@/context/SyntheticsEvents"; +import { ExecutionFee } from "@/domain/synthetics/fees"; +import { createShiftTxn } from "@/domain/synthetics/markets/createShiftTxn"; +import { usePendingTxns } from "@/lib/usePendingTxns"; +import useWallet from "@/lib/wallets/useWallet"; +import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import type { TokenData, TokensData } from "domain/synthetics/tokens/types"; + +interface Props { + fromMarketToken: TokenData | undefined; + fromMarketTokenAmount: bigint | undefined; + fromMarketTokenUsd: bigint | undefined; + marketToken: TokenData | undefined; + marketTokenAmount: bigint | undefined; + marketTokenUsd: bigint | undefined; + executionFee: ExecutionFee | undefined; + shouldDisableValidation: boolean; + tokensData: TokensData | undefined; +} + +export function useShiftTransactions({ + fromMarketToken, + fromMarketTokenAmount, + marketToken, + marketTokenAmount, + executionFee, + shouldDisableValidation, + tokensData, +}: Props) { + const [isSubmitting, setIsSubmitting] = useState(false); + const chainId = useSelector(selectChainId); + const { signer, account } = useWallet(); + const { setPendingShift } = useSyntheticsEvents(); + const [, setPendingTxns] = usePendingTxns(); + + const onCreateShift = useCallback( + function onCreateShift() { + if ( + !signer || + !account || + !fromMarketToken || + !executionFee || + !marketToken || + fromMarketTokenAmount === undefined || + marketTokenAmount === undefined || + !tokensData + ) { + return Promise.resolve(); + } + + return createShiftTxn(chainId, signer, { + account, + fromMarketTokenAddress: fromMarketToken.address, + fromMarketTokenAmount: fromMarketTokenAmount, + toMarketTokenAddress: marketToken.address, + minToMarketTokenAmount: marketTokenAmount, + executionFee: executionFee.feeTokenAmount, + allowedSlippage: DEFAULT_SLIPPAGE_AMOUNT, + skipSimulation: shouldDisableValidation, + tokensData, + setPendingTxns, + setPendingShift, + }); + }, + [ + account, + executionFee, + fromMarketToken, + fromMarketTokenAmount, + marketToken, + marketTokenAmount, + signer, + tokensData, + shouldDisableValidation, + chainId, + setPendingShift, + setPendingTxns, + ] + ); + + const onSubmit = useCallback(() => { + setIsSubmitting(true); + + onCreateShift() + .catch((error) => { + throw error; + }) + .finally(() => { + setIsSubmitting(false); + }); + }, [onCreateShift]); + + return { + onSubmit, + isSubmitting, + }; +} diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx index 8803ab519a..d07e264df4 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx @@ -127,6 +127,7 @@ export function GmSwapBox(p: GmSwapBoxProps) { ) : ( TokenState | undefined; onSelectToken: (token: Token) => void; extendedSortSequence?: string[] | undefined; + showTokenName?: boolean; qa?: string; }; @@ -69,6 +72,7 @@ export default function TokenSelector(props: Props) { showNewCaret = false, getTokenState = () => ({ disabled: false, message: null }), extendedSortSequence, + showTokenName, qa, } = props; @@ -97,8 +101,8 @@ export default function TokenSelector(props: Props) { }); const sortedFilteredTokens = useMemo(() => { - const tokensWithBalance: Token[] = []; - const tokensWithoutBalance: Token[] = showBalances ? [] : filteredTokens; + const tokensWithBalance: ExtendedToken[] = []; + const tokensWithoutBalance: ExtendedToken[] = showBalances ? [] : filteredTokens; for (const token of filteredTokens) { const info = infoTokens?.[token.address]; @@ -227,7 +231,7 @@ export default function TokenSelector(props: Props) { )}
-
{token.symbol}
+
{token.isGm ? "GM" : token.symbol}
{token.name}
@@ -263,7 +267,7 @@ export default function TokenSelector(props: Props) { {showSymbolImage && ( )} - {tokenInfo.symbol} + {showTokenName ? tokenInfo.name : tokenInfo.symbol}
{showNewCaret && Dropdown Icon} {!showNewCaret && } diff --git a/src/config/localStorage.ts b/src/config/localStorage.ts index a0b06fba30..d63fac0b57 100644 --- a/src/config/localStorage.ts +++ b/src/config/localStorage.ts @@ -32,6 +32,7 @@ export const SYNTHETICS_DEPOSIT_INDEX_TOKEN_KEY = "synthetics-deposit-index-toke export const SYNTHETICS_DEPOSIT_MARKET_KEY = "synthetics-market-deposit-market"; export const SYNTHETICS_DEPOSIT_MARKET_GLV_KEY = "synthetics-market-glv-deposit-market"; +export const SYNTHETICS_GLV_MARKET_DEPOSIT_TOKEN_KEY = "synthetics-glv-market-deposit-token"; export const SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY = "synthetics-market-deposit-token"; export const SYNTHETICS_COLLATERAL_DEPOSIT_TOKEN_KEY = "synthetics-collateral-deposit-token"; export const SYNTHETICS_LIST_SECTION_KEY = "synthetics-list-section"; diff --git a/src/context/SyntheticsEvents/types.ts b/src/context/SyntheticsEvents/types.ts index 10be750476..be4e36ee71 100644 --- a/src/context/SyntheticsEvents/types.ts +++ b/src/context/SyntheticsEvents/types.ts @@ -100,6 +100,7 @@ export type PendingDepositData = { initialShortTokenAmount: bigint; minMarketTokens: bigint; shouldUnwrapNativeToken: boolean; + isShift?: boolean; }; export type WithdrawalCreatedEventData = { diff --git a/src/domain/synthetics/markets/createDepositTxn.ts b/src/domain/synthetics/markets/createDepositTxn.ts index 33cf216f1f..b595187999 100644 --- a/src/domain/synthetics/markets/createDepositTxn.ts +++ b/src/domain/synthetics/markets/createDepositTxn.ts @@ -131,31 +131,10 @@ export async function createDepositTxn(chainId: number, signer: Signer, p: Param }); } -interface CreateGlvDepositParams { - account: string; - glv: string; +interface CreateGlvDepositParams extends Params { market: string; - allowedSlippage: number; - - longTokenAmount: bigint; - shortTokenAmount: bigint; - - initialLongTokenAddress: string; - initialShortTokenAddress: string; - - shortTokenSwapPath: string[]; - longTokenSwapPath: string[]; - - minGlvTokens: bigint; - - executionFee: bigint; - - tokensData: TokensData; - skipSimulation?: boolean; - metricId?: string; - setPendingTxns: (txns: any) => void; - setPendingDeposit: SetPendingDeposit; isMarketTokenDeposit: boolean; + isShift: boolean; } export async function createGlvDepositTxn(chainId: number, signer: Signer, p: CreateGlvDepositParams) { @@ -186,7 +165,7 @@ export async function createGlvDepositTxn(chainId: number, signer: Signer, p: Cr const initialLongTokenAddress = convertTokenAddress(chainId, p.initialLongTokenAddress, "wrapped"); const initialShortTokenAddress = convertTokenAddress(chainId, p.initialShortTokenAddress, "wrapped"); - const minGlvTokens = applySlippageToMinOut(p.allowedSlippage, p.minGlvTokens); + const minGlvTokens = applySlippageToMinOut(p.allowedSlippage, p.minMarketTokens); const multicall = [ { method: "sendWnt", params: [depositVaultAddress, wntAmount] }, @@ -207,7 +186,7 @@ export async function createGlvDepositTxn(chainId: number, signer: Signer, p: Cr method: "createGlvDeposit", params: [ { - glv: p.glv, + glv: p.marketTokenAddress, market: p.market, receiver: p.account, callbackContract: ethers.ZeroAddress, @@ -250,13 +229,14 @@ export async function createGlvDepositTxn(chainId: number, signer: Signer, p: Cr setPendingTxns: p.setPendingTxns, }).then(() => { p.setPendingDeposit({ + isShift: p.isShift, account: p.account, - marketAddress: p.glv, + marketAddress: p.marketTokenAddress, initialLongTokenAddress, initialShortTokenAddress, longTokenSwapPath: p.longTokenSwapPath, shortTokenSwapPath: p.shortTokenSwapPath, - minMarketTokens: p.minGlvTokens, + minMarketTokens: p.minMarketTokens, shouldUnwrapNativeToken, initialLongTokenAmount: p.longTokenAmount, initialShortTokenAmount: p.shortTokenAmount, diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts index dcd2e28297..5c8b8d5109 100644 --- a/src/domain/synthetics/markets/glv.ts +++ b/src/domain/synthetics/markets/glv.ts @@ -30,10 +30,10 @@ export function getMintableInfoGlv(glv: GlvMarketInfo) { mintableAmount: (amountUsd / glvPriceUsd) * 10n ** BigInt(glv.indexToken.decimals), mintableUsd: amountUsd, // @todo - longDepositCapacityUsd: undefined, - shortDepositCapacityUsd: undefined, - longDepositCapacityAmount: undefined, - shortDepositCapacityAmount: undefined, + longDepositCapacityUsd: 0n, + shortDepositCapacityUsd: 0n, + longDepositCapacityAmount: 0n, + shortDepositCapacityAmount: 0n, }; } diff --git a/src/domain/synthetics/tokens/useGlvMarkets.ts b/src/domain/synthetics/tokens/useGlvMarkets.ts index 8d85ae2dc8..55485858e0 100644 --- a/src/domain/synthetics/tokens/useGlvMarkets.ts +++ b/src/domain/synthetics/tokens/useGlvMarkets.ts @@ -238,8 +238,8 @@ export function useGlvMarketsInfo( glvs.forEach(({ glv, markets }) => { const pricesMax = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; const pricesMin = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; - const [priceMin, usdAmountMin, totalSupply] = pricesMax; - const [priceMax, usdAmountMax] = pricesMin; + const [priceMin, totalSupply] = pricesMax; + const [priceMax] = pricesMin; const glvName = getGlvMarketName(chainId, glv.glvToken); @@ -251,13 +251,10 @@ export function useGlvMarketsInfo( ...tokenConfig, address: glv.glvToken, prices: { - minPrice: priceMin, // 10n ** BigInt(18), - maxPrice: priceMax, // 10n ** BigInt(18), + minPrice: priceMin, + maxPrice: priceMax, }, totalSupply: totalSupply, - // @todo - // usdAmountMax: usdAmountMax, - // usdAmountMin: usdAmountMin, balance: data[glv.glvToken + "-tokenData"].balance.returnValues[0], contractSymbol: data[glv.glvToken + "-tokenData"].symbol.returnValues[0], }; diff --git a/src/domain/synthetics/trade/utils/shift.ts b/src/domain/synthetics/trade/utils/shift.ts index 844b410bef..40852fd577 100644 --- a/src/domain/synthetics/trade/utils/shift.ts +++ b/src/domain/synthetics/trade/utils/shift.ts @@ -2,6 +2,8 @@ import { marketTokenAmountToUsd, usdToMarketTokenAmount } from "domain/synthetic import type { MarketInfo } from "domain/synthetics/markets/types"; import type { TokenData } from "domain/synthetics/tokens/types"; +import { isGlv } from "../../markets/glv"; +import { convertToTokenAmount, convertToUsd } from "../../tokens"; import { getDepositAmounts } from "./deposit"; import { getWithdrawalAmounts } from "./withdrawal"; @@ -46,6 +48,8 @@ export function getShiftAmounts({ swapPriceImpactDeltaUsd: 0n, }; + const isMarketTokenDeposit = isGlv(toMarketInfo); + if (strategy === "byFromToken") { values.fromTokenAmount = fromTokenAmount; values.fromTokenUsd = marketTokenAmountToUsd(fromMarketInfo, fromToken, fromTokenAmount); @@ -61,9 +65,13 @@ export function getShiftAmounts({ forShift: true, }); + const vaultInfo = isMarketTokenDeposit ? toMarketInfo : undefined; + const underlyingGmMarketInfo = isMarketTokenDeposit ? fromMarketInfo : toMarketInfo; + const underlyingGmToken = isMarketTokenDeposit ? fromToken : toToken; + const depositAmounts = getDepositAmounts({ - marketInfo: toMarketInfo, - marketToken: toToken, + marketInfo: underlyingGmMarketInfo, + marketToken: underlyingGmToken, longToken: toMarketInfo.longToken, shortToken: toMarketInfo.shortToken, longTokenAmount: withdrawalAmounts.longTokenAmount, @@ -74,6 +82,8 @@ export function getShiftAmounts({ includeShortToken: false, uiFeeFactor: 0n, forShift: true, + isMarketTokenDeposit, + vaultInfo, }); values.fromLongTokenAmount = withdrawalAmounts.longTokenAmount; @@ -83,10 +93,18 @@ export function getShiftAmounts({ values.swapPriceImpactDeltaUsd = depositAmounts.swapPriceImpactDeltaUsd; values.toTokenAmount = depositAmounts.marketTokenAmount; - values.toTokenUsd = marketTokenAmountToUsd(toMarketInfo, toToken, depositAmounts.marketTokenAmount); + values.toTokenUsd = isMarketTokenDeposit + ? convertToUsd(values.fromTokenAmount, fromToken.decimals, fromToken.prices.minPrice) ?? 0n + : marketTokenAmountToUsd(toMarketInfo, toToken, depositAmounts.marketTokenAmount); + + if (isMarketTokenDeposit) { + values.toTokenAmount = convertToTokenAmount(values.toTokenUsd, toToken.decimals, toToken.prices.minPrice) ?? 0n; + } } else { values.toTokenAmount = toTokenAmount; - values.toTokenUsd = marketTokenAmountToUsd(toMarketInfo, toToken, toTokenAmount); + values.toTokenUsd = isMarketTokenDeposit + ? convertToUsd(toTokenAmount, toToken.decimals, toToken.prices.minPrice) ?? 0n + : marketTokenAmountToUsd(toMarketInfo, toToken, toTokenAmount); const withdrawalAmounts = getWithdrawalAmounts({ marketInfo: fromMarketInfo, @@ -112,6 +130,7 @@ export function getShiftAmounts({ includeShortToken: true, uiFeeFactor: 0n, forShift: true, + isMarketTokenDeposit, }); values.fromLongTokenAmount = depositAmounts.longTokenAmount; diff --git a/src/domain/synthetics/trade/utils/validation.ts b/src/domain/synthetics/trade/utils/validation.ts index b487769107..e91b296def 100644 --- a/src/domain/synthetics/trade/utils/validation.ts +++ b/src/domain/synthetics/trade/utils/validation.ts @@ -18,6 +18,8 @@ import { expandDecimals, formatAmount, formatUsd, PRECISION } from "lib/numbers" import { GmSwapFees, NextPositionValues, SwapPathStats, TradeFees, TriggerThresholdType } from "../types"; import { PriceImpactWarningState } from "../usePriceImpactWarningState"; import { bigMath } from "lib/bigmath"; +import { GlvMarketInfo } from "../../tokens/useGlvMarkets"; +import { getMaxUsdBuyableAmountInMarket, getMintableInfoGlv, isGlv } from "../../markets/glv"; export type ValidationTooltipName = "maxLeverage"; export type ValidationResult = @@ -546,6 +548,7 @@ export function getGmSwapError(p: { isHighPriceImpact: boolean; isHighPriceImpactAccepted: boolean; priceImpactUsd: bigint | undefined; + vaultInfo?: GlvMarketInfo; }) { const { isDeposit, @@ -565,6 +568,7 @@ export function getGmSwapError(p: { isHighPriceImpact, isHighPriceImpactAccepted, priceImpactUsd, + vaultInfo, } = p; if (!marketInfo || !marketToken) { @@ -591,7 +595,9 @@ export function getGmSwapError(p: { const totalCollateralUsd = (longTokenUsd ?? 0n) + (shortTokenUsd ?? 0n); - const mintableInfo = getMintableMarketTokens(marketInfo, marketToken); + const mintableInfo = isGlv(marketInfo) + ? getMintableInfoGlv(marketInfo) + : getMintableMarketTokens(marketInfo, marketToken); if ( (fees?.totalFees?.deltaUsd === undefined ? undefined : fees?.totalFees?.deltaUsd < 0) && @@ -635,6 +641,22 @@ export function getGmSwapError(p: { if ((shortTokenAmount ?? 0n) > (shortToken?.balance ?? 0n)) { return [t`Insufficient ${shortToken?.symbol} balance`]; } + + if (vaultInfo) { + const { mintableUsd: mintableGmUsd } = getMintableMarketTokens(marketInfo, marketToken); + const glvGmMarket = vaultInfo.markets.find(({ address }) => address === marketInfo.marketTokenAddress); + + const maxMintableInMarketUsd = glvGmMarket + ? getMaxUsdBuyableAmountInMarket(vaultInfo.indexToken.prices.minPrice, glvGmMarket, vaultInfo) + : 0n; + + if ( + marketTokenUsd !== undefined && + (mintableGmUsd < marketTokenUsd || maxMintableInMarketUsd < marketTokenUsd) + ) { + return [t`Max GM mintable amount exceeded`]; + } + } } } else { if (marketTokenAmount > (marketToken?.balance ?? 0n)) { @@ -681,6 +703,8 @@ export function getGmShiftError({ isHighPriceImpactAccepted: boolean; priceImpactUsd: bigint | undefined; }) { + const isGlvMarket = isGlv(toMarketInfo); + if (!fromMarketInfo || !fromToken || !toMarketInfo || !toToken) { return [t`Loading...`]; } @@ -708,14 +732,14 @@ export function getGmShiftError({ return [t`Max ${fromToken?.symbol} sellable amount exceeded`]; } - const mintableInfo = getMintableMarketTokens(toMarketInfo, toToken); + const mintableInfo = isGlvMarket ? getMintableInfoGlv(toMarketInfo) : getMintableMarketTokens(toMarketInfo, toToken); const longExceedCapacity = fromLongTokenAmount !== undefined && fromLongTokenAmount > mintableInfo.longDepositCapacityAmount; const shortExceedCapacity = fromShortTokenAmount !== undefined && fromShortTokenAmount > mintableInfo.shortDepositCapacityAmount; - if (longExceedCapacity || shortExceedCapacity) { + if (!isGlvMarket && (longExceedCapacity || shortExceedCapacity)) { return [t`Max ${fromToken?.symbol} buyable amount exceeded`]; } @@ -742,6 +766,11 @@ export function getGmShiftError({ } function getIsValidPoolUsdForDeposit(marketInfo: MarketInfo) { + if (isGlv(marketInfo)) { + // @todo + return true; + } + const tokenIn = getTokenIn(marketInfo); const poolAmount = tokenIn.address === marketInfo.longToken.address ? marketInfo.longPoolAmount : marketInfo.shortPoolAmount; diff --git a/src/img/ic_glv_24.svg b/src/img/ic_glv_24.svg new file mode 100644 index 0000000000..b75ccada03 --- /dev/null +++ b/src/img/ic_glv_24.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index 96b6e12f10..bf0ea0e930 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "App" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "GLP Kaufen / Verkaufen" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index 34a2fd1cb1..e00188ae65 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -1666,6 +1666,7 @@ msgstr "GMX Alerts" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -2864,6 +2865,10 @@ msgstr "Lev." msgid "Stake failed." msgstr "Stake failed." +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "Submitting..." + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "App" @@ -3855,6 +3860,7 @@ msgstr "<0>Notifications are provided by Notifi and not affiliated with GMX. By #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5894,6 +5900,10 @@ msgstr "Maximum auto top-up amount is required" msgid "Buy / Sell GLP" msgstr "Buy / Sell GLP" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "Max GM mintable amount exceeded" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "Open {0} in Explorer" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index ed90b659e4..dcb4aba48a 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "Aplicación" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "Comprar / Vender GLP" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index d84815ea78..cb6f0a72dc 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "Application" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "Acheter / Vendre GLP" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 026771fd44..d022284cbc 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "GLPの購入/売却" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 71f1e3cd6a..9d7fb329bf 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "GLP 구매 / 판매" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index c49456afaa..a496d031a4 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index a0ef536a83..56be805e04 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "Купить / Продать GLP" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "Открыть {0} в Explorer" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 761bb60a97..00ba6f6a91 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -1666,6 +1666,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" msgstr "" @@ -2864,6 +2865,10 @@ msgstr "" msgid "Stake failed." msgstr "" +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +msgid "Submitting..." +msgstr "" + #: src/components/Header/HomeHeaderLinks.tsx msgid "App" msgstr "" @@ -3852,6 +3857,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +#: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeWarningsRows.tsx @@ -5888,6 +5894,10 @@ msgstr "" msgid "Buy / Sell GLP" msgstr "购买/出售GLP" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max GM mintable amount exceeded" +msgstr "" + #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" msgstr "" From 94c145c9431251ac8f65684af3edfe8839302fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 02:40:47 +0400 Subject: [PATCH 11/49] updates and fixes in glv --- .../MarketSelector/GmSelectorForGlv.tsx | 7 ++- .../GmDepositWithdrawalBox.tsx | 10 ++-- .../useGmDepositWithdrawalBoxState.tsx | 7 ++- .../useSubmitButtonState.tsx | 10 +++- .../useUpdateInputAmounts.tsx | 8 +-- .../GmSwapBox/GmShiftBox/GmShiftBox.tsx | 35 ++++++------ .../useRedirectToBuyOnShiftToGlv.tsx | 53 +++++++++++++++++++ ...eDepositWithdrawalSetFirstTokenAddress.tsx | 13 +++++ .../GmSwapBox/useUpdateByQueryParams.tsx | 10 ++++ .../MarketStatsWithComposition.tsx | 12 +++-- .../MarketStats/components/CompositionBar.tsx | 2 +- .../components/CompositionTable.tsx | 2 + .../WebsocketContext/subscribeToEvents.ts | 9 +++- src/domain/synthetics/markets/glv.spec.ts | 7 +++ src/domain/synthetics/markets/glv.ts | 11 +++- src/domain/synthetics/trade/utils/deposit.ts | 13 ++++- .../synthetics/trade/utils/validation.ts | 19 ++++--- src/locales/de/messages.po | 4 ++ src/locales/en/messages.po | 4 ++ src/locales/es/messages.po | 4 ++ src/locales/fr/messages.po | 4 ++ src/locales/ja/messages.po | 4 ++ src/locales/ko/messages.po | 4 ++ src/locales/pseudo/messages.po | 4 ++ src/locales/ru/messages.po | 4 ++ src/locales/zh/messages.po | 4 ++ 26 files changed, 215 insertions(+), 49 deletions(-) create mode 100644 src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx create mode 100644 src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx diff --git a/src/components/MarketSelector/GmSelectorForGlv.tsx b/src/components/MarketSelector/GmSelectorForGlv.tsx index a8c8627254..6a68eb4b87 100644 --- a/src/components/MarketSelector/GmSelectorForGlv.tsx +++ b/src/components/MarketSelector/GmSelectorForGlv.tsx @@ -172,7 +172,12 @@ export function GmPoolsSelector({ if (glvMarketInfo) { return ( -
setIsModalVisible(true) : undefined}> +
setIsModalVisible(true) : undefined} + > {getMarketIndexName(marketInfo)} [{getMarketPoolName(marketInfo)}] {!disablePoolSelector && }
diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx index de6ebda789..d4da4e9fe6 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -35,7 +35,10 @@ import { useGmDepositWithdrawalBoxState } from "./useGmDepositWithdrawalBoxState import { useUpdateInputAmounts } from "./useUpdateInputAmounts"; import { useUpdateTokens } from "./useUpdateTokens"; +import { ApproveTokenButton } from "@/components/ApproveTokenButton/ApproveTokenButton"; +import { getContract } from "@/config/contracts"; import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { useHighExecutionFeeConsent } from "@/domain/synthetics/trade/useHighExecutionFeeConsent"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import { PoolSelector } from "components/MarketSelector/PoolSelector"; @@ -43,14 +46,11 @@ import TokenWithIcon from "components/TokenIcon/TokenWithIcon"; import TokenSelector from "components/TokenSelector/TokenSelector"; import { selectAllMarketsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; -import { getMintableInfoGlv, isGlv } from "domain/synthetics/markets/glv"; +import { isGlv } from "domain/synthetics/markets/glv"; import { Swap } from "../Swap"; import { InfoRows } from "./InfoRows"; import { useFees } from "./useFees"; import { useSubmitButtonState } from "./useSubmitButtonState"; -import { ApproveTokenButton } from "@/components/ApproveTokenButton/ApproveTokenButton"; -import { useHighExecutionFeeConsent } from "@/domain/synthetics/trade/useHighExecutionFeeConsent"; -import { getContract } from "@/config/contracts"; export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: GlvMarketInfo }) { const { @@ -395,6 +395,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv selectedGlvGmMarket, isHighFeeConsentError, isMarketTokenDeposit: isMarketTokenDeposit, + marketsInfoData, }); const firstTokenShowMaxButton = @@ -630,6 +631,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv setOperation: onSetOperation, setMode: onSetMode, onSelectMarket, + onSelectGlvGmMarket, setFirstTokenAddress, }); diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx index 9fef2422eb..ee4995a316 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmDepositWithdrawalBoxState.tsx @@ -7,6 +7,7 @@ import { useLocalStorageSerializeKey } from "lib/localStorage"; import { useSafeState } from "lib/useSafeState"; import { Mode, Operation } from "../types"; +import { useDepositWithdrawalSetFirstTokenAddress } from "../useDepositWithdrawalSetFirstTokenAddress"; export function useGmDepositWithdrawalBoxState(operation: Operation, mode: Mode, marketAddress: string | undefined) { const isDeposit = operation === Operation.Deposit; @@ -16,10 +17,8 @@ export function useGmDepositWithdrawalBoxState(operation: Operation, mode: Mode, const [focusedInput, setFocusedInput] = useState<"longCollateral" | "shortCollateral" | "market">("market"); const [isHighPriceImpactAccepted, setIsHighPriceImpactAccepted] = useState(false); - const [firstTokenAddress, setFirstTokenAddress] = useLocalStorageSerializeKey( - [chainId, SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY, isDeposit, marketAddress, "first"], - undefined - ); + const [firstTokenAddress, setFirstTokenAddress] = useDepositWithdrawalSetFirstTokenAddress(isDeposit, marketAddress); + const [secondTokenAddress, setSecondTokenAddress] = useLocalStorageSerializeKey( [chainId, SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY, isDeposit, marketAddress, "second"], undefined diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx index 245a7d702f..7e2e47823a 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx @@ -5,7 +5,7 @@ import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSe import { useSelector } from "context/SyntheticsStateContext/utils"; import { useHasOutdatedUi } from "domain/legacy"; import { ExecutionFee } from "domain/synthetics/fees"; -import { MarketInfo } from "domain/synthetics/markets"; +import { MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; import { getNeedTokenApprove, getTokenData, @@ -21,6 +21,7 @@ import { Operation } from "../types"; import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; import { useDepositWithdrawalTransactions } from "./useDepositWithdrawalTransactions"; import { useFees } from "./useFees"; +import { getSellableInfoGlv } from "@/domain/synthetics/markets/glv"; interface Props { amounts: ReturnType; @@ -60,6 +61,7 @@ interface Props { isGlv: boolean; selectedGlvGmMarket?: string; isMarketTokenDeposit?: boolean; + marketsInfoData?: MarketsInfoData; } const processingTextMap = { @@ -100,6 +102,7 @@ export const useSubmitButtonState = ({ isHighFeeConsentError, vaultInfo, isMarketTokenDeposit, + marketsInfoData, }: Props) => { const chainId = useSelector(selectChainId); const { data: hasOutdatedUi } = useHasOutdatedUi(); @@ -165,6 +168,10 @@ export const useSubmitButtonState = ({ hasOutdatedUi, })[0]; + const vaultSellableAmount = vaultInfo + ? getSellableInfoGlv(vaultInfo, marketsInfoData, marketTokensData, selectedGlvGmMarket) + : undefined; + const swapError = getGmSwapError({ isDeposit, marketInfo, @@ -184,6 +191,7 @@ export const useSubmitButtonState = ({ isHighPriceImpact: Boolean(isHighPriceImpact), isHighPriceImpactAccepted, priceImpactUsd: fees?.swapPriceImpact?.deltaUsd, + vaultSellableAmount: vaultSellableAmount?.totalAmount, })[0]; const error = commonError || swapError; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx index d70bc5cf3a..ef12b64df3 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useUpdateInputAmounts.tsx @@ -1,8 +1,7 @@ import { Dispatch, SetStateAction, useEffect } from "react"; -import { isGlv } from "domain/synthetics/markets/glv"; import { MarketInfo } from "domain/synthetics/markets/types"; -import { convertToTokenAmount, convertToUsd, TokenData } from "domain/synthetics/tokens"; +import { TokenData } from "domain/synthetics/tokens"; import type { DepositAmounts, WithdrawalAmounts } from "domain/synthetics/trade"; import { formatAmountFree } from "lib/numbers"; @@ -84,11 +83,6 @@ export function useUpdateInputAmounts({ if (longToken) { let longTokenAmountToSet = amounts.longTokenAmount; - if (isGlv(marketInfo)) { - amounts.longTokenUsd; - // @todo - } - longTokenInputState?.setValue( longTokenAmountToSet > 0 ? formatAmountFree(longTokenAmountToSet, longToken.decimals) : "" ); diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx index 46a0e9cf14..ef28a93fba 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx @@ -3,7 +3,7 @@ import { useCallback, useState } from "react"; import { HIGH_PRICE_IMPACT_BPS } from "config/factors"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; -import { useMarketsInfoData, useTokensData, useUiFeeFactor } from "context/SyntheticsStateContext/hooks/globalsHooks"; +import { useTokensData, useUiFeeFactor } from "context/SyntheticsStateContext/hooks/globalsHooks"; import { selectAllMarketsData, selectChainId, @@ -29,6 +29,10 @@ import { useShiftSubmitState } from "./useShiftSubmitState"; import { useUpdateMarkets } from "./useUpdateMarkets"; import { useUpdateTokens } from "./useUpdateTokens"; +import { ApproveTokenButton } from "@/components/ApproveTokenButton/ApproveTokenButton"; +import { getContract } from "@/config/contracts"; +import { getTokenData } from "@/domain/synthetics/tokens"; +import { useHighExecutionFeeConsent } from "@/domain/synthetics/trade/useHighExecutionFeeConsent"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import { ExchangeInfo } from "components/Exchange/ExchangeInfo"; @@ -37,11 +41,8 @@ import { NetworkFeeRow } from "components/Synthetics/NetworkFeeRow/NetworkFeeRow import { GmFees } from "../../GmFees/GmFees"; import { HighPriceImpactRow } from "../HighPriceImpactRow"; import { Swap } from "../Swap"; -import { getTokenData } from "@/domain/synthetics/tokens"; -import { ApproveTokenButton } from "@/components/ApproveTokenButton/ApproveTokenButton"; -import { getContract } from "@/config/contracts"; -import { useHighExecutionFeeConsent } from "@/domain/synthetics/trade/useHighExecutionFeeConsent"; -import { isGlv } from "@/domain/synthetics/markets/glv"; +import { useDepositWithdrawalSetFirstTokenAddress } from "../useDepositWithdrawalSetFirstTokenAddress"; +import { useRedirectToBuyOnShiftToGlv } from "./useRedirectToBuyOnShiftToGlv"; export function GmShiftBox({ selectedMarketAddress, @@ -153,6 +154,18 @@ export function GmShiftBox({ useUpdateTokens({ amounts, selectedToken, toToken, focusedInput, setToMarketText, setSelectedMarketText }); + const [, setFirstTokenAddressForDeposit] = useDepositWithdrawalSetFirstTokenAddress(true, toMarketAddress); + + useRedirectToBuyOnShiftToGlv({ + toMarketAddress, + toMarketInfo, + selectedMarketInfo, + onSelectMarket, + onSelectGlvGmMarket, + setFirstTokenAddressForDeposit, + onSetOperation, + }); + useUpdateByQueryParams({ operation: Operation.Shift, onSelectMarket, @@ -198,18 +211,10 @@ export function GmShiftBox({ const handleToTokenFocus = useCallback(() => setFocusedInput("toMarket"), []); const handleToTokenSelectMarket = useCallback( (marketInfo: MarketInfo): void => { - debugger; // eslint-disable-line - if (isGlv(marketInfo) && selectedMarketInfo?.marketTokenAddress) { - onSelectMarket(marketInfo.marketTokenAddress); - onSelectGlvGmMarket?.(selectedMarketInfo?.marketTokenAddress); - onSetOperation(Operation.Deposit); - return; - } - setToMarketAddress(marketInfo.marketTokenAddress); handleClearValues(); }, - [handleClearValues, onSetOperation, onSelectMarket, onSelectGlvGmMarket] + [handleClearValues] ); return ( diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx new file mode 100644 index 0000000000..59f239906c --- /dev/null +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx @@ -0,0 +1,53 @@ +import { useEffect } from "react"; + +import type { MarketInfo } from "domain/synthetics/markets/types"; + +import { isGlv } from "@/domain/synthetics/markets/glv"; +import { usePrevious } from "@/lib/usePrevious"; +import { Operation } from "../types"; + +/** + * Redirect to the Buy tab when user picks GLV market to shift + */ +export function useRedirectToBuyOnShiftToGlv({ + toMarketAddress, + toMarketInfo, + selectedMarketInfo, + onSelectMarket, + onSelectGlvGmMarket, + setFirstTokenAddressForDeposit, + onSetOperation, +}: { + toMarketAddress: string | undefined; + toMarketInfo: MarketInfo | undefined; + selectedMarketInfo: MarketInfo | undefined; + + onSelectMarket: (marketAddress: string) => void; + onSelectGlvGmMarket?: (marketAddress: string) => void; + setFirstTokenAddressForDeposit: (address: string) => void; + onSetOperation: (operation: Operation) => void; +}) { + const previousToMarketAddress = usePrevious(toMarketAddress); + useEffect(() => { + if ( + toMarketAddress && + toMarketAddress !== previousToMarketAddress && + isGlv(toMarketInfo) && + selectedMarketInfo?.marketTokenAddress + ) { + onSelectMarket(toMarketAddress); + setFirstTokenAddressForDeposit(selectedMarketInfo.marketTokenAddress); + onSetOperation(Operation.Deposit); + onSelectGlvGmMarket?.(selectedMarketInfo.marketTokenAddress); + } + }, [ + toMarketAddress, + toMarketInfo, + selectedMarketInfo, + previousToMarketAddress, + setFirstTokenAddressForDeposit, + onSelectGlvGmMarket, + onSetOperation, + onSelectMarket, + ]); +} diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx new file mode 100644 index 0000000000..aabc1ee309 --- /dev/null +++ b/src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx @@ -0,0 +1,13 @@ +import { SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY } from "@/config/localStorage"; +import { useLocalStorageSerializeKey } from "@/lib/localStorage"; +import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; + +export const useDepositWithdrawalSetFirstTokenAddress = (isDeposit: boolean, marketAddress?: string) => { + const chainId = useSelector(selectChainId); + + return useLocalStorageSerializeKey( + [chainId, SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY, isDeposit, marketAddress, "first"], + undefined + ); +}; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx index 64ecc97bd7..7e6539df17 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx @@ -30,12 +30,14 @@ export function useUpdateByQueryParams({ setMode, setFirstTokenAddress, onSelectMarket, + onSelectGlvGmMarket, }: { operation: Operation; setOperation: (operation: Operation) => void; setMode: (mode: Mode) => void; setFirstTokenAddress?: (address: string | undefined) => void; onSelectMarket: (marketAddress: string) => void; + onSelectGlvGmMarket?: (marketAddress: string) => void; }) { const history = useHistory(); const searchParams = useSearchParams(); @@ -51,6 +53,7 @@ export function useUpdateByQueryParams({ const marketAddress = marketRaw?.toLowerCase(); if (operation) { + debugger; // eslint-disable-line let finalOperation; if (operation.toLowerCase() === "buy") { @@ -85,6 +88,7 @@ export function useUpdateByQueryParams({ if (scroll === "1") { window.scrollTo({ top: 0, left: 0 }); } + if ((marketAddress || pool) && markets.length > 0) { if (marketAddress && isAddress(marketAddress)) { const marketInfo = markets.find((market) => market.marketTokenAddress.toLowerCase() === marketAddress); @@ -111,6 +115,11 @@ export function useUpdateByQueryParams({ if (isCurrentlyShift && !isNewMarketShiftAvailable) { setOperation(Operation.Deposit); } + + if (pool && isGlvMarket && setFirstTokenAddress && onSelectGlvGmMarket) { + setFirstTokenAddress(pool); + onSelectGlvGmMarket(pool); + } } } @@ -137,6 +146,7 @@ export function useUpdateByQueryParams({ marketsInfo, currentOperation, shiftAvailableMarkets, + onSelectGlvGmMarket, ] ); } diff --git a/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx index cf1262c49f..ac3982b6fe 100644 --- a/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +++ b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx @@ -1,5 +1,5 @@ -import cx from "classnames"; import { Trans, t } from "@lingui/macro"; +import cx from "classnames"; import { useMemo } from "react"; import { @@ -26,16 +26,18 @@ import { BridgingInfo } from "../BridgingInfo/BridgingInfo"; import { AprInfo } from "components/AprInfo/AprInfo"; import { MARKET_STATS_DECIMALS } from "config/ui"; import { isGlv } from "domain/synthetics/markets/glv"; +import { useMedia } from "react-use"; import { zeroAddress } from "viem"; -import "./MarketStats.scss"; +import { formatDateTime } from "../../../lib/dates"; +import { bigintToNumber } from "../../../lib/numbers"; + import { CompositionBar } from "./components/CompositionBar"; import { CompositionTableGm } from "./components/CompositionTable"; import { MarketDescription } from "./components/MarketDescription"; import { useMarketMintableTokens } from "./hooks/useMarketMintableTokens"; import { useMarketSellableToken } from "./hooks/useMarketSellableToken"; -import { useMedia } from "react-use"; -import { bigintToNumber } from "../../../lib/numbers"; -import { formatDate, formatDateTime } from "../../../lib/dates"; + +import "./MarketStats.scss"; type Props = { marketsInfoData?: MarketsInfoData; diff --git a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx index 050c003ebd..baa38e4414 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx @@ -6,7 +6,6 @@ import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; import { getPoolUsdWithoutPnl, MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; -import { bigMath } from "lib/bigmath"; import { bigintToNumber } from "@/lib/numbers"; interface CompositionBarProps { @@ -68,6 +67,7 @@ export function CompositionBar({ marketInfo, marketsInfoData }: CompositionBarPr
); diff --git a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx index 6d2daa76e2..d8bd53f224 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx @@ -112,6 +112,7 @@ export function CompositionTableGm({ marketInfo }: CompositionTableGmProps) { @@ -141,6 +142,7 @@ export function CompositionTableGm({ marketInfo }: CompositionTableGmProps) { diff --git a/src/context/WebsocketContext/subscribeToEvents.ts b/src/context/WebsocketContext/subscribeToEvents.ts index 1194e631f6..9cd059327b 100644 --- a/src/context/WebsocketContext/subscribeToEvents.ts +++ b/src/context/WebsocketContext/subscribeToEvents.ts @@ -66,6 +66,10 @@ const GLV_DEPOSIT_CREATED_HASH = ethers.id("GlvDepositCreated"); const GLV_DEPOSIT_EXECUTED_HASH = ethers.id("GlvDepositExecuted"); const GLV_DEPOSIT_CANCELLED_HASH = ethers.id("GlvDepositCancelled"); +const GLV_WITHDRAWAL_CREATED_HASH = ethers.id("GlvWithdrawalCreated"); +const GLV_WITHDRAWAL_EXECUTED_HASH = ethers.id("GlvWithdrawalExecuted"); +const GLV_WITHDRAWAL_CANCELLED_HASH = ethers.id("GlvWithdrawalCancelled"); + export function subscribeToV2Events( chainId: number, provider: Provider, @@ -228,8 +232,9 @@ function createV2EventFilters(chainId: number, account: string, wsProvider: Prov GLV_DEPOSIT_CREATED_HASH, GLV_DEPOSIT_CANCELLED_HASH, GLV_DEPOSIT_EXECUTED_HASH, - - // glv withdrawals + GLV_WITHDRAWAL_CREATED_HASH, + GLV_WITHDRAWAL_EXECUTED_HASH, + GLV_WITHDRAWAL_CANCELLED_HASH, ], null, addressHash, diff --git a/src/domain/synthetics/markets/glv.spec.ts b/src/domain/synthetics/markets/glv.spec.ts index e69de29bb2..ff456ffb0d 100644 --- a/src/domain/synthetics/markets/glv.spec.ts +++ b/src/domain/synthetics/markets/glv.spec.ts @@ -0,0 +1,7 @@ +import { describe, expect, it } from "vitest"; + +describe("glv utils", () => { + it("should be defined", () => { + expect(true).toBeDefined(); + }); +}); diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts index 5c8b8d5109..643b7ce9ce 100644 --- a/src/domain/synthetics/markets/glv.ts +++ b/src/domain/synthetics/markets/glv.ts @@ -37,9 +37,18 @@ export function getMintableInfoGlv(glv: GlvMarketInfo) { }; } -export function getSellableInfoGlv(glv: GlvMarketInfo, marketsData?: MarketsInfoData, tokensData?: TokensData) { +export function getSellableInfoGlv( + glv: GlvMarketInfo, + marketsData: MarketsInfoData | undefined, + tokensData: TokensData | undefined, + gmMarketAddress: string +) { const glvPriceUsd = glv.indexToken.prices.maxPrice; const amountUsd = values(glv.markets).reduce((acc, market) => { + if (gmMarketAddress && gmMarketAddress !== market.address) { + return acc; + } + const gmMarket = marketsData?.[market.address]; if (!gmMarket) { diff --git a/src/domain/synthetics/trade/utils/deposit.ts b/src/domain/synthetics/trade/utils/deposit.ts index 799edbe150..526f48c98c 100644 --- a/src/domain/synthetics/trade/utils/deposit.ts +++ b/src/domain/synthetics/trade/utils/deposit.ts @@ -62,9 +62,18 @@ export function getDepositAmounts(p: { values.longTokenUsd = convertToUsd(longTokenAmount, longToken.decimals, longTokenPrice)!; /** - * If it's GM -> GLV deposit, then we don't apply any fees or price impact + * If it's GM -> GLV deposit, then don't apply any fees or price impact, just convert GM to GLV */ - if (isMarketTokenDeposit) { + if (isMarketTokenDeposit && vaultInfo) { + const gmTokenUsd = convertToUsd(longTokenAmount, longToken.decimals, longTokenPrice)!; + const glvTokenAmount = + convertToTokenAmount(gmTokenUsd, vaultInfo.indexToken.decimals, vaultInfo.indexToken.prices.minPrice) ?? 0n; + const glvTokenUsd = + convertToUsd(glvTokenAmount, vaultInfo.indexToken.decimals, vaultInfo.indexToken.prices.minPrice) ?? 0n; + + values.marketTokenAmount = glvTokenAmount; + values.marketTokenUsd = glvTokenUsd; + return values; } diff --git a/src/domain/synthetics/trade/utils/validation.ts b/src/domain/synthetics/trade/utils/validation.ts index e91b296def..be5a801a91 100644 --- a/src/domain/synthetics/trade/utils/validation.ts +++ b/src/domain/synthetics/trade/utils/validation.ts @@ -1,6 +1,6 @@ import { t } from "@lingui/macro"; import { IS_NETWORK_DISABLED, getChainName } from "config/chains"; -import { BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT } from "config/factors"; +import { BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; import { MarketInfo, getMaxAllowedLeverageByMinCollateralFactor, @@ -12,14 +12,13 @@ import { PositionInfo, willPositionCollateralBeSufficientForPosition } from "dom import { TokenData, TokensRatio } from "domain/synthetics/tokens"; import { getIsEquivalentTokens } from "domain/tokens"; import { ethers } from "ethers"; +import { bigMath } from "lib/bigmath"; import { DUST_USD, isAddressZero } from "lib/legacy"; -import { USD_DECIMALS } from "config/factors"; -import { expandDecimals, formatAmount, formatUsd, PRECISION } from "lib/numbers"; +import { PRECISION, expandDecimals, formatAmount, formatUsd } from "lib/numbers"; +import { getMaxUsdBuyableAmountInMarket, getMintableInfoGlv, isGlv } from "../../markets/glv"; +import { GlvMarketInfo } from "../../tokens/useGlvMarkets"; import { GmSwapFees, NextPositionValues, SwapPathStats, TradeFees, TriggerThresholdType } from "../types"; import { PriceImpactWarningState } from "../usePriceImpactWarningState"; -import { bigMath } from "lib/bigmath"; -import { GlvMarketInfo } from "../../tokens/useGlvMarkets"; -import { getMaxUsdBuyableAmountInMarket, getMintableInfoGlv, isGlv } from "../../markets/glv"; export type ValidationTooltipName = "maxLeverage"; export type ValidationResult = @@ -549,6 +548,7 @@ export function getGmSwapError(p: { isHighPriceImpactAccepted: boolean; priceImpactUsd: bigint | undefined; vaultInfo?: GlvMarketInfo; + vaultSellableAmount?: bigint; }) { const { isDeposit, @@ -569,6 +569,7 @@ export function getGmSwapError(p: { isHighPriceImpactAccepted, priceImpactUsd, vaultInfo, + vaultSellableAmount, } = p; if (!marketInfo || !marketToken) { @@ -670,6 +671,12 @@ export function getGmSwapError(p: { if ((shortTokenUsd ?? 0n) > (shortTokenLiquidityUsd ?? 0n)) { return [t`Insufficient ${shortToken?.symbol} liquidity`]; } + + if (vaultInfo) { + if (marketTokenAmount > (vaultSellableAmount ?? 0n)) { + return [t`Insufficient GLV liquidity`]; + } + } } return [undefined]; diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index bf0ea0e930..0640805138 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -2441,6 +2441,10 @@ msgstr "Min. Empfangen" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "Verfügbarer Auszahlungsbetrag aus GLP. Mittel, die nicht durch aktuelle offene Positionen in Anspruch genommen werden." +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index e00188ae65..df0b65d9de 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -2441,6 +2441,10 @@ msgstr "Minimum received" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "Available amount to withdraw from GLP. Funds not utilized by current open positions." +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "Insufficient GLV liquidity" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index dcb4aba48a..82d02dea8f 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -2441,6 +2441,10 @@ msgstr "Mínimo recibido" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "Cantidad disponible para retirar de GLP. Fondos no utilizados por posiciones activas abiertas" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index cb6f0a72dc..2159d80497 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -2441,6 +2441,10 @@ msgstr "Minimum reçu" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "Somme disponible pour retirer de GLP. Montant non utilisé par les postes actuellement ouverts." +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index d022284cbc..4c81aeb3dd 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -2441,6 +2441,10 @@ msgstr "最低受け取り済" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "GLPから引き出し可能な金額。現在オープンなポジションで利用されていない資金。" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 9d7fb329bf..269967447a 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -2441,6 +2441,10 @@ msgstr "최소량 수치 완료" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "GLP로부터 인출가능한 수량. 현재 포지션에 의해 활용되고 있지 않은 유휴 수량" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index a496d031a4..72cded7a48 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -2441,6 +2441,10 @@ msgstr "" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 56be805e04..45c407ec7e 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -2441,6 +2441,10 @@ msgstr "Минимум получен" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "Доступная сумма для вывода средств из GLP. Средства, не использованные текущими открытыми позициями." +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 00ba6f6a91..ed2531b1c4 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -2441,6 +2441,10 @@ msgstr "最低已接收" msgid "Available amount to withdraw from GLP. Funds not utilized by current open positions." msgstr "可提取的GLP数量. 资金未被当前开仓所使用." +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Insufficient GLV liquidity" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/PositionSeller.jsx From 1b3302bd339f3d8995eccf178dddf42596670a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 13:59:20 +0400 Subject: [PATCH 12/49] fixed events subscription --- .../useDepositWithdrawalTransactions.tsx | 3 +- .../GmStatusNotification.tsx | 9 +-- .../SubaccountContext/SubaccountContext.tsx | 2 +- .../SyntheticsEventsProvider.tsx | 74 +++++++++++++++++-- src/context/SyntheticsEvents/types.ts | 5 +- src/context/SyntheticsEvents/utils.ts | 13 ++++ .../WebsocketContext/subscribeToEvents.ts | 32 ++++---- .../synthetics/markets/createDepositTxn.ts | 16 ++-- .../synthetics/markets/createWithdrawalTxn.ts | 2 +- src/domain/synthetics/markets/glv.ts | 5 +- src/locales/de/messages.po | 8 +- src/locales/en/messages.po | 8 +- src/locales/es/messages.po | 8 +- src/locales/fr/messages.po | 8 +- src/locales/ja/messages.po | 8 +- src/locales/ko/messages.po | 8 +- src/locales/pseudo/messages.po | 8 +- src/locales/ru/messages.po | 8 +- src/locales/zh/messages.po | 8 +- 19 files changed, 177 insertions(+), 56 deletions(-) diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx index 8af0c2efda..1f5ac6d87c 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx @@ -82,13 +82,14 @@ export const useDepositWithdrawalTransactions = ({ ? initialLongTokenAddress : shortToken?.address || marketInfo.shortTokenAddress; + debugger; // eslint-disable-line if (isGlv && selectedGlvGmMarket && vaultInfo) { return createGlvDepositTxn(chainId, signer, { account, initialLongTokenAddress, initialShortTokenAddress, minMarketTokens: marketTokenAmount, - glv: vaultInfo.indexTokenAddress, + marketTokenAddress: vaultInfo.indexTokenAddress, longTokenSwapPath: [], shortTokenSwapPath: [], longTokenAmount: longTokenAmount ?? 0n, diff --git a/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx b/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx index 1c3f986477..ae8c627b9a 100644 --- a/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +++ b/src/components/Synthetics/StatusNotification/GmStatusNotification.tsx @@ -95,7 +95,8 @@ export function GmStatusNotification({ const pendingDepositKey = useMemo(() => { if (pendingDepositData) { - return getPendingDepositKey(pendingDepositData); + const key = getPendingDepositKey(pendingDepositData); + return key; } }, [pendingDepositData]); @@ -170,7 +171,6 @@ export function GmStatusNotification({ if (!pendingWithdrawalData) { return t`Unknown sell GM order`; } - const marketInfo = getByKey(marketsInfoData, pendingWithdrawalData.marketAddress); const isGlvMarket = marketInfo && isGlv(marketInfo); const indexName = marketInfo ? (isGlvMarket ? marketInfo.name : getMarketIndexName(marketInfo)) : ""; @@ -194,7 +194,6 @@ export function GmStatusNotification({ const fromPoolName = fromMarketInfo ? getMarketPoolName(fromMarketInfo) : ""; const toMarketInfo = getByKey(marketsInfoData, pendingShiftData.toMarket); - const isGlvToMarket = toMarketInfo && isGlv(toMarketInfo); const toIndexName = toMarketInfo ? getMarketIndexName(toMarketInfo) : ""; const toPoolName = toMarketInfo ? getMarketPoolName(toMarketInfo) : ""; @@ -207,9 +206,7 @@ export function GmStatusNotification({ {" "} to{" "} - - {isGlvToMarket ? "GLV" : "GM"}: {toIndexName} - + GM: {toIndexName} {toPoolName && [{toPoolName}]} diff --git a/src/context/SubaccountContext/SubaccountContext.tsx b/src/context/SubaccountContext/SubaccountContext.tsx index 83df01be25..664ab66827 100644 --- a/src/context/SubaccountContext/SubaccountContext.tsx +++ b/src/context/SubaccountContext/SubaccountContext.tsx @@ -253,7 +253,7 @@ export function useSubaccountSelector(selector: (s: SubaccountContext) } export function useSubaccountModalOpen() { - return [useSubaccountSelector((s) => s.modalOpen), useSubaccountSelector((s) => s.setModalOpen)] as const; + return [useSubaccountSelector((s) => s?.modalOpen), useSubaccountSelector((s) => s?.setModalOpen)] as const; } export function useSubaccountGenerateSubaccount() { diff --git a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx index 680c1d40c3..229bdf1183 100644 --- a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx +++ b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx @@ -256,24 +256,24 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) }, GlvDepositCreated: (eventData: EventLogData, txnParams: EventTxnParams) => { - debugger; // eslint-disable-line const depositData: DepositCreatedEventData = { account: eventData.addressItems.items.account, receiver: eventData.addressItems.items.receiver, callbackContract: eventData.addressItems.items.callbackContract, - marketAddress: eventData.addressItems.items.market, + marketAddress: eventData.addressItems.items.glv, initialLongTokenAddress: eventData.addressItems.items.initialLongToken, initialShortTokenAddress: eventData.addressItems.items.initialShortToken, longTokenSwapPath: eventData.addressItems.arrayItems.longTokenSwapPath, shortTokenSwapPath: eventData.addressItems.arrayItems.shortTokenSwapPath, initialLongTokenAmount: eventData.uintItems.items.initialLongTokenAmount, initialShortTokenAmount: eventData.uintItems.items.initialShortTokenAmount, - minMarketTokens: eventData.uintItems.items.minMarketTokens, + minMarketTokens: eventData.uintItems.items.minGlvTokens, updatedAtBlock: eventData.uintItems.items.updatedAtBlock, executionFee: eventData.uintItems.items.executionFee, callbackGasLimit: eventData.uintItems.items.callbackGasLimit, shouldUnwrapNativeToken: eventData.boolItems.items.shouldUnwrapNativeToken, key: eventData.bytes32Items.items.key, + isGlvDeposit: true, }; if (depositData.account !== currentAccount) { @@ -312,6 +312,7 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) callbackGasLimit: eventData.uintItems.items.callbackGasLimit, shouldUnwrapNativeToken: eventData.boolItems.items.shouldUnwrapNativeToken, key: eventData.bytes32Items.items.key, + isGlvDeposit: false, }; if (depositData.account !== currentAccount) { @@ -370,7 +371,6 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) }, GlvDepositCancelled: (eventData: EventLogData, txnParams: EventTxnParams) => { - debugger; // eslint-disable-line const key = eventData.bytes32Items.items.key; if (depositStatuses[key]?.data) { @@ -419,6 +419,43 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) ); }, + GlvWithdrawalCreated: (eventData: EventLogData, txnParams: EventTxnParams) => { + const data: WithdrawalCreatedEventData = { + account: eventData.addressItems.items.account, + receiver: eventData.addressItems.items.receiver, + callbackContract: eventData.addressItems.items.callbackContract, + marketAddress: eventData.addressItems.items.glv, + marketTokenAmount: eventData.uintItems.items.glvTokenAmount, + minLongTokenAmount: eventData.uintItems.items.minLongTokenAmount, + minShortTokenAmount: eventData.uintItems.items.minShortTokenAmount, + updatedAtBlock: eventData.uintItems.items.updatedAtBlock, + executionFee: eventData.uintItems.items.executionFee, + callbackGasLimit: eventData.uintItems.items.callbackGasLimit, + shouldUnwrapNativeToken: eventData.boolItems.items.shouldUnwrapNativeToken, + key: eventData.bytes32Items.items.key, + }; + + if (data.account !== currentAccount) { + return; + } + + const metricId = getGMSwapMetricId({ + marketAddress: data.marketAddress, + executionFee: data.executionFee, + }); + + sendOrderCreatedMetric(metricId); + + setWithdrawalStatuses((old) => + setByKey(old, data.key, { + key: data.key, + data, + createdTxnHash: txnParams.transactionHash, + createdAt: Date.now(), + }) + ); + }, + WithdrawalExecuted: (eventData: EventLogData, txnParams: EventTxnParams) => { const key = eventData.bytes32Items.items.key; @@ -433,6 +470,19 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) } }, + GlvWithdrawalExecuted: (eventData: EventLogData, txnParams: EventTxnParams) => { + const key = eventData.bytes32Items.items.key; + if (withdrawalStatuses[key]?.data) { + const metricId = getGMSwapMetricId({ + marketAddress: withdrawalStatuses[key].data!.marketAddress, + executionFee: withdrawalStatuses[key].data!.executionFee, + }); + sendOrderExecutedMetric(metricId); + + setWithdrawalStatuses((old) => updateByKey(old, key, { executedTxnHash: txnParams.transactionHash })); + } + }, + WithdrawalCancelled: (eventData: EventLogData, txnParams: EventTxnParams) => { const key = eventData.bytes32Items.items.key; @@ -447,6 +497,20 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) } }, + GlvWithdrawalCancelled: (eventData: EventLogData, txnParams: EventTxnParams) => { + const key = eventData.bytes32Items.items.key; + + if (withdrawalStatuses[key]?.data) { + const metricId = getGMSwapMetricId({ + marketAddress: withdrawalStatuses[key].data!.marketAddress, + executionFee: withdrawalStatuses[key].data!.executionFee, + }); + sendOrderCancelledMetric(metricId, eventData); + + setWithdrawalStatuses((old) => updateByKey(old, key, { cancelledTxnHash: txnParams.transactionHash })); + } + }, + ShiftCreated: (eventData: EventLogData, txnParams: EventTxnParams) => { const data: ShiftCreatedEventData = { key: eventData.bytes32Items.items.key, @@ -726,7 +790,7 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) helperToast.success( , diff --git a/src/context/SyntheticsEvents/types.ts b/src/context/SyntheticsEvents/types.ts index be4e36ee71..8217b1977b 100644 --- a/src/context/SyntheticsEvents/types.ts +++ b/src/context/SyntheticsEvents/types.ts @@ -1,4 +1,4 @@ -import { OrderType, OrderTxnType } from "../../domain/synthetics/orders"; +import { OrderTxnType, OrderType } from "../../domain/synthetics/orders"; export type SyntheticsEventsContextType = { orderStatuses: OrderStatuses; @@ -87,6 +87,7 @@ export type DepositCreatedEventData = { executionFee: bigint; callbackGasLimit: bigint; shouldUnwrapNativeToken: boolean; + isGlvDeposit: boolean; }; export type PendingDepositData = { @@ -100,7 +101,7 @@ export type PendingDepositData = { initialShortTokenAmount: bigint; minMarketTokens: bigint; shouldUnwrapNativeToken: boolean; - isShift?: boolean; + isGlvDeposit: boolean; }; export type WithdrawalCreatedEventData = { diff --git a/src/context/SyntheticsEvents/utils.ts b/src/context/SyntheticsEvents/utils.ts index 4f0c995507..93c52ec3d8 100644 --- a/src/context/SyntheticsEvents/utils.ts +++ b/src/context/SyntheticsEvents/utils.ts @@ -15,6 +15,19 @@ export function getPendingOrderKey(data: Omit) { } export function getPendingDepositKey(data: PendingDepositData) { + if (data.isGlvDeposit) { + return [ + data.account, + data.marketAddress, + data.initialLongTokenAddress, + data.initialShortTokenAddress, + data.longTokenSwapPath.join("-"), + data.shortTokenSwapPath.join("-"), + data.shouldUnwrapNativeToken, + data.initialLongTokenAmount.toString(), + ].join(":"); + } + if (data.initialShortTokenAddress === data.initialLongTokenAddress) { return [ data.account, diff --git a/src/context/WebsocketContext/subscribeToEvents.ts b/src/context/WebsocketContext/subscribeToEvents.ts index 9cd059327b..6fd86e5710 100644 --- a/src/context/WebsocketContext/subscribeToEvents.ts +++ b/src/context/WebsocketContext/subscribeToEvents.ts @@ -167,6 +167,16 @@ function createV2EventFilters(chainId: number, account: string, wsProvider: Prov const EVENT_LOG_TOPIC = eventEmitter.interface.getEvent("EventLog")?.topicHash ?? null; const EVENT_LOG1_TOPIC = eventEmitter.interface.getEvent("EventLog1")?.topicHash ?? null; const EVENT_LOG2_TOPIC = eventEmitter.interface.getEvent("EventLog2")?.topicHash ?? null; + + const GLV_TOPICS_FILTER = [ + GLV_DEPOSIT_CREATED_HASH, + GLV_DEPOSIT_CANCELLED_HASH, + GLV_DEPOSIT_EXECUTED_HASH, + GLV_WITHDRAWAL_CREATED_HASH, + GLV_WITHDRAWAL_EXECUTED_HASH, + GLV_WITHDRAWAL_CANCELLED_HASH, + ]; + return [ // DEPOSITS AND WITHDRAWALS AND SHIFTS { @@ -226,19 +236,15 @@ function createV2EventFilters(chainId: number, account: string, wsProvider: Prov // GLV DEPOSITS { address: getContract(chainId, "EventEmitter"), - topics: [ - [EVENT_LOG_TOPIC, EVENT_LOG1_TOPIC, EVENT_LOG2_TOPIC], - [ - GLV_DEPOSIT_CREATED_HASH, - GLV_DEPOSIT_CANCELLED_HASH, - GLV_DEPOSIT_EXECUTED_HASH, - GLV_WITHDRAWAL_CREATED_HASH, - GLV_WITHDRAWAL_EXECUTED_HASH, - GLV_WITHDRAWAL_CANCELLED_HASH, - ], - null, - addressHash, - ], + topics: [EVENT_LOG_TOPIC, GLV_TOPICS_FILTER, null, addressHash], + }, + { + address: getContract(chainId, "EventEmitter"), + topics: [EVENT_LOG1_TOPIC, GLV_TOPICS_FILTER, null, addressHash], + }, + { + address: getContract(chainId, "EventEmitter"), + topics: [EVENT_LOG2_TOPIC, GLV_TOPICS_FILTER, null, addressHash], }, ]; } diff --git a/src/domain/synthetics/markets/createDepositTxn.ts b/src/domain/synthetics/markets/createDepositTxn.ts index b595187999..c10c3e4c46 100644 --- a/src/domain/synthetics/markets/createDepositTxn.ts +++ b/src/domain/synthetics/markets/createDepositTxn.ts @@ -12,7 +12,7 @@ import { applySlippageToMinOut } from "../trade"; import GlvRouter from "abis/GlvRouter.json"; -type Params = { +type CreateDepositParams = { account: string; initialLongTokenAddress: string; initialShortTokenAddress: string; @@ -31,7 +31,7 @@ type Params = { setPendingDeposit: SetPendingDeposit; }; -export async function createDepositTxn(chainId: number, signer: Signer, p: Params) { +export async function createDepositTxn(chainId: number, signer: Signer, p: CreateDepositParams) { const contract = new ethers.Contract(getContract(chainId, "ExchangeRouter"), ExchangeRouter.abi, signer); const depositVaultAddress = getContract(chainId, "DepositVault"); @@ -127,14 +127,14 @@ export async function createDepositTxn(chainId: number, signer: Signer, p: Param initialShortTokenAmount: p.shortTokenAmount, minMarketTokens: minMarketTokens, shouldUnwrapNativeToken, + isGlvDeposit: false, }); }); } -interface CreateGlvDepositParams extends Params { +interface CreateGlvDepositParams extends CreateDepositParams { market: string; isMarketTokenDeposit: boolean; - isShift: boolean; } export async function createGlvDepositTxn(chainId: number, signer: Signer, p: CreateGlvDepositParams) { @@ -221,6 +221,8 @@ export async function createGlvDepositTxn(chainId: number, signer: Signer, p: Cr }); } + debugger; // eslint-disable-line + return callContract(chainId, contract, "multicall", [encodedPayload], { value: wntAmount, hideSentMsg: true, @@ -229,17 +231,17 @@ export async function createGlvDepositTxn(chainId: number, signer: Signer, p: Cr setPendingTxns: p.setPendingTxns, }).then(() => { p.setPendingDeposit({ - isShift: p.isShift, account: p.account, marketAddress: p.marketTokenAddress, - initialLongTokenAddress, - initialShortTokenAddress, + initialLongTokenAddress: p.isMarketTokenDeposit ? ethers.ZeroAddress : initialLongTokenAddress, + initialShortTokenAddress: p.isMarketTokenDeposit ? ethers.ZeroAddress : initialShortTokenAddress, longTokenSwapPath: p.longTokenSwapPath, shortTokenSwapPath: p.shortTokenSwapPath, minMarketTokens: p.minMarketTokens, shouldUnwrapNativeToken, initialLongTokenAmount: p.longTokenAmount, initialShortTokenAmount: p.shortTokenAmount, + isGlvDeposit: true, }); }); } diff --git a/src/domain/synthetics/markets/createWithdrawalTxn.ts b/src/domain/synthetics/markets/createWithdrawalTxn.ts index 053484cf21..51f31e3937 100644 --- a/src/domain/synthetics/markets/createWithdrawalTxn.ts +++ b/src/domain/synthetics/markets/createWithdrawalTxn.ts @@ -173,7 +173,7 @@ export async function createGlvWithdrawalTxn(chainId: number, signer: Signer, p: }).then(() => { p.setPendingWithdrawal({ account: p.account, - marketAddress: p.marketTokenAddress, + marketAddress: p.glv, marketTokenAmount: p.marketTokenAmount, minLongTokenAmount, minShortTokenAmount, diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts index 643b7ce9ce..6d9030a5e4 100644 --- a/src/domain/synthetics/markets/glv.ts +++ b/src/domain/synthetics/markets/glv.ts @@ -41,7 +41,7 @@ export function getSellableInfoGlv( glv: GlvMarketInfo, marketsData: MarketsInfoData | undefined, tokensData: TokensData | undefined, - gmMarketAddress: string + gmMarketAddress?: string ) { const glvPriceUsd = glv.indexToken.prices.maxPrice; const amountUsd = values(glv.markets).reduce((acc, market) => { @@ -63,7 +63,8 @@ export function getSellableInfoGlv( return acc; } - const marketSellableUsd = getSellableMarketToken(gmMarket, gmMarketToken)?.totalUsd ?? 0n; + const marketSellableUsd = + gmMarket && gmMarket.indexToken.prices ? getSellableMarketToken(gmMarket, gmMarketToken)?.totalUsd ?? 0n : 0n; const gmBalanceUsd = convertToUsd(market.gmBalance, glv.indexToken.decimals, glvPriceUsd) ?? 0n; return acc + bigMath.min(marketSellableUsd, gmBalanceUsd); diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index 0640805138..6c36431bc3 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Erstellte Limit Order für {0} {1}: {2} USD!" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index df0b65d9de..d67e602e0e 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Created limit order for {0} {1}: {2} USD!" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "Use the \"Close\" button to reduce your Position Size." msgid "Increase Size (Limit)" msgstr "Increase Size (Limit)" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 82d02dea8f..0ac4afc142 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Orden límite creada para {0} {1}: {2} USD!" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 2159d80497..ffe048103c 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Ordre limite créé pour {0} {1}: {2} USD!" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 4c81aeb3dd..ceef9d49c0 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "{0} {1}: {2} USDの指値注文の作成完了!" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 269967447a..8ed19da18d 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "{0} {1}: {2} USD의 지정가 주문을 생성하였습니다!" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index 72cded7a48..17df8055da 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 45c407ec7e..c977d81323 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Создан лимитный ордер на {0} {1}: {2} USD!" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index ed2531b1c4..31f4264c47 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -453,8 +453,8 @@ msgid "Created limit order for {0} {1}: {2} USD!" msgstr "为{0} {1}: {2} USD!创建限量的指令" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx -msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" -msgstr "" +#~ msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>{0}: {toIndexName}{1}" +#~ msgstr "" #: src/pages/OrdersOverview/OrdersOverview.jsx msgid "Invalid token fromToken: \"{0}\" toToken: \"{toTokenAddress}\"" @@ -2533,6 +2533,10 @@ msgstr "" msgid "Increase Size (Limit)" msgstr "" +#: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx +msgid "Shifting from <0><1>GM: {fromIndexName}<2>[{fromPoolName}] to <3><4>GM: {toIndexName}{0}" +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "The order may not execute at the desired {priceText} as its acceptable price impact is set to {formattedOrderAcceptablePriceImpact}, which is lower than the current market price impact of {formattedCurrentAcceptablePriceImpact}. It can be edited using the \"Edit\" button." msgstr "" From 4b977100b753c4f9799c23e96b20de4bd0ca89d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 16:35:19 +0400 Subject: [PATCH 13/49] updates in glv --- .../MarketSelector/GmSelectorForGlv.tsx | 2 +- .../GmAssetDropdown/GmAssetDropdown.tsx | 2 +- .../Synthetics/GmList/MintableAmount.tsx | 2 +- .../GmDepositWithdrawalBox.tsx | 19 +++++--- .../GmDepositWithdrawalBox/InfoRows.tsx | 2 +- .../useDepositWithdrawalAmounts.tsx | 2 +- .../useDepositWithdrawalTransactions.tsx | 21 +++++---- .../GmDepositWithdrawalBox/useFees.tsx | 2 +- .../useSubmitButtonState.tsx | 4 +- .../GmSwapBox/GmShiftBox/GmShiftBox.tsx | 8 ++-- .../getShiftAvailableRelatedMarkets.tsx | 2 +- .../useRedirectToBuyOnShiftToGlv.tsx | 4 +- .../GmShiftBox/useShiftSubmitState.tsx | 4 +- .../GmShiftBox/useShiftTransactions.tsx | 12 +++--- .../Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx | 2 +- .../GmSwap/GmSwapBox/showMarketToast.tsx | 2 +- ...eDepositWithdrawalSetFirstTokenAddress.tsx | 4 +- .../GmSwapBox/useUpdateByQueryParams.tsx | 6 ++- .../MarketStatsWithComposition.tsx | 10 +++++ .../MarketStats/components/CompositionBar.tsx | 4 +- .../components/CompositionTable.tsx | 4 +- .../MarketStats/hooks/useBestGmPoolForGlv.ts | 43 +++++++++++++++++++ .../useMarketGlvGmMarketsCompositions.ts | 2 + src/config/contracts.ts | 2 +- src/config/localStorage.ts | 5 --- .../SyntheticsEventsProvider.tsx | 2 +- .../SyntheticsStateContextProvider.tsx | 2 +- src/domain/synthetics/markets/glv.ts | 24 +++++++++-- src/domain/synthetics/tokens/useGlvMarkets.ts | 15 +++---- src/locales/de/messages.po | 12 +++++- src/locales/en/messages.po | 12 +++++- src/locales/es/messages.po | 12 +++++- src/locales/fr/messages.po | 12 +++++- src/locales/ja/messages.po | 12 +++++- src/locales/ko/messages.po | 12 +++++- src/locales/pseudo/messages.po | 12 +++++- src/locales/ru/messages.po | 12 +++++- src/locales/zh/messages.po | 12 +++++- src/pages/MarketPoolsPage/MarketPoolsPage.tsx | 11 ++--- src/pages/Stake/StakeV2.tsx | 2 +- 40 files changed, 240 insertions(+), 94 deletions(-) create mode 100644 src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts diff --git a/src/components/MarketSelector/GmSelectorForGlv.tsx b/src/components/MarketSelector/GmSelectorForGlv.tsx index 6a68eb4b87..24403d774e 100644 --- a/src/components/MarketSelector/GmSelectorForGlv.tsx +++ b/src/components/MarketSelector/GmSelectorForGlv.tsx @@ -19,7 +19,7 @@ import TokenIcon from "components/TokenIcon/TokenIcon"; import Modal from "../Modal/Modal"; import { useGlvGmMarketsWithComposition } from "components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import "./MarketSelector.scss"; import { CommonPoolSelectorProps, MarketOption } from "./types"; diff --git a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx index 70f1bed1ea..0734f2b076 100644 --- a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx +++ b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx @@ -10,7 +10,7 @@ import { getIcon } from "config/icons"; import { MarketInfo, AllMarketsInfoData, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; import { TokenData, TokensData, getTokenData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { useChainId } from "lib/chains"; import { getByKey } from "lib/objects"; import useWallet, { WalletClient } from "lib/wallets/useWallet"; diff --git a/src/components/Synthetics/GmList/MintableAmount.tsx b/src/components/Synthetics/GmList/MintableAmount.tsx index f100a5bd83..c82457ec72 100644 --- a/src/components/Synthetics/GmList/MintableAmount.tsx +++ b/src/components/Synthetics/GmList/MintableAmount.tsx @@ -7,7 +7,7 @@ import { formatTokenAmount, formatTokenAmountWithUsd, formatUsd } from "lib/numb import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; import { TokenData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { TokenValuesInfoCell } from "./TokenValuesInfoCell"; export function MintableAmount({ diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx index d4da4e9fe6..6a4a7d3793 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -35,10 +35,10 @@ import { useGmDepositWithdrawalBoxState } from "./useGmDepositWithdrawalBoxState import { useUpdateInputAmounts } from "./useUpdateInputAmounts"; import { useUpdateTokens } from "./useUpdateTokens"; -import { ApproveTokenButton } from "@/components/ApproveTokenButton/ApproveTokenButton"; -import { getContract } from "@/config/contracts"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; -import { useHighExecutionFeeConsent } from "@/domain/synthetics/trade/useHighExecutionFeeConsent"; +import { ApproveTokenButton } from "components/ApproveTokenButton/ApproveTokenButton"; +import { getContract } from "config/contracts"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { useHighExecutionFeeConsent } from "domain/synthetics/trade/useHighExecutionFeeConsent"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import { PoolSelector } from "components/MarketSelector/PoolSelector"; @@ -51,6 +51,7 @@ import { Swap } from "../Swap"; import { InfoRows } from "./InfoRows"; import { useFees } from "./useFees"; import { useSubmitButtonState } from "./useSubmitButtonState"; +import { useBestGmPoolAddressForGlv } from "components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv"; export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: GlvMarketInfo }) { const { @@ -268,6 +269,14 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv [marketInfo, tokensData, isGlvMarket, marketTokensData, marketsInfoData, isPair] ); + const bestGmPoolAddress = useBestGmPoolAddressForGlv(isDeposit, marketInfo, selectedGlvGmMarket); + + useEffect(() => { + if (!selectedGlvGmMarket && bestGmPoolAddress) { + onSelectGlvGmMarket?.(bestGmPoolAddress); + } + }, [bestGmPoolAddress, onSelectGlvGmMarket, selectedGlvGmMarket]); + /** * Here and following we use `underlyingGmMarket` to get the correct market info for GLV markets * because we need to use actual GM market data to calculate fees, errors and so on, @@ -298,11 +307,11 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv isGlvMarket, marketInfo, marketsInfoData, - selectedGlvGmMarket, depositMarketTokensData, withdrawalMarketTokensData, marketTokenInputValue, isDeposit, + selectedGlvGmMarket, ]); const marketTokenUsd = isGlvMarket diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx index 7f2ac269ce..ae0fc73eed 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx @@ -17,7 +17,7 @@ import { PoolSelector } from "components/MarketSelector/PoolSelector"; import { GmFees } from "components/Synthetics/GmSwap/GmFees/GmFees"; import { NetworkFeeRow } from "components/Synthetics/NetworkFeeRow/NetworkFeeRow"; import { MarketInfo } from "domain/synthetics/markets"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { useCallback } from "react"; import { isGlv } from "../../../../../domain/synthetics/markets/glv"; import { HighPriceImpactRow } from "../HighPriceImpactRow"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx index f40fb864e3..7b4549694e 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx @@ -5,7 +5,7 @@ import { TokenData, TokensData } from "domain/synthetics/tokens"; import { getDepositAmounts } from "domain/synthetics/trade/utils/deposit"; import { getWithdrawalAmounts } from "domain/synthetics/trade/utils/withdrawal"; import { DepositAmounts, WithdrawalAmounts } from "domain/synthetics/trade/types"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; export function useDepositWithdrawalAmounts({ isDeposit, diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx index 1f5ac6d87c..eae113fe14 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx @@ -1,21 +1,21 @@ import { useCallback, useState } from "react"; -import { DEFAULT_SLIPPAGE_AMOUNT } from "@/config/factors"; -import { useSyntheticsEvents } from "@/context/SyntheticsEvents"; -import { selectChainId } from "@/context/SyntheticsStateContext/selectors/globalSelectors"; -import { useSelector } from "@/context/SyntheticsStateContext/utils"; -import { ExecutionFee } from "@/domain/synthetics/fees"; +import { DEFAULT_SLIPPAGE_AMOUNT } from "config/factors"; +import { useSyntheticsEvents } from "context/SyntheticsEvents"; +import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { ExecutionFee } from "domain/synthetics/fees"; import { createDepositTxn, createGlvDepositTxn, createGlvWithdrawalTxn, createWithdrawalTxn, MarketInfo, -} from "@/domain/synthetics/markets"; -import { TokenData, TokensData } from "@/domain/synthetics/tokens"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; -import { usePendingTxns } from "@/lib/usePendingTxns"; -import useWallet from "@/lib/wallets/useWallet"; +} from "domain/synthetics/markets"; +import { TokenData, TokensData } from "domain/synthetics/tokens"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { usePendingTxns } from "lib/usePendingTxns"; +import useWallet from "lib/wallets/useWallet"; import { Operation } from "../types"; @@ -102,7 +102,6 @@ export const useDepositWithdrawalTransactions = ({ setPendingTxns, setPendingDeposit, isMarketTokenDeposit: isMarketTokenDeposit ?? false, - isShift: false, }); } diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx index ffe7599b91..0c5e59f628 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx @@ -1,6 +1,6 @@ import { useMemo } from "react"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { estimateExecuteDepositGasLimit, estimateExecuteGlvDepositGasLimit, diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx index 7e2e47823a..163fcf85e6 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx @@ -1,4 +1,4 @@ -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { plural, t } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; @@ -21,7 +21,7 @@ import { Operation } from "../types"; import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; import { useDepositWithdrawalTransactions } from "./useDepositWithdrawalTransactions"; import { useFees } from "./useFees"; -import { getSellableInfoGlv } from "@/domain/synthetics/markets/glv"; +import { getSellableInfoGlv } from "domain/synthetics/markets/glv"; interface Props { amounts: ReturnType; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx index ef28a93fba..f7bee151b0 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx @@ -29,10 +29,10 @@ import { useShiftSubmitState } from "./useShiftSubmitState"; import { useUpdateMarkets } from "./useUpdateMarkets"; import { useUpdateTokens } from "./useUpdateTokens"; -import { ApproveTokenButton } from "@/components/ApproveTokenButton/ApproveTokenButton"; -import { getContract } from "@/config/contracts"; -import { getTokenData } from "@/domain/synthetics/tokens"; -import { useHighExecutionFeeConsent } from "@/domain/synthetics/trade/useHighExecutionFeeConsent"; +import { ApproveTokenButton } from "components/ApproveTokenButton/ApproveTokenButton"; +import { getContract } from "config/contracts"; +import { getTokenData } from "domain/synthetics/tokens"; +import { useHighExecutionFeeConsent } from "domain/synthetics/trade/useHighExecutionFeeConsent"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import { ExchangeInfo } from "components/Exchange/ExchangeInfo"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx index 15231422b6..27db5c6a54 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/getShiftAvailableRelatedMarkets.tsx @@ -1,4 +1,4 @@ -import { isGlv } from "@/domain/synthetics/markets/glv"; +import { isGlv } from "domain/synthetics/markets/glv"; import type { AllMarketsInfoData, MarketInfo } from "domain/synthetics/markets/types"; import { EMPTY_ARRAY } from "lib/objects"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx index 59f239906c..1fab2e3efc 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useRedirectToBuyOnShiftToGlv.tsx @@ -2,8 +2,8 @@ import { useEffect } from "react"; import type { MarketInfo } from "domain/synthetics/markets/types"; -import { isGlv } from "@/domain/synthetics/markets/glv"; -import { usePrevious } from "@/lib/usePrevious"; +import { isGlv } from "domain/synthetics/markets/glv"; +import { usePrevious } from "lib/usePrevious"; import { Operation } from "../types"; /** diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx index 129bbf8f7d..1319624fe2 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -3,8 +3,8 @@ import { useConnectModal } from "@rainbow-me/rainbowkit"; import uniq from "lodash/uniq"; import { useMemo } from "react"; -import { ExecutionFee } from "@/domain/synthetics/fees"; -import { getNeedTokenApprove, getTokenData, useTokensAllowanceData } from "@/domain/synthetics/tokens"; +import { ExecutionFee } from "domain/synthetics/fees"; +import { getNeedTokenApprove, getTokenData, useTokensAllowanceData } from "domain/synthetics/tokens"; import { useHasOutdatedUi } from "domain/legacy"; import type { MarketInfo } from "domain/synthetics/markets/types"; import type { TokenData, TokensData } from "domain/synthetics/tokens/types"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftTransactions.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftTransactions.tsx index 2fc50a16ef..1d11fb96a3 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftTransactions.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftTransactions.tsx @@ -1,11 +1,11 @@ import { useCallback, useState } from "react"; -import { DEFAULT_SLIPPAGE_AMOUNT } from "@/config/factors"; -import { useSyntheticsEvents } from "@/context/SyntheticsEvents"; -import { ExecutionFee } from "@/domain/synthetics/fees"; -import { createShiftTxn } from "@/domain/synthetics/markets/createShiftTxn"; -import { usePendingTxns } from "@/lib/usePendingTxns"; -import useWallet from "@/lib/wallets/useWallet"; +import { DEFAULT_SLIPPAGE_AMOUNT } from "config/factors"; +import { useSyntheticsEvents } from "context/SyntheticsEvents"; +import { ExecutionFee } from "domain/synthetics/fees"; +import { createShiftTxn } from "domain/synthetics/markets/createShiftTxn"; +import { usePendingTxns } from "lib/usePendingTxns"; +import useWallet from "lib/wallets/useWallet"; import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import type { TokenData, TokensData } from "domain/synthetics/tokens/types"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx index d07e264df4..0e4c0ac601 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx @@ -14,7 +14,7 @@ import { GmShiftBox } from "./GmShiftBox/GmShiftBox"; import { selectAllMarketsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { isGlv } from "domain/synthetics/markets/glv"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { GmSwapBoxDepositWithdrawal } from "./GmDepositWithdrawalBox/GmDepositWithdrawalBox"; import "./GmSwapBox.scss"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx index c13eb04a87..af823e7c1a 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/showMarketToast.tsx @@ -1,4 +1,4 @@ -import { MarketInfo } from "@/domain/synthetics/markets"; +import { MarketInfo } from "domain/synthetics/markets"; import { Trans } from "@lingui/macro"; import { getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets/utils"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx index aabc1ee309..dc364aa900 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/useDepositWithdrawalSetFirstTokenAddress.tsx @@ -1,5 +1,5 @@ -import { SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY } from "@/config/localStorage"; -import { useLocalStorageSerializeKey } from "@/lib/localStorage"; +import { SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY } from "config/localStorage"; +import { useLocalStorageSerializeKey } from "lib/localStorage"; import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx index 7e6539df17..f6b92146d2 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx @@ -116,9 +116,11 @@ export function useUpdateByQueryParams({ setOperation(Operation.Deposit); } - if (pool && isGlvMarket && setFirstTokenAddress && onSelectGlvGmMarket) { + if (pool && isGlvMarket && setFirstTokenAddress) { setFirstTokenAddress(pool); - onSelectGlvGmMarket(pool); + onSelectGlvGmMarket?.(pool); + } else { + onSelectGlvGmMarket?.(undefined); } } } diff --git a/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx index ac3982b6fe..7203d28bef 100644 --- a/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +++ b/src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx @@ -349,6 +349,16 @@ export function MarketStatsWithComposition(p: Props) { } position="bottom-end" renderContent={() => { + if (isGlvMarket) { + return ( +
+ + GLV token pricing is affected by the underlying GM tokens it is composed of and their prices. + +
+ ); + } + return (
diff --git a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx index baa38e4414..e46a5fda79 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx @@ -2,11 +2,11 @@ import { useMemo } from "react"; import { TOKEN_COLOR_MAP } from "config/tokens"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { getPoolUsdWithoutPnl, MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; -import { bigintToNumber } from "@/lib/numbers"; +import { bigintToNumber } from "lib/numbers"; interface CompositionBarProps { marketInfo?: MarketInfo | GlvMarketInfo; diff --git a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx index d8bd53f224..f442e56a1a 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx @@ -10,12 +10,12 @@ import { useSelector } from "context/SyntheticsStateContext/utils"; import { getPoolUsdWithoutPnl, MarketInfo } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; import { TokenData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { getMarketIndexName } from "../../../../domain/synthetics/markets/utils"; import { ExchangeTd, ExchangeTh, ExchangeTheadTr, ExchangeTr } from "../../OrderList/ExchangeTable"; import { useGlvGmMarketsWithComposition } from "../hooks/useMarketGlvGmMarketsCompositions"; -import { USD_DECIMALS } from "@/config/factors"; +import { USD_DECIMALS } from "config/factors"; interface CompositionTableGmProps { marketInfo?: MarketInfo | GlvMarketInfo; diff --git a/src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts b/src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts new file mode 100644 index 0000000000..850a7f376b --- /dev/null +++ b/src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts @@ -0,0 +1,43 @@ +import { MarketInfo } from "domain/synthetics/markets"; +import { getMaxUsdBuyableAmountInMarketWithGm, isGlv } from "domain/synthetics/markets/glv"; +import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { useGlvGmMarketsWithComposition } from "./useMarketGlvGmMarketsCompositions"; +import { useMemo } from "react"; + +export const useBestGmPoolAddressForGlv = ( + isDeposit: boolean, + glvMarket?: MarketInfo | GlvMarketInfo, + selectedGmPoolAddress?: string +) => { + const poolsWithComposition = useGlvGmMarketsWithComposition(isDeposit, glvMarket?.indexTokenAddress); + + return useMemo(() => { + if (!glvMarket || !isGlv(glvMarket) || poolsWithComposition.length === 0) { + return undefined; + } + + if (selectedGmPoolAddress) { + return selectedGmPoolAddress; + } + + const glvPrice = glvMarket.indexToken.prices.maxPrice; + + for (const market of poolsWithComposition.sort((a, b) => { + return b.comp - a.comp; + })) { + const vailableBuyableGmUsd = getMaxUsdBuyableAmountInMarketWithGm( + glvPrice, + market.gmMarket, + glvMarket, + market.pool, + market.token + ); + + if (vailableBuyableGmUsd > 0) { + return market.pool.marketTokenAddress; + } + } + + return poolsWithComposition[0].pool.marketTokenAddress; + }, [glvMarket, poolsWithComposition, selectedGmPoolAddress]); +}; diff --git a/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts b/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts index 76993b5fca..dc39ab0e84 100644 --- a/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts +++ b/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts @@ -37,7 +37,9 @@ export const useGlvGmMarketsWithComposition = (isDeposit: boolean, glvAddress?: return { amount: market.gmBalance, + gmMarket: market, pool: gmMarket, + token: token, tvl: [ (market.gmBalance * token.prices.maxPrice) / 10n ** BigInt(token.decimals), getMaxUsdBuyableAmountInMarket(glv.indexToken.prices.maxPrice, market, glv), diff --git a/src/config/contracts.ts b/src/config/contracts.ts index c23f8466fc..f740c9e373 100644 --- a/src/config/contracts.ts +++ b/src/config/contracts.ts @@ -3,7 +3,7 @@ import { DataStore__factory } from "typechain-types/factories/DataStore__factory import { ExchangeRouter__factory } from "typechain-types/factories/ExchangeRouter__factory"; import { Multicall__factory } from "typechain-types/factories/Multicall__factory"; import { ARBITRUM, ARBITRUM_GOERLI, AVALANCHE, AVALANCHE_FUJI, BSС_MAINNET, BSС_TESTNET } from "./chains"; -import { GlvRouter__factory } from "@/typechain-types"; +import { GlvRouter__factory } from "typechain-types"; const { ZeroAddress } = ethers; diff --git a/src/config/localStorage.ts b/src/config/localStorage.ts index fb8a07c300..4c9146ded7 100644 --- a/src/config/localStorage.ts +++ b/src/config/localStorage.ts @@ -30,7 +30,6 @@ export const SYNTHETICS_TRADE_OPTIONS = "synthetics-trade-options"; export const SYNTHETICS_ACCEPTABLE_PRICE_IMPACT_BUFFER_KEY = "synthetics-acceptable-price-impact-buffer"; export const SYNTHETICS_DEPOSIT_INDEX_TOKEN_KEY = "synthetics-deposit-index-token"; export const SYNTHETICS_DEPOSIT_MARKET_KEY = "synthetics-market-deposit-market"; -export const SYNTHETICS_DEPOSIT_MARKET_GLV_KEY = "synthetics-market-glv-deposit-market"; export const SYNTHETICS_GLV_MARKET_DEPOSIT_TOKEN_KEY = "synthetics-glv-market-deposit-token"; export const SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY = "synthetics-market-deposit-token"; @@ -70,10 +69,6 @@ export function getSyntheticsDepositMarketKey(chainId: number) { return [chainId, SYNTHETICS_DEPOSIT_MARKET_KEY]; } -export function getSyntheticsDepositGlvMarketKey(chainId: number) { - return [chainId, SYNTHETICS_DEPOSIT_MARKET_GLV_KEY]; -} - export function getSyntheticsListSectionKey(chainId: number) { return [chainId, SYNTHETICS_LIST_SECTION_KEY]; } diff --git a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx index 229bdf1183..145ec841ba 100644 --- a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx +++ b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx @@ -57,7 +57,7 @@ import { WithdrawalCreatedEventData, WithdrawalStatuses, } from "./types"; -import { useGlvMarketsInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { useGlvMarketsInfo } from "domain/synthetics/tokens/useGlvMarkets"; export const SyntheticsEventsContext = createContext({}); diff --git a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx index 13052c5970..7658050e8f 100644 --- a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx +++ b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx @@ -21,7 +21,7 @@ import { usePositionsInfoRequest, } from "domain/synthetics/positions"; import { TokensData } from "domain/synthetics/tokens"; -import { useGlvMarketsInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { useGlvMarketsInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { ConfirmationBoxState, useConfirmationBoxState } from "domain/synthetics/trade/useConfirmationBoxState"; import { PositionEditorState, usePositionEditorState } from "domain/synthetics/trade/usePositionEditorState"; import { PositionSellerState, usePositionSellerState } from "domain/synthetics/trade/usePositionSellerState"; diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts index 6d9030a5e4..005471b828 100644 --- a/src/domain/synthetics/markets/glv.ts +++ b/src/domain/synthetics/markets/glv.ts @@ -1,12 +1,30 @@ import values from "lodash/values"; -import { getSellableMarketToken, MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; -import { GlvMarket, GlvMarketInfo } from "@/domain/synthetics/tokens/useGlvMarkets"; +import { + getMintableMarketTokens, + getSellableMarketToken, + MarketInfo, + MarketsInfoData, +} from "domain/synthetics/markets"; +import { GlvMarket, GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; import { bigMath } from "lib/bigmath"; import { convertToUsd } from "../tokens/utils"; -import { TokensData } from "../tokens"; +import { TokenData, TokensData } from "../tokens"; + +export function getMaxUsdBuyableAmountInMarketWithGm( + glvPriceUsd: bigint, + market: GlvMarket, + glv: GlvMarketInfo, + gmMarketInfo: MarketInfo, + gmMarketToken: TokenData +) { + const mintableInGmMarket = getMintableMarketTokens(gmMarketInfo, gmMarketToken); + const maxUsdInGmGlv = getMaxUsdBuyableAmountInMarket(glvPriceUsd, market, glv); + + return bigMath.min(mintableInGmMarket?.mintableUsd, maxUsdInGmGlv); +} export function getMaxUsdBuyableAmountInMarket(glvPriceUsd: bigint, market: GlvMarket, glv: GlvMarketInfo) { const gmBalanceUsd = convertToUsd(market.gmBalance, glv.indexToken.decimals, glvPriceUsd) ?? 0n; diff --git a/src/domain/synthetics/tokens/useGlvMarkets.ts b/src/domain/synthetics/tokens/useGlvMarkets.ts index 55485858e0..135f1e7aa6 100644 --- a/src/domain/synthetics/tokens/useGlvMarkets.ts +++ b/src/domain/synthetics/tokens/useGlvMarkets.ts @@ -160,10 +160,6 @@ export function useGlvMarketsInfo( contractAddress: glv.glvToken, abi: TokenAbi.abi, calls: { - totalSupply: { - methodName: "totalSupply", - params: [], - }, balance: { methodName: "balanceOf", params: [account], @@ -238,13 +234,16 @@ export function useGlvMarketsInfo( glvs.forEach(({ glv, markets }) => { const pricesMax = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; const pricesMin = data[glv.glvToken + "-prices"].glvTokenPriceMax.returnValues; - const [priceMin, totalSupply] = pricesMax; + const [priceMin, , totalSupply] = pricesMax; const [priceMax] = pricesMin; const glvName = getGlvMarketName(chainId, glv.glvToken); const tokenConfig = getTokenBySymbol(chainId, "GLV"); + const balance = data[glv.glvToken + "-tokenData"].balance.returnValues[0]; + const contractSymbol = data[glv.glvToken + "-tokenData"].symbol.returnValues[0]; + const indexToken: TokenData & { contractSymbol: string; } = { @@ -254,9 +253,9 @@ export function useGlvMarketsInfo( minPrice: priceMin, maxPrice: priceMax, }, - totalSupply: totalSupply, - balance: data[glv.glvToken + "-tokenData"].balance.returnValues[0], - contractSymbol: data[glv.glvToken + "-tokenData"].symbol.returnValues[0], + totalSupply, + balance, + contractSymbol, }; result[glv.glvToken] = { diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index eb9918711f..190382ed41 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "Rabatte insgesamt" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "NETTO-RATE / 1 H" msgid "Vest with GMX on Avalanche" msgstr "Vesting mit GMX auf Avalanche" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "Reduzierungsanfrage {0} {longOrShortText}, -{1} USD, Akzeptabler Preis: {2} {3} USD" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index 842185eb2e..de48ed6996 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "<0>Delegate your undelegated {0} GMX DAO<1> voting power before staking." #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "Shift GM Tokens between eligible pools without paying buy/sell fees." #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "Total Rebates" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "Min order: {0}" @@ -2285,6 +2289,10 @@ msgstr "NET RATE / 1 H" msgid "Vest with GMX on Avalanche" msgstr "Vest with GMX on Avalanche" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "GLV Vaults include multiple GM Tokens and are automatically rebalanced." + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 3e72a90c87..f49565adbf 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "Total de Reembolsos" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "NETO TASA / 1 H" msgid "Vest with GMX on Avalanche" msgstr "Adquiera con GMX en Avalanche" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "Solicitar reducción {0} {longOrShortText}, -{1} USD, Precio Aceptable: {2} {3} USD" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 53803b3a90..929e20fb1f 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "Remise totale" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "TAUX NET / 1 H" msgid "Vest with GMX on Avalanche" msgstr "Vester avec GMX sur Avalanche" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "Demander une réduction {0} {longOrShortText}, -{1} USD, Prix acceptable: {2} {3} USD" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index c571b027c9..8685963e66 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "リベート総額" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "1時間あたりのネットレート" msgid "Vest with GMX on Avalanche" msgstr "AvalancheでGMXを使ってべスティングする" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "{0} {longOrShortText} の減額をリクエスト -{1} USD 可能な価格: {2} {3} USD" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 912893987b..b725ab4f11 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "총 소개 보수" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "1시간 당 순 수수료율" msgid "Vest with GMX on Avalanche" msgstr "Avalanche에서 GMX로 베스팅하기" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "{0} {longOrShortText} 감소 요청, -{1} USD, 허용가능한 가격: {2} {3} USD" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index 50203e52ad..86c39132c4 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "" msgid "Vest with GMX on Avalanche" msgstr "" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 5eacd00cea..540bab75cf 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "Всего Ребайтов" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "ЧИСТАЯ СТАВКА / 1 Ч" msgid "Vest with GMX on Avalanche" msgstr "Вестинг GMX на Avalanche" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "Уменьшение запроса {0} {longOrShortText}, -{1} USD, Приемлемая Цена: {2} {3} USD" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index cbe7a367e2..8cd5e48c4a 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -msgstr "" +#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +#~ msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -1167,6 +1167,10 @@ msgstr "返利总额" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/MarketStats/MarketStatsWithComposition.tsx +msgid "GLV token pricing is affected by the underlying GM tokens it is composed of and their prices." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -2285,6 +2289,10 @@ msgstr "净率/1小时" msgid "Vest with GMX on Avalanche" msgstr "在Avalanche上授权GMX" +#: src/pages/MarketPoolsPage/MarketPoolsPage.tsx +msgid "GLV Vaults include multiple GM Tokens and are automatically rebalanced." +msgstr "" + #: src/components/Exchange/TradeHistory.jsx msgid "Request decrease {0} {longOrShortText}, -{1} USD, Acceptable Price: {2} {3} USD" msgstr "要求减少 {0} {longOrShortText}, -{1} USD, 可接受的价格: {2} {3} USD" diff --git a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx index d396b884f4..a4fff04f0d 100644 --- a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx +++ b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx @@ -2,7 +2,7 @@ import { Trans } from "@lingui/macro"; import { useEffect, useRef, useState } from "react"; import { Mode, Operation } from "components/Synthetics/GmSwap/GmSwapBox/types"; -import { getSyntheticsDepositGlvMarketKey, getSyntheticsDepositMarketKey } from "config/localStorage"; +import { getSyntheticsDepositMarketKey } from "config/localStorage"; import { selectAllMarketsData, selectDepositMarketTokensData, @@ -16,7 +16,6 @@ import { getPageTitle } from "lib/legacy"; import { useLocalStorageSerializeKey } from "lib/localStorage"; import { getByKey } from "lib/objects"; -import { GmList } from "@/components/Synthetics/GmList/GmList"; import SEO from "components/Common/SEO"; import ExternalLink from "components/ExternalLink/ExternalLink"; import Footer from "components/Footer/Footer"; @@ -26,6 +25,7 @@ import { GmSwapBox } from "components/Synthetics/GmSwap/GmSwapBox/GmSwapBox"; import { MarketStatsWithComposition } from "components/Synthetics/MarketStats/MarketStatsWithComposition"; import "./MarketPoolsPage.scss"; +import { GmList } from "components/Synthetics/GmList/GmList"; export function MarketPoolsPage() { const { chainId } = useChainId(); @@ -47,10 +47,7 @@ export function MarketPoolsPage() { undefined ); - const [selectedGlvGmMarketKey, setSelectedGlvGmMarketKey] = useLocalStorageSerializeKey( - getSyntheticsDepositGlvMarketKey(chainId), - undefined - ); + const [selectedGlvGmMarketKey, setSelectedGlvGmMarketKey] = useState(undefined); useEffect(() => { const newAvailableModes = getGmSwapBoxAvailableModes(operation, getByKey(marketsInfoData, selectedMarketGmKey)); @@ -80,7 +77,7 @@ export function MarketPoolsPage() { to earn fees from swaps and leverage trading.
- Shift GM Tokens between eligible pools without paying buy/sell fees. + GLV Vaults include multiple GM Tokens and are automatically rebalanced. } qa="pools-page" diff --git a/src/pages/Stake/StakeV2.tsx b/src/pages/Stake/StakeV2.tsx index e675d61f1d..7387a07723 100644 --- a/src/pages/Stake/StakeV2.tsx +++ b/src/pages/Stake/StakeV2.tsx @@ -84,7 +84,7 @@ import useIsMetamaskMobile from "lib/wallets/useIsMetamaskMobile"; import useWallet from "lib/wallets/useWallet"; import "./StakeV2.css"; import { GMX_DAO_LINKS, getGmxDAODelegateLink } from "./constants"; -import { GmList } from "@/components/Synthetics/GmList/GmList"; +import { GmList } from "components/Synthetics/GmList/GmList"; const { ZeroAddress } = ethers; From 156fb82eba45b9fea8d4a8d1a2c12c465d631230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 18:13:06 +0400 Subject: [PATCH 14/49] file rearrangements --- .../MarketSelector/GmSelectorForGlv.tsx | 2 +- .../GmAssetDropdown/GmAssetDropdown.tsx | 2 +- .../Synthetics/GmList/MintableAmount.tsx | 2 +- .../GmDepositWithdrawalBox.tsx | 37 +++++++--- .../GmDepositWithdrawalBox/InfoRows.tsx | 2 +- .../useDepositWithdrawalAmounts.tsx | 2 +- .../useDepositWithdrawalTransactions.tsx | 2 +- .../GmDepositWithdrawalBox/useFees.tsx | 2 +- .../useSubmitButtonState.tsx | 8 +- .../Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx | 2 +- .../MarketStats/components/CompositionBar.tsx | 2 +- .../components/CompositionTable.tsx | 2 +- .../MarketStats/hooks/useBestGmPoolForGlv.ts | 2 +- .../TradeHistoryRow/utils/swap.ts | 3 +- .../SyntheticsEventsProvider.tsx | 2 +- .../SyntheticsStateContextProvider.tsx | 2 +- src/domain/synthetics/markets/glv.ts | 2 +- src/domain/synthetics/markets/types.ts | 2 +- .../{tokens => markets}/useGlvMarkets.ts | 4 +- .../synthetics/markets/useMarketTokensData.ts | 2 +- src/domain/synthetics/markets/utils.ts | 2 +- src/domain/synthetics/testUtils/mocks.ts | 3 +- .../synthetics/tokens/useTokensDataRequest.ts | 3 +- src/domain/synthetics/trade/utils/deposit.ts | 2 +- .../synthetics/trade/utils/validation.ts | 73 +++++++++++-------- .../synthetics/trade/utils/withdrawal.ts | 2 +- src/locales/de/messages.po | 24 ++++-- src/locales/en/messages.po | 24 ++++-- src/locales/es/messages.po | 24 ++++-- src/locales/fr/messages.po | 24 ++++-- src/locales/ja/messages.po | 24 ++++-- src/locales/ko/messages.po | 24 ++++-- src/locales/pseudo/messages.po | 24 ++++-- src/locales/ru/messages.po | 24 ++++-- src/locales/zh/messages.po | 24 ++++-- 35 files changed, 273 insertions(+), 112 deletions(-) rename src/domain/synthetics/{tokens => markets}/useGlvMarkets.ts (99%) diff --git a/src/components/MarketSelector/GmSelectorForGlv.tsx b/src/components/MarketSelector/GmSelectorForGlv.tsx index 24403d774e..ba62cfaa5e 100644 --- a/src/components/MarketSelector/GmSelectorForGlv.tsx +++ b/src/components/MarketSelector/GmSelectorForGlv.tsx @@ -19,7 +19,7 @@ import TokenIcon from "components/TokenIcon/TokenIcon"; import Modal from "../Modal/Modal"; import { useGlvGmMarketsWithComposition } from "components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import "./MarketSelector.scss"; import { CommonPoolSelectorProps, MarketOption } from "./types"; diff --git a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx index 0734f2b076..fb9e1c2778 100644 --- a/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx +++ b/src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx @@ -10,7 +10,7 @@ import { getIcon } from "config/icons"; import { MarketInfo, AllMarketsInfoData, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; import { TokenData, TokensData, getTokenData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { useChainId } from "lib/chains"; import { getByKey } from "lib/objects"; import useWallet, { WalletClient } from "lib/wallets/useWallet"; diff --git a/src/components/Synthetics/GmList/MintableAmount.tsx b/src/components/Synthetics/GmList/MintableAmount.tsx index c82457ec72..6f8ac844e4 100644 --- a/src/components/Synthetics/GmList/MintableAmount.tsx +++ b/src/components/Synthetics/GmList/MintableAmount.tsx @@ -7,7 +7,7 @@ import { formatTokenAmount, formatTokenAmountWithUsd, formatUsd } from "lib/numb import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; import { TokenData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { TokenValuesInfoCell } from "./TokenValuesInfoCell"; export function MintableAmount({ diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx index 6a4a7d3793..208a6c19d6 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -37,7 +37,7 @@ import { useUpdateTokens } from "./useUpdateTokens"; import { ApproveTokenButton } from "components/ApproveTokenButton/ApproveTokenButton"; import { getContract } from "config/contracts"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { useHighExecutionFeeConsent } from "domain/synthetics/trade/useHighExecutionFeeConsent"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; @@ -52,6 +52,7 @@ import { InfoRows } from "./InfoRows"; import { useFees } from "./useFees"; import { useSubmitButtonState } from "./useSubmitButtonState"; import { useBestGmPoolAddressForGlv } from "components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv"; +import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: GlvMarketInfo }) { const { @@ -686,6 +687,29 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv }; }, [firstTokenAddress, marketTokensData, marketsInfoData]); + const submitButton = useMemo(() => { + const btn = ( + + ); + + if (submitState.errorDescription) { + return ( + + {btn} + + ); + } + + return btn; + }, [submitState]); + return ( <>
@@ -818,16 +842,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps & { glvMarket?: Glv
{highExecutionFeeAcknowledgement}
) : null} -
- -
+
{submitButton}
); diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx index ae0fc73eed..bef4e9c00c 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/InfoRows.tsx @@ -17,7 +17,7 @@ import { PoolSelector } from "components/MarketSelector/PoolSelector"; import { GmFees } from "components/Synthetics/GmSwap/GmFees/GmFees"; import { NetworkFeeRow } from "components/Synthetics/NetworkFeeRow/NetworkFeeRow"; import { MarketInfo } from "domain/synthetics/markets"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { useCallback } from "react"; import { isGlv } from "../../../../../domain/synthetics/markets/glv"; import { HighPriceImpactRow } from "../HighPriceImpactRow"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx index 7b4549694e..6b094b4523 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalAmounts.tsx @@ -5,7 +5,7 @@ import { TokenData, TokensData } from "domain/synthetics/tokens"; import { getDepositAmounts } from "domain/synthetics/trade/utils/deposit"; import { getWithdrawalAmounts } from "domain/synthetics/trade/utils/withdrawal"; import { DepositAmounts, WithdrawalAmounts } from "domain/synthetics/trade/types"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; export function useDepositWithdrawalAmounts({ isDeposit, diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx index eae113fe14..3e0458d488 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx @@ -13,7 +13,7 @@ import { MarketInfo, } from "domain/synthetics/markets"; import { TokenData, TokensData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { usePendingTxns } from "lib/usePendingTxns"; import useWallet from "lib/wallets/useWallet"; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx index 0c5e59f628..aaffdafac2 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useFees.tsx @@ -1,6 +1,6 @@ import { useMemo } from "react"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { estimateExecuteDepositGasLimit, estimateExecuteGlvDepositGasLimit, diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx index 163fcf85e6..d487dbaf5f 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx @@ -1,4 +1,4 @@ -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { plural, t } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; @@ -172,7 +172,7 @@ export const useSubmitButtonState = ({ ? getSellableInfoGlv(vaultInfo, marketsInfoData, marketTokensData, selectedGlvGmMarket) : undefined; - const swapError = getGmSwapError({ + const [swapError, swapErrorDescription] = getGmSwapError({ isDeposit, marketInfo, vaultInfo, @@ -192,7 +192,7 @@ export const useSubmitButtonState = ({ isHighPriceImpactAccepted, priceImpactUsd: fees?.swapPriceImpact?.deltaUsd, vaultSellableAmount: vaultSellableAmount?.totalAmount, - })[0]; + }); const error = commonError || swapError; @@ -281,6 +281,7 @@ export const useSubmitButtonState = ({ disabled: !shouldDisableValidation, onClick: onSubmit, tokensToApprove, + errorDescription: swapErrorDescription, }; } @@ -340,5 +341,6 @@ export const useSubmitButtonState = ({ payTokenAddresses.length, isGlv, isHighFeeConsentError, + swapErrorDescription, ]); }; diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx index 0e4c0ac601..28f70e6d13 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx @@ -14,7 +14,7 @@ import { GmShiftBox } from "./GmShiftBox/GmShiftBox"; import { selectAllMarketsData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { isGlv } from "domain/synthetics/markets/glv"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { GmSwapBoxDepositWithdrawal } from "./GmDepositWithdrawalBox/GmDepositWithdrawalBox"; import "./GmSwapBox.scss"; diff --git a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx index e46a5fda79..18b6c15ed4 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionBar.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionBar.tsx @@ -2,7 +2,7 @@ import { useMemo } from "react"; import { TOKEN_COLOR_MAP } from "config/tokens"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { getPoolUsdWithoutPnl, MarketInfo, MarketsInfoData } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; diff --git a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx index f442e56a1a..1f9504b7ea 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx @@ -10,7 +10,7 @@ import { useSelector } from "context/SyntheticsStateContext/utils"; import { getPoolUsdWithoutPnl, MarketInfo } from "domain/synthetics/markets"; import { isGlv } from "domain/synthetics/markets/glv"; import { TokenData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { getMarketIndexName } from "../../../../domain/synthetics/markets/utils"; import { ExchangeTd, ExchangeTh, ExchangeTheadTr, ExchangeTr } from "../../OrderList/ExchangeTable"; diff --git a/src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts b/src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts index 850a7f376b..4bc9b70dbe 100644 --- a/src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts +++ b/src/components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv.ts @@ -1,6 +1,6 @@ import { MarketInfo } from "domain/synthetics/markets"; import { getMaxUsdBuyableAmountInMarketWithGm, isGlv } from "domain/synthetics/markets/glv"; -import { GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { useGlvGmMarketsWithComposition } from "./useMarketGlvGmMarketsCompositions"; import { useMemo } from "react"; diff --git a/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/swap.ts b/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/swap.ts index e3671d55b8..5597a22db0 100644 --- a/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/swap.ts +++ b/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/swap.ts @@ -3,7 +3,8 @@ import { t } from "@lingui/macro"; import type { MarketInfo, MarketsInfoData } from "domain/synthetics/markets/types"; import { getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets/utils"; import { OrderType } from "domain/synthetics/orders"; -import { TokenData, adaptToV1TokenInfo, getTokensRatioByAmounts } from "domain/synthetics/tokens"; +import type { TokenData } from "domain/synthetics/tokens"; +import { adaptToV1TokenInfo, getTokensRatioByAmounts } from "domain/synthetics/tokens/utils"; import { SwapTradeAction, TradeActionType } from "domain/synthetics/tradeHistory/types"; import type { Token, TokenInfo } from "domain/tokens/types"; import { getExchangeRateDisplay } from "lib/legacy"; diff --git a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx index 145ec841ba..3cadf62054 100644 --- a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx +++ b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx @@ -57,7 +57,7 @@ import { WithdrawalCreatedEventData, WithdrawalStatuses, } from "./types"; -import { useGlvMarketsInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { useGlvMarketsInfo } from "domain/synthetics/markets/useGlvMarkets"; export const SyntheticsEventsContext = createContext({}); diff --git a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx index 7658050e8f..e5515a0538 100644 --- a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx +++ b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx @@ -21,7 +21,7 @@ import { usePositionsInfoRequest, } from "domain/synthetics/positions"; import { TokensData } from "domain/synthetics/tokens"; -import { useGlvMarketsInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { useGlvMarketsInfo } from "domain/synthetics/markets/useGlvMarkets"; import { ConfirmationBoxState, useConfirmationBoxState } from "domain/synthetics/trade/useConfirmationBoxState"; import { PositionEditorState, usePositionEditorState } from "domain/synthetics/trade/usePositionEditorState"; import { PositionSellerState, usePositionSellerState } from "domain/synthetics/trade/usePositionSellerState"; diff --git a/src/domain/synthetics/markets/glv.ts b/src/domain/synthetics/markets/glv.ts index 005471b828..a6e6de79b1 100644 --- a/src/domain/synthetics/markets/glv.ts +++ b/src/domain/synthetics/markets/glv.ts @@ -6,7 +6,7 @@ import { MarketInfo, MarketsInfoData, } from "domain/synthetics/markets"; -import { GlvMarket, GlvMarketInfo } from "domain/synthetics/tokens/useGlvMarkets"; +import { GlvMarket, GlvMarketInfo } from "domain/synthetics/markets/useGlvMarkets"; import { bigMath } from "lib/bigmath"; diff --git a/src/domain/synthetics/markets/types.ts b/src/domain/synthetics/markets/types.ts index cb341072fc..09f44a65e2 100644 --- a/src/domain/synthetics/markets/types.ts +++ b/src/domain/synthetics/markets/types.ts @@ -1,5 +1,5 @@ import { TokenData } from "domain/synthetics/tokens"; -import { GlvMarketInfo } from "../tokens/useGlvMarkets"; +import { GlvMarketInfo } from "./useGlvMarkets"; export type PnlFactorType = "FOR_DEPOSITS" | "FOR_WITHDRAWALS" | "FOR_TRADERS"; diff --git a/src/domain/synthetics/tokens/useGlvMarkets.ts b/src/domain/synthetics/markets/useGlvMarkets.ts similarity index 99% rename from src/domain/synthetics/tokens/useGlvMarkets.ts rename to src/domain/synthetics/markets/useGlvMarkets.ts index 135f1e7aa6..ac99b28823 100644 --- a/src/domain/synthetics/tokens/useGlvMarkets.ts +++ b/src/domain/synthetics/markets/useGlvMarkets.ts @@ -12,8 +12,8 @@ import { } from "config/dataStore"; import { getTokenBySymbol } from "config/tokens"; import { MulticallRequestConfig, useMulticall } from "lib/multicall"; -import { getContractMarketPrices, getGlvMarketName, MarketInfo, MarketsInfoData } from "../markets"; -import { TokenData, TokensData } from "./types"; +import { getContractMarketPrices, getGlvMarketName, MarketInfo, MarketsInfoData } from "."; +import { TokenData, TokensData } from "../tokens/types"; export type GlvList = { glv: { diff --git a/src/domain/synthetics/markets/useMarketTokensData.ts b/src/domain/synthetics/markets/useMarketTokensData.ts index a475b3786f..53f213fa16 100644 --- a/src/domain/synthetics/markets/useMarketTokensData.ts +++ b/src/domain/synthetics/markets/useMarketTokensData.ts @@ -16,7 +16,7 @@ import { getContractMarketPrices } from "./utils"; import SyntheticsReader from "abis/SyntheticsReader.json"; import TokenAbi from "abis/Token.json"; -import { GlvMarketsData } from "../tokens/useGlvMarkets"; +import { GlvMarketsData } from "./useGlvMarkets"; import { useMemo } from "react"; import { selectGlvInfo } from "context/SyntheticsStateContext/selectors/globalSelectors"; diff --git a/src/domain/synthetics/markets/utils.ts b/src/domain/synthetics/markets/utils.ts index 0aa1ee2e44..413f5a72c9 100644 --- a/src/domain/synthetics/markets/utils.ts +++ b/src/domain/synthetics/markets/utils.ts @@ -7,7 +7,7 @@ import { applyFactor, expandDecimals, PRECISION } from "lib/numbers"; import { getByKey } from "lib/objects"; import { getCappedPositionImpactUsd } from "../fees"; import { PositionInfo } from "../positions"; -import { convertToContractTokenPrices, convertToTokenAmount, convertToUsd, getMidPrice } from "../tokens"; +import { convertToContractTokenPrices, convertToTokenAmount, convertToUsd, getMidPrice } from "../tokens/utils"; import { TokenData, TokensData } from "../tokens/types"; import { ContractMarketPrices, Market, MarketInfo } from "./types"; import { GLV_MARKETS } from "config/markets"; diff --git a/src/domain/synthetics/testUtils/mocks.ts b/src/domain/synthetics/testUtils/mocks.ts index 39d8dd9244..2a4205c330 100644 --- a/src/domain/synthetics/testUtils/mocks.ts +++ b/src/domain/synthetics/testUtils/mocks.ts @@ -1,5 +1,6 @@ import { MarketsData, MarketsInfoData, getMarketFullName } from "domain/synthetics/markets"; -import { TokenData, TokensData, convertToTokenAmount, getTokenData } from "domain/synthetics/tokens"; +import { convertToTokenAmount, getTokenData } from "domain/synthetics/tokens/utils"; +import type { TokenData, TokensData } from "domain/synthetics/tokens"; import { USD_DECIMALS } from "config/factors"; import { expandDecimals } from "lib/numbers"; diff --git a/src/domain/synthetics/tokens/useTokensDataRequest.ts b/src/domain/synthetics/tokens/useTokensDataRequest.ts index 4540ce8351..cf43f5031d 100644 --- a/src/domain/synthetics/tokens/useTokensDataRequest.ts +++ b/src/domain/synthetics/tokens/useTokensDataRequest.ts @@ -1,5 +1,6 @@ -import { getTokensMap, getV2Tokens } from "config/tokens"; import { useMemo } from "react"; + +import { getTokensMap, getV2Tokens } from "config/tokens"; import { TokensData } from "./types"; import { useTokenBalances } from "./useTokenBalances"; import { useTokenRecentPricesRequest } from "./useTokenRecentPricesData"; diff --git a/src/domain/synthetics/trade/utils/deposit.ts b/src/domain/synthetics/trade/utils/deposit.ts index 526f48c98c..e9270398e6 100644 --- a/src/domain/synthetics/trade/utils/deposit.ts +++ b/src/domain/synthetics/trade/utils/deposit.ts @@ -4,7 +4,7 @@ import { TokenData, convertToTokenAmount, convertToUsd, getMidPrice } from "doma import { bigMath } from "lib/bigmath"; import { applyFactor } from "lib/numbers"; import { DepositAmounts } from "../types"; -import { GlvMarketInfo } from "../../tokens/useGlvMarkets"; +import { GlvMarketInfo } from "../../markets/useGlvMarkets"; export function getDepositAmounts(p: { marketInfo: MarketInfo; diff --git a/src/domain/synthetics/trade/utils/validation.ts b/src/domain/synthetics/trade/utils/validation.ts index be5a801a91..7a6bae1eec 100644 --- a/src/domain/synthetics/trade/utils/validation.ts +++ b/src/domain/synthetics/trade/utils/validation.ts @@ -3,6 +3,7 @@ import { IS_NETWORK_DISABLED, getChainName } from "config/chains"; import { BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; import { MarketInfo, + getMarketPoolName, getMaxAllowedLeverageByMinCollateralFactor, getMintableMarketTokens, getOpenInterestUsd, @@ -16,7 +17,7 @@ import { bigMath } from "lib/bigmath"; import { DUST_USD, isAddressZero } from "lib/legacy"; import { PRECISION, expandDecimals, formatAmount, formatUsd } from "lib/numbers"; import { getMaxUsdBuyableAmountInMarket, getMintableInfoGlv, isGlv } from "../../markets/glv"; -import { GlvMarketInfo } from "../../tokens/useGlvMarkets"; +import { GlvMarketInfo } from "../../markets/useGlvMarkets"; import { GmSwapFees, NextPositionValues, SwapPathStats, TradeFees, TriggerThresholdType } from "../types"; import { PriceImpactWarningState } from "../usePriceImpactWarningState"; @@ -586,12 +587,24 @@ export function getGmSwapError(p: { const newPoolAmount = applyDeltaToPoolAmount(marketInfo, impactAmount); if (!getIsValidPoolAmount(marketInfo, newPoolAmount)) { - return [t`Max pool amount exceeded`]; + const error = [t`Max pool amount exceeded`]; + + if (vaultInfo) { + error.push( + t`The buyable cap for the pool GM: ${marketInfo.name} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens.` + ); + } } } if (!getIsValidPoolUsdForDeposit(marketInfo)) { - return [t`Max pool USD exceeded`]; + const error = [t`Max pool USD exceeded`]; + + if (vaultInfo) { + error.push( + t`The buyable cap for the pool GM: ${marketInfo.name} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens.` + ); + } } const totalCollateralUsd = (longTokenUsd ?? 0n) + (shortTokenUsd ?? 0n); @@ -630,33 +643,35 @@ export function getGmSwapError(p: { } if (isDeposit) { - if (marketInfo.isSameCollaterals) { - if ((longTokenAmount ?? 0n) + (shortTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { - return [t`Insufficient ${longToken?.symbol} balance`]; - } - } else { - if ((longTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { - return [t`Insufficient ${longToken?.symbol} balance`]; - } - - if ((shortTokenAmount ?? 0n) > (shortToken?.balance ?? 0n)) { - return [t`Insufficient ${shortToken?.symbol} balance`]; - } + // if (marketInfo.isSameCollaterals) { + // if ((longTokenAmount ?? 0n) + (shortTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { + // return [t`Insufficient ${longToken?.symbol} balance`]; + // } + // } else { + // if ((longTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { + // return [t`Insufficient ${longToken?.symbol} balance`]; + // } + + // if ((shortTokenAmount ?? 0n) > (shortToken?.balance ?? 0n)) { + // return [t`Insufficient ${shortToken?.symbol} balance`]; + // } + // } - if (vaultInfo) { - const { mintableUsd: mintableGmUsd } = getMintableMarketTokens(marketInfo, marketToken); - const glvGmMarket = vaultInfo.markets.find(({ address }) => address === marketInfo.marketTokenAddress); - - const maxMintableInMarketUsd = glvGmMarket - ? getMaxUsdBuyableAmountInMarket(vaultInfo.indexToken.prices.minPrice, glvGmMarket, vaultInfo) - : 0n; - - if ( - marketTokenUsd !== undefined && - (mintableGmUsd < marketTokenUsd || maxMintableInMarketUsd < marketTokenUsd) - ) { - return [t`Max GM mintable amount exceeded`]; - } + if (vaultInfo) { + const { mintableUsd: mintableGmUsd } = getMintableMarketTokens(marketInfo, marketToken); + const glvGmMarket = vaultInfo.markets.find(({ address }) => address === marketInfo.marketTokenAddress); + + const maxMintableInMarketUsd = glvGmMarket + ? getMaxUsdBuyableAmountInMarket(vaultInfo.indexToken.prices.minPrice, glvGmMarket, vaultInfo) + : 0n; + + if (marketTokenUsd !== undefined && (mintableGmUsd < marketTokenUsd || maxMintableInMarketUsd < marketTokenUsd)) { + return [ + t`Max pool amount reached`, + longToken?.symbol === "GM" + ? t`The buyable cap for the pool GM: ${marketInfo.name} in GLV: ${vaultInfo.name} [${getMarketPoolName({ longToken: vaultInfo.longToken, shortToken: vaultInfo.shortToken })}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again.` + : t`The buyable cap for the pool GM: ${marketInfo.name} in GLV: ${vaultInfo.name} [${getMarketPoolName({ longToken: vaultInfo.longToken, shortToken: vaultInfo.shortToken })}] has been reached. Please choose a different pool or reduce the buy size.`, + ]; } } } else { diff --git a/src/domain/synthetics/trade/utils/withdrawal.ts b/src/domain/synthetics/trade/utils/withdrawal.ts index 9aebc6f4f5..88a1f2bcc6 100644 --- a/src/domain/synthetics/trade/utils/withdrawal.ts +++ b/src/domain/synthetics/trade/utils/withdrawal.ts @@ -3,7 +3,7 @@ import { TokenData, convertToTokenAmount, convertToUsd } from "domain/synthetics import { bigMath } from "lib/bigmath"; import { applyFactor } from "lib/numbers"; -import { GlvMarketInfo } from "../../tokens/useGlvMarkets"; +import { GlvMarketInfo } from "../../markets/useGlvMarkets"; import { WithdrawalAmounts } from "../types"; export function getWithdrawalAmounts(p: { diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index 190382ed41..747bb67c3b 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "GLP Kaufen / Verkaufen" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "Die Gebühren können variieren, je nachdem, welche Anlage du für den Kauf von GLP verwendest. <0/>Gebe die Menge an GLP, die du kaufen möchtest, in das Order-Formular ein und vergleiche dann hier die Gebühren." @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Unzureichende {0} Balance" @@ -7761,6 +7771,10 @@ msgstr "Ich bin mir der Trigger-Orders bewusst" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index de48ed6996..faf536d66c 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -662,6 +662,10 @@ msgstr "What did you like the most about our service?" msgid "Claimable Rebates" msgstr "Claimable Rebates" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "Max pool amount reached" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "Bid Price (Exit)" @@ -3296,6 +3300,10 @@ msgstr "GMX V2 {networkName} actions for all accounts." msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "Swap {fromTokenText} for {toTokenText}" @@ -5929,8 +5937,8 @@ msgid "Buy / Sell GLP" msgstr "Buy / Sell GLP" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "Max GM mintable amount exceeded" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "Max GM mintable amount exceeded" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6087,6 +6095,11 @@ msgstr "Trade Errors" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." @@ -6245,9 +6258,6 @@ msgstr "Select a collateral" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Insufficient {0} balance" @@ -7767,6 +7777,10 @@ msgstr "I am aware of the trigger orders" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "{count, plural, one {Order} other {# Orders}}" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "Volume on V1" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index f49565adbf..95650169c3 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "Comprar / Vender GLP" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "Las comisiones pueden variar dependiendo del activo que uses para comprar GLP. <0/>Introduce la cantidad de GLP que quieres comprar en el formulario y compara aquí las diferentes comisiones." @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Balance {0} insuficiente" @@ -7761,6 +7771,10 @@ msgstr "Soy consciente de las órdenes de activación" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 929e20fb1f..560e01bb6a 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "Acheter / Vendre GLP" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "Les frais peuvent varier selon quel actif vous vendez pour du GLP. <0/>Indiquer la somme que vous souhaitez acheter, puis vérifiez ici pour comparer les frais." @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Balance {0} insuffisante" @@ -7761,6 +7771,10 @@ msgstr "Je suis conscient des ordres de déclenchement" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 8685963e66..37b257c776 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "GLPの購入/売却" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "GLPの購入にどのアセットを使うかにより手数料は異なります。<0/>購入を希望するGLP額を注文フォームに入力し、ここをクリックして手数料を比較してください。" @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "{0} 残高の不足" @@ -7761,6 +7771,10 @@ msgstr "トリガー注文について承知しています" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index b725ab4f11..190f386254 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "GLP 구매 / 판매" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "GLP를 구매하는 양에 따라서 수수료가 상이합니다. <0/>구매하려는 GLP의 양을 주문 양식에 입력하고, 여기에서 수수료를 비교하세요." @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "{0} 잔고 부족" @@ -7761,6 +7771,10 @@ msgstr "트리거 주문에 대해 충분히 인지하고 있습니다." msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index 86c39132c4..d02392847a 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "" @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "" @@ -7761,6 +7771,10 @@ msgstr "" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 540bab75cf..6757f67ee9 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "Купить / Продать GLP" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "Комиссионные могут отличаться в зависимости от того, какой актив вы используете для покупки GLP. <0/>Укажите сумму GLP, которую вы хотите приобрести, в форме ордера, а затем проверьте здесь, чтобы узнать размер комиссионных." @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Недостаточный {0} баланс" @@ -7761,6 +7771,10 @@ msgstr "Я осведомлён о запуске ордера" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 8cd5e48c4a..8747175215 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -662,6 +662,10 @@ msgstr "" msgid "Claimable Rebates" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "Max pool amount reached" +msgstr "" + #: src/components/Synthetics/MarketCard/MarketCard.tsx msgid "Bid Price (Exit)" msgstr "" @@ -3296,6 +3300,10 @@ msgstr "" msgid "For trades on V1, this discount will be airdropped to your account every Wednesday. On V2, discounts are applied automatically and will reduce your fees when you make a trade." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +msgstr "" + #: src/domain/synthetics/orders/utils.tsx msgid "Swap {fromTokenText} for {toTokenText}" msgstr "" @@ -5923,8 +5931,8 @@ msgid "Buy / Sell GLP" msgstr "购买/出售GLP" #: src/domain/synthetics/trade/utils/validation.ts -msgid "Max GM mintable amount exceeded" -msgstr "" +#~ msgid "Max GM mintable amount exceeded" +#~ msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Open {0} in Explorer" @@ -6081,6 +6089,11 @@ msgstr "" msgid "Consider selecting only positions where the accrued funding fee exceeds the {0} gas cost to settle each position." msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} using the pay token selected is reached. Please choose a different pool, reduce the buy size, or pick a different composition of tokens." +msgstr "" + #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you use to buy GLP. <0/>Enter the amount of GLP you want to purchase in the order form, then check here to compare fees." msgstr "费用决于你出售GLP的资产可能有所不同。<0/>在订单中输入你要购买的GLP数量,然后在此查看以比较费用。" @@ -6239,9 +6252,6 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts -#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr " {0}余额不足" @@ -7761,6 +7771,10 @@ msgstr "我了解触发的指令" msgid "{count, plural, one {Order} other {# Orders}}" msgstr "" +#: src/domain/synthetics/trade/utils/validation.ts +msgid "The buyable cap for the pool GM: {0} in GLV: {1} [{2}] has been reached. Please choose a different pool or reduce the buy size." +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Volume on V1" msgstr "" From e246e3c58fea7b8ec72192175ecd4bd5105406e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 18:32:02 +0400 Subject: [PATCH 15/49] fixed tests --- .../useDepositWithdrawalTransactions.tsx | 1 - .../useSubmitButtonState.tsx | 21 +++++++++++++-- .../Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx | 2 +- .../GmSwapBox/useUpdateByQueryParams.tsx | 3 +-- .../MarketTokenSelector.tsx | 2 +- .../SyntheticsEventsProvider.tsx | 1 - src/domain/synthetics/tokens/types.ts | 2 +- .../synthetics/trade/utils/validation.ts | 26 +++++++++---------- src/domain/tokens/utils.ts | 2 +- 9 files changed, 37 insertions(+), 23 deletions(-) diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx index 3e0458d488..ea50331e45 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx @@ -82,7 +82,6 @@ export const useDepositWithdrawalTransactions = ({ ? initialLongTokenAddress : shortToken?.address || marketInfo.shortTokenAddress; - debugger; // eslint-disable-line if (isGlv && selectedGlvGmMarket && vaultInfo) { return createGlvDepositTxn(chainId, signer, { account, diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx index d487dbaf5f..15257b77c9 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx @@ -172,12 +172,29 @@ export const useSubmitButtonState = ({ ? getSellableInfoGlv(vaultInfo, marketsInfoData, marketTokensData, selectedGlvGmMarket) : undefined; + const { marketTokenToCalculateError, longTokenToCalculateError } = useMemo(() => { + let marketTokenToCalculateError, longTokenToCalculateError; + + if (vaultInfo) { + marketTokenToCalculateError = isDeposit ? marketToken : vaultInfo.indexToken; + longTokenToCalculateError = isDeposit ? longToken : vaultInfo?.indexToken; + } + + marketTokenToCalculateError = marketToken; + longTokenToCalculateError = longToken; + + return { + marketTokenToCalculateError, + longTokenToCalculateError, + }; + }, [isDeposit, marketToken, vaultInfo, longToken]); + const [swapError, swapErrorDescription] = getGmSwapError({ isDeposit, marketInfo, vaultInfo, - marketToken: isDeposit ? marketToken : vaultInfo?.indexToken, - longToken: isDeposit ? longToken : vaultInfo?.indexToken, + marketToken: marketTokenToCalculateError, + longToken: longTokenToCalculateError, shortToken: shortToken, marketTokenAmount, marketTokenUsd: amounts?.marketTokenUsd, diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx index 28f70e6d13..60bc654324 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBox.tsx @@ -26,7 +26,7 @@ export type GmSwapBoxProps = { onSetMode: (mode: Mode) => void; onSetOperation: (operation: Operation) => void; selectedGlvGmMarket?: string; - onSelectGlvGmMarket?: (marketAddress: string) => void; + onSelectGlvGmMarket?: (marketAddress?: string) => void; }; const OPERATION_LABELS_GM = { diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx index f6b92146d2..6c1af34f85 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/useUpdateByQueryParams.tsx @@ -37,7 +37,7 @@ export function useUpdateByQueryParams({ setMode: (mode: Mode) => void; setFirstTokenAddress?: (address: string | undefined) => void; onSelectMarket: (marketAddress: string) => void; - onSelectGlvGmMarket?: (marketAddress: string) => void; + onSelectGlvGmMarket?: (marketAddress?: string) => void; }) { const history = useHistory(); const searchParams = useSearchParams(); @@ -53,7 +53,6 @@ export function useUpdateByQueryParams({ const marketAddress = marketRaw?.toLowerCase(); if (operation) { - debugger; // eslint-disable-line let finalOperation; if (operation.toLowerCase() === "buy") { diff --git a/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx b/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx index b865741f5f..9694874004 100644 --- a/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx +++ b/src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -469,7 +469,7 @@ function MarketTokenListItem({ handleSelectToken: (address: string) => void; isSmallMobile: boolean; mintableInfo: ReturnType; - sellableInfo: ReturnType; + sellableInfo: ReturnType; rowVerticalPadding: string; indexName?: string; poolName?: string; diff --git a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx index 3cadf62054..85c2956d0c 100644 --- a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx +++ b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx @@ -334,7 +334,6 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) }, GlvDepositExecuted: (eventData: EventLogData, txnParams: EventTxnParams) => { - debugger; // eslint-disable-line const key = eventData.bytes32Items.items.key; if (depositStatuses[key]?.data) { diff --git a/src/domain/synthetics/tokens/types.ts b/src/domain/synthetics/tokens/types.ts index 5490b89790..f01ffbafb8 100644 --- a/src/domain/synthetics/tokens/types.ts +++ b/src/domain/synthetics/tokens/types.ts @@ -1,4 +1,4 @@ -import { Token } from "domain/tokens"; +import type { Token } from "domain/tokens"; export type TokenPrices = { minPrice: bigint; diff --git a/src/domain/synthetics/trade/utils/validation.ts b/src/domain/synthetics/trade/utils/validation.ts index 7a6bae1eec..3fb0b21f0e 100644 --- a/src/domain/synthetics/trade/utils/validation.ts +++ b/src/domain/synthetics/trade/utils/validation.ts @@ -643,19 +643,19 @@ export function getGmSwapError(p: { } if (isDeposit) { - // if (marketInfo.isSameCollaterals) { - // if ((longTokenAmount ?? 0n) + (shortTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { - // return [t`Insufficient ${longToken?.symbol} balance`]; - // } - // } else { - // if ((longTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { - // return [t`Insufficient ${longToken?.symbol} balance`]; - // } - - // if ((shortTokenAmount ?? 0n) > (shortToken?.balance ?? 0n)) { - // return [t`Insufficient ${shortToken?.symbol} balance`]; - // } - // } + if (marketInfo.isSameCollaterals) { + if ((longTokenAmount ?? 0n) + (shortTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { + return [t`Insufficient ${longToken?.symbol} balance`]; + } + } else { + if ((longTokenAmount ?? 0n) > (longToken?.balance ?? 0n)) { + return [t`Insufficient ${longToken?.symbol} balance`]; + } + + if ((shortTokenAmount ?? 0n) > (shortToken?.balance ?? 0n)) { + return [t`Insufficient ${shortToken?.symbol} balance`]; + } + } if (vaultInfo) { const { mintableUsd: mintableGmUsd } = getMintableMarketTokens(marketInfo, marketToken); diff --git a/src/domain/tokens/utils.ts b/src/domain/tokens/utils.ts index cb61d039c5..0f00396746 100644 --- a/src/domain/tokens/utils.ts +++ b/src/domain/tokens/utils.ts @@ -14,7 +14,7 @@ import { import { USD_DECIMALS } from "config/factors"; import { expandDecimals, PRECISION } from "lib/numbers"; import { InfoTokens, Token, TokenInfo, TokenPrices } from "./types"; -import { convertToTokenAmount } from "domain/synthetics/tokens"; +import { convertToTokenAmount } from "domain/synthetics/tokens/utils"; const { ZeroAddress } = ethers; From 65d286f513e72e6cdf9613e128071e480f03bf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 20:26:12 +0400 Subject: [PATCH 16/49] fixed pools page subtitle --- src/domain/synthetics/markets/createDepositTxn.ts | 2 -- src/pages/MarketPoolsPage/MarketPoolsPage.tsx | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain/synthetics/markets/createDepositTxn.ts b/src/domain/synthetics/markets/createDepositTxn.ts index c10c3e4c46..4ebd9170d7 100644 --- a/src/domain/synthetics/markets/createDepositTxn.ts +++ b/src/domain/synthetics/markets/createDepositTxn.ts @@ -221,8 +221,6 @@ export async function createGlvDepositTxn(chainId: number, signer: Signer, p: Cr }); } - debugger; // eslint-disable-line - return callContract(chainId, contract, "multicall", [encodedPayload], { value: wntAmount, hideSentMsg: true, diff --git a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx index a4fff04f0d..9e55672de9 100644 --- a/src/pages/MarketPoolsPage/MarketPoolsPage.tsx +++ b/src/pages/MarketPoolsPage/MarketPoolsPage.tsx @@ -78,6 +78,8 @@ export function MarketPoolsPage() {
GLV Vaults include multiple GM Tokens and are automatically rebalanced. +
+ Shift GM Tokens between eligible pools without paying buy/sell fees. } qa="pools-page" From 9a9e884552df50ab8d9b2385c438451c67782c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 20:27:11 +0400 Subject: [PATCH 17/49] updated .po files --- src/locales/de/messages.po | 7 +++++-- src/locales/en/messages.po | 7 +++++-- src/locales/es/messages.po | 7 +++++-- src/locales/fr/messages.po | 7 +++++-- src/locales/ja/messages.po | 7 +++++-- src/locales/ko/messages.po | 7 +++++-- src/locales/pseudo/messages.po | 7 +++++-- src/locales/ru/messages.po | 7 +++++-- src/locales/zh/messages.po | 7 +++++-- 9 files changed, 45 insertions(+), 18 deletions(-) diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index 747bb67c3b..b871c951ec 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Unzureichende {0} Balance" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index faf536d66c..e9ed7ed02a 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "<0>Delegate your undelegated {0} GMX DAO<1> voting power before staking." #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "Shift GM Tokens between eligible pools without paying buy/sell fees." #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6258,6 +6258,9 @@ msgstr "Select a collateral" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Insufficient {0} balance" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 95650169c3..044aa5e1b5 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Balance {0} insuficiente" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 560e01bb6a..a39c68d952 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Balance {0} insuffisante" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 37b257c776..7929334878 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "{0} 残高の不足" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 190f386254..24e20ee191 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "{0} 잔고 부족" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index d02392847a..d74ab73571 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 6757f67ee9..53e5108353 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr "Недостаточный {0} баланс" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 8747175215..787246e0d0 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -506,8 +506,8 @@ msgid "<0>Delegate your undelegated {0} GMX DAO<1> voting power before stak msgstr "" #: src/pages/MarketPoolsPage/MarketPoolsPage.tsx -#~ msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." -#~ msgstr "" +msgid "Shift GM Tokens between eligible pools without paying buy/sell fees." +msgstr "" #: src/components/Synthetics/SubaccountModal/SubaccountModal.tsx msgid "This amount of {0} will be sent from your Main Account to your Subaccount to pay for transaction fees." @@ -6252,6 +6252,9 @@ msgstr "" #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts +#: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance" msgstr " {0}余额不足" From 04bb54434aed33d2ead6348ca79d2b17c9f56caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 20:27:53 +0400 Subject: [PATCH 18/49] Removed GmConfirmationBox --- .../GmConfirmationBox/GmConfirmationBox.scss | 31 - .../GmConfirmationBox/GmConfirmationBox.tsx | 655 ------------------ 2 files changed, 686 deletions(-) delete mode 100644 src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.scss delete mode 100644 src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx diff --git a/src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.scss b/src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.scss deleted file mode 100644 index 461d9eab99..0000000000 --- a/src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.scss +++ /dev/null @@ -1,31 +0,0 @@ -.GmConfirmationBox { - .Modal-body { - overflow-x: hidden; - } -} - -.GmConfirmationBox-main { - display: flex; - flex-direction: column; - margin-top: 0; -} - -.GmConfirmationBox-approve-tokens { - display: flex; - flex-direction: column; -} - -.GmConfirmationBox-approve-token { - height: 2.2rem; - display: flex; - align-items: center; - margin-top: 0.5rem; - - &:first-child { - margin-top: 0; - } -} - -.GmConfirmationBox-high-fee { - margin-bottom: 0.465rem; -} diff --git a/src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx b/src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx deleted file mode 100644 index b0ee1a2442..0000000000 --- a/src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx +++ /dev/null @@ -1,655 +0,0 @@ -import { Trans, msg, plural, t } from "@lingui/macro"; -import { useLingui } from "@lingui/react"; -import uniq from "lodash/uniq"; -import { useMemo, useState } from "react"; -import { FaArrowDown } from "react-icons/fa"; -import { useKey } from "react-use"; - -import { getContract } from "config/contracts"; -import { DEFAULT_SLIPPAGE_AMOUNT } from "config/factors"; -import { useSyntheticsEvents } from "context/SyntheticsEvents"; -import { useMarketsInfoData } from "context/SyntheticsStateContext/hooks/globalsHooks"; -import { ExecutionFee } from "domain/synthetics/fees"; -import { createDepositTxn } from "domain/synthetics/markets/createDepositTxn"; -import { createShiftTxn } from "domain/synthetics/markets/createShiftTxn"; -import { createWithdrawalTxn } from "domain/synthetics/markets/createWithdrawalTxn"; -import { useMarketTokensData } from "domain/synthetics/markets/useMarketTokensData"; -import { getNeedTokenApprove, getTokenData, useTokensDataRequest } from "domain/synthetics/tokens"; -import { TokenData } from "domain/synthetics/tokens/types"; -import { useTokensAllowanceData } from "domain/synthetics/tokens/useTokenAllowanceData"; -import { GmSwapFees } from "domain/synthetics/trade"; -import { useHighExecutionFeeConsent } from "domain/synthetics/trade/useHighExecutionFeeConsent"; -import { useChainId } from "lib/chains"; -import { formatTokenAmount, formatUsd } from "lib/numbers"; -import { getByKey } from "lib/objects"; -import { usePendingTxns } from "lib/usePendingTxns"; -import useWallet from "lib/wallets/useWallet"; -import { Operation } from "../GmSwapBox/types"; - -import { ApproveTokenButton } from "components/ApproveTokenButton/ApproveTokenButton"; -import Button from "components/Button/Button"; -import Modal from "components/Modal/Modal"; -import { NetworkFeeRow } from "components/Synthetics/NetworkFeeRow/NetworkFeeRow"; -import { GmFees } from "../GmFees/GmFees"; - -import { helperToast } from "lib/helperToast"; -import { - initGMSwapMetricData, - initShiftGmMetricData, - makeTxnErrorMetricsHandler, - makeTxnSentMetricsHandler, - sendOrderSubmittedMetric, - sendTxnValidationErrorMetric, -} from "lib/metrics/utils"; -import "./GmConfirmationBox.scss"; - -type Props = { - isVisible: boolean; - marketToken?: TokenData; - fromMarketToken?: TokenData; - fromMarketTokenAmount?: bigint; - fromMarketTokenUsd?: bigint; - longToken?: TokenData; - shortToken?: TokenData; - marketTokenAmount: bigint; - marketTokenUsd: bigint; - longTokenAmount?: bigint; - longTokenUsd?: bigint; - shortTokenAmount?: bigint; - shortTokenUsd?: bigint; - fees?: GmSwapFees; - error?: string; - operation: Operation; - executionFee?: ExecutionFee; - onSubmitted: () => void; - onClose: () => void; - shouldDisableValidation?: boolean; -}; - -const operationTextMap = { - [Operation.Deposit]: msg`Buy`, - [Operation.Withdrawal]: msg`Sell`, - [Operation.Shift]: msg`Shift`, -}; - -const processingTextMap = { - [Operation.Deposit]: msg`Buying GM...`, - [Operation.Withdrawal]: msg`Selling GM...`, - [Operation.Shift]: msg`Shifting GM...`, -}; - -export function GmConfirmationBox({ - isVisible, - marketToken, - longToken, - shortToken, - marketTokenAmount, - marketTokenUsd, - longTokenAmount, - longTokenUsd, - shortTokenAmount, - shortTokenUsd, - fees, - error, - operation, - executionFee, - onSubmitted, - onClose, - shouldDisableValidation, - fromMarketToken, - fromMarketTokenAmount, - fromMarketTokenUsd, -}: Props) { - const { signer, account } = useWallet(); - const { chainId } = useChainId(); - const { _ } = useLingui(); - const marketsInfoData = useMarketsInfoData(); - const { tokensData } = useTokensDataRequest(chainId); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: true }); - const { setPendingDeposit, setPendingWithdrawal, setPendingShift } = useSyntheticsEvents(); - const [isSubmitting, setIsSubmitting] = useState(false); - const [, setPendingTxns] = usePendingTxns(); - - const market = getByKey(marketsInfoData, marketToken?.address); - - const routerAddress = getContract(chainId, "SyntheticsRouter"); - const { element: highExecutionFeeAcknowledgement, isHighFeeConsentError } = useHighExecutionFeeConsent( - executionFee?.feeUsd - ); - - const payTokenAddresses = (function getPayTokenAddresses() { - if (!marketToken) { - return []; - } - - const addresses: string[] = []; - - if (operation === Operation.Deposit) { - if (longTokenAmount !== undefined && longTokenAmount > 0 && longToken) { - addresses.push(longToken.address); - } - if (shortTokenAmount !== undefined && shortTokenAmount > 0 && shortToken) { - addresses.push(shortToken.address); - } - } else if (operation === Operation.Withdrawal) { - addresses.push(marketToken.address); - } else if (operation === Operation.Shift) { - addresses.push(fromMarketToken!.address); - } - - return uniq(addresses); - })(); - - const { tokensAllowanceData } = useTokensAllowanceData(chainId, { - spenderAddress: routerAddress, - tokenAddresses: payTokenAddresses, - skip: !isVisible, - }); - - const tokensToApprove = useMemo( - function getTokensToApprove() { - const addresses: string[] = []; - - if (!tokensAllowanceData) { - return addresses; - } - - if (operation === Operation.Deposit) { - if ( - longTokenAmount !== undefined && - longTokenAmount > 0 && - longToken && - getNeedTokenApprove(tokensAllowanceData, longToken.address, longTokenAmount) - ) { - addresses.push(longToken.address); - } - - if ( - shortTokenAmount !== undefined && - shortTokenAmount > 0 && - shortToken && - getNeedTokenApprove(tokensAllowanceData, shortToken.address, shortTokenAmount) - ) { - addresses.push(shortToken.address); - } - } else if (operation === Operation.Withdrawal) { - if ( - marketTokenAmount > 0 && - marketToken && - getNeedTokenApprove(tokensAllowanceData, marketToken.address, marketTokenAmount) - ) { - addresses.push(marketToken.address); - } - } else if (operation === Operation.Shift) { - if ( - fromMarketTokenAmount !== undefined && - fromMarketTokenAmount > 0 && - fromMarketToken && - getNeedTokenApprove(tokensAllowanceData, fromMarketToken.address, fromMarketTokenAmount) - ) { - addresses.push(fromMarketToken.address); - } - } - - return uniq(addresses); - }, - [ - fromMarketToken, - fromMarketTokenAmount, - longToken, - longTokenAmount, - marketToken, - marketTokenAmount, - operation, - shortToken, - shortTokenAmount, - tokensAllowanceData, - ] - ); - - const longSymbol = market?.isSameCollaterals ? `${longToken?.symbol} Long` : longToken?.symbol; - const shortSymbol = market?.isSameCollaterals ? `${shortToken?.symbol} Short` : shortToken?.symbol; - - const operationText = _(operationTextMap[operation]); - - const isAllowanceLoaded = Boolean(tokensAllowanceData); - - const submitButtonState = (function getSubmitButtonState() { - if (payTokenAddresses.length > 0 && !isAllowanceLoaded) { - return { - text: t`Loading...`, - disabled: true, - }; - } - - const onSubmit = () => { - setIsSubmitting(true); - - let txnPromise: Promise; - - if (operation === Operation.Deposit) { - txnPromise = onCreateDeposit(); - } else if (operation === Operation.Withdrawal) { - txnPromise = onCreateWithdrawal(); - } else { - txnPromise = onCreateShift(); - } - - txnPromise - .then(() => { - onSubmitted(); - }) - .catch((error) => { - throw error; - }) - .finally(() => { - setIsSubmitting(false); - }); - }; - - if (error) { - return { - text: error, - disabled: !shouldDisableValidation, - onClick: onSubmit, - }; - } - - if (isHighFeeConsentError) { - return { - text: t`High Network Fee not yet acknowledged`, - disabled: true, - }; - } - - if (isSubmitting) { - return { - text: _(processingTextMap[operation]), - disabled: true, - }; - } - - if (tokensToApprove.length > 0 && marketToken) { - const symbols = tokensToApprove.map((address) => { - const token = getTokenData(tokensData, address) || getTokenData(marketTokensData, address); - return address === marketToken.address ? "GM" : token?.assetSymbol ?? token?.symbol; - }); - - const symbolsText = symbols.join(", "); - - return { - text: plural(symbols.length, { - one: `Pending ${symbolsText} approval`, - other: `Pending ${symbolsText} approvals`, - }), - disabled: true, - }; - } - - const operationText = _(operationTextMap[operation]); - const text = t`Confirm ${operationText}`; - - return { - text, - onClick: onSubmit, - }; - })(); - - useKey( - "Enter", - () => { - if (isVisible && submitButtonState.onClick && !submitButtonState.disabled) { - submitButtonState.onClick(); - } - }, - {}, - [isVisible, submitButtonState] - ); - - function onCreateDeposit() { - const metricData = initGMSwapMetricData({ - longToken, - shortToken, - isDeposit: true, - executionFee, - marketInfo: getByKey(marketsInfoData, marketToken?.address), - marketToken, - longTokenAmount, - shortTokenAmount, - marketTokenAmount, - }); - - sendOrderSubmittedMetric(metricData.metricId); - - if ( - !account || - !executionFee || - !marketToken || - !market || - marketTokenAmount === undefined || - !tokensData || - !signer - ) { - helperToast.error(t`Error submitting deposit`); - sendTxnValidationErrorMetric(metricData.metricId); - return Promise.resolve(); - } - - const initialLongTokenAddress = longToken?.address || market.longTokenAddress; - const initialShortTokenAddress = market.isSameCollaterals - ? initialLongTokenAddress - : shortToken?.address || market.shortTokenAddress; - - return createDepositTxn(chainId, signer, { - account, - initialLongTokenAddress, - initialShortTokenAddress, - longTokenSwapPath: [], - shortTokenSwapPath: [], - longTokenAmount: longTokenAmount ?? 0n, - shortTokenAmount: shortTokenAmount ?? 0n, - marketTokenAddress: marketToken.address, - minMarketTokens: marketTokenAmount, - executionFee: executionFee.feeTokenAmount, - allowedSlippage: DEFAULT_SLIPPAGE_AMOUNT, - skipSimulation: shouldDisableValidation, - tokensData, - metricId: metricData.metricId, - setPendingTxns, - setPendingDeposit, - }) - .then(makeTxnSentMetricsHandler(metricData.metricId)) - .catch(makeTxnErrorMetricsHandler(metricData.metricId)); - } - - function onCreateWithdrawal() { - const metricData = initGMSwapMetricData({ - longToken, - shortToken, - isDeposit: false, - executionFee, - marketInfo: getByKey(marketsInfoData, marketToken?.address), - marketToken, - longTokenAmount, - shortTokenAmount, - marketTokenAmount, - }); - - sendOrderSubmittedMetric(metricData.metricId); - - if ( - !account || - !market || - !marketToken || - !executionFee || - longTokenAmount === undefined || - shortTokenAmount === undefined || - !tokensData || - !signer - ) { - helperToast.error(t`Error submitting withdrawal`); - sendTxnValidationErrorMetric(metricData.metricId); - return Promise.resolve(); - } - - return createWithdrawalTxn(chainId, signer, { - account, - initialLongTokenAddress: longToken?.address || market.longTokenAddress, - initialShortTokenAddress: shortToken?.address || market.shortTokenAddress, - longTokenSwapPath: [], - shortTokenSwapPath: [], - marketTokenAmount: marketTokenAmount, - minLongTokenAmount: longTokenAmount, - minShortTokenAmount: shortTokenAmount, - marketTokenAddress: marketToken.address, - executionFee: executionFee.feeTokenAmount, - allowedSlippage: DEFAULT_SLIPPAGE_AMOUNT, - tokensData, - skipSimulation: shouldDisableValidation, - metricId: metricData.metricId, - setPendingTxns, - setPendingWithdrawal, - }) - .then(makeTxnSentMetricsHandler(metricData.metricId)) - .catch(makeTxnErrorMetricsHandler(metricData.metricId)); - } - - function onCreateShift() { - const metricData = initShiftGmMetricData({ - executionFee, - fromMarketInfo: getByKey(marketsInfoData, fromMarketToken?.address), - toMarketInfo: getByKey(marketsInfoData, marketToken?.address), - marketToken, - minMarketTokenAmount: marketTokenAmount, - }); - - sendOrderSubmittedMetric(metricData.metricId); - - if ( - !signer || - !account || - !fromMarketToken || - !executionFee || - !marketToken || - fromMarketTokenAmount === undefined || - marketTokenAmount === undefined || - !tokensData - ) { - helperToast.error(t`Error submitting shift`); - sendTxnValidationErrorMetric(metricData.metricId); - return Promise.resolve(); - } - - return createShiftTxn(chainId, signer, { - account, - fromMarketTokenAddress: fromMarketToken.address, - fromMarketTokenAmount: fromMarketTokenAmount, - toMarketTokenAddress: marketToken.address, - minToMarketTokenAmount: marketTokenAmount, - executionFee: executionFee.feeTokenAmount, - allowedSlippage: DEFAULT_SLIPPAGE_AMOUNT, - skipSimulation: shouldDisableValidation, - tokensData, - metricId: metricData.metricId, - setPendingTxns, - setPendingShift, - }) - .then(makeTxnSentMetricsHandler(metricData.metricId)) - .catch(makeTxnErrorMetricsHandler(metricData.metricId)); - } - - const renderTokenInfo = ({ - amount, - className, - overrideSymbol, - token, - usd, - }: { - amount?: bigint; - usd?: bigint; - token?: TokenData; - className?: string; - overrideSymbol?: string; - }) => { - if (amount === undefined || usd === undefined || !token) return; - return ( -
-
- - {formatTokenAmount(amount, token?.decimals, overrideSymbol ?? token?.symbol, { - useCommas: true, - })} - -
-
{formatUsd(usd)}
-
- ); - }; - - const shouldRenderDivider = Boolean(tokensToApprove?.length > 0) || Boolean(highExecutionFeeAcknowledgement); - - return ( -
- - {isVisible && ( - <> -
- {operation === Operation.Deposit && ( - <> -
- Pay - {market?.isSameCollaterals ? ( - renderTokenInfo({ - amount: longTokenAmount !== undefined ? longTokenAmount + shortTokenAmount! : undefined, - usd: longTokenUsd !== undefined ? longTokenUsd + shortTokenUsd! : undefined, - token: longToken, - }) - ) : ( - <> - {renderTokenInfo({ - amount: longTokenAmount, - usd: longTokenUsd, - token: longToken, - overrideSymbol: longSymbol, - })} - {renderTokenInfo({ - amount: shortTokenAmount, - usd: shortTokenUsd, - token: shortToken, - overrideSymbol: shortSymbol, - })} - - )} -
- -
- Receive - {renderTokenInfo({ - amount: marketTokenAmount, - usd: marketTokenUsd, - token: marketToken, - })} -
- - )} - {operation === Operation.Withdrawal && ( - <> -
- Pay - {renderTokenInfo({ - amount: marketTokenAmount, - usd: marketTokenUsd, - token: marketToken, - })} -
- -
- Receive{" "} - {market?.isSameCollaterals ? ( - renderTokenInfo({ - amount: longTokenAmount ? longTokenAmount + shortTokenAmount! : undefined, - usd: longTokenUsd ? longTokenUsd + shortTokenUsd! : undefined, - token: longToken, - }) - ) : ( - <> - {renderTokenInfo({ - amount: longTokenAmount, - usd: longTokenUsd, - token: longToken, - overrideSymbol: longSymbol, - })} - {renderTokenInfo({ - amount: shortTokenAmount, - usd: shortTokenUsd, - token: shortToken, - overrideSymbol: shortSymbol, - })} - - )} -
- - )} - {operation === Operation.Shift && ( - <> -
- Pay - {renderTokenInfo({ - amount: fromMarketTokenAmount, - usd: fromMarketTokenUsd, - token: fromMarketToken, - })} -
- -
- Receive - {renderTokenInfo({ - amount: marketTokenAmount, - usd: marketTokenUsd, - token: marketToken, - })} -
- - )} -
- -
- - - - - {shouldRenderDivider &&
} - - {tokensToApprove && tokensToApprove.length > 0 && ( -
- {tokensToApprove.map((address) => { - const token = getTokenData(tokensData, address)!; - let marketTokenData = - address === marketToken?.address && getByKey(marketsInfoData, marketToken?.address); - if (operation === Operation.Shift) { - marketTokenData = getByKey(marketsInfoData, fromMarketToken?.address); - } - - return ( -
- -
- ); - })} -
- )} - - {highExecutionFeeAcknowledgement ? ( -
{highExecutionFeeAcknowledgement}
- ) : null} - -
- -
- - )} - -
- ); -} From 1f8354657e85df6e43b7ffb590e05a80f0c5bf22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Fri, 30 Aug 2024 20:28:38 +0400 Subject: [PATCH 19/49] updated .po files --- src/locales/de/messages.po | 40 ++++++++++++---------------------- src/locales/en/messages.po | 40 ++++++++++++---------------------- src/locales/es/messages.po | 40 ++++++++++++---------------------- src/locales/fr/messages.po | 40 ++++++++++++---------------------- src/locales/ja/messages.po | 40 ++++++++++++---------------------- src/locales/ko/messages.po | 40 ++++++++++++---------------------- src/locales/pseudo/messages.po | 40 ++++++++++++---------------------- src/locales/ru/messages.po | 40 ++++++++++++---------------------- src/locales/zh/messages.po | 40 ++++++++++++---------------------- 9 files changed, 126 insertions(+), 234 deletions(-) diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index b871c951ec..04890c8094 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "Die Adresse des esGMX (IOU)-Tokens lautet {esGmxIouAddress}" msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "Swap Order übermittelt!" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "Position" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "Ordergröße ist größer als die Position. Wird nur ausgeführt, wenn s #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "Kaufen" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "Referralbedingungen" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index e9ed7ed02a..6c216cb8b8 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -778,9 +778,6 @@ msgstr "Liq. {0} {longOrShortText}" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "The address of the esGMX (IOU) token is {esGmxIouAddress}." msgid "GMX Alerts" msgstr "GMX Alerts" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "Unsupported network" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "Shift" @@ -3620,8 +3615,8 @@ msgid "Vesting Status" msgstr "Vesting Status" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "Error submitting deposit" +#~ msgid "Error submitting deposit" +#~ msgstr "Error submitting deposit" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3896,7 +3891,6 @@ msgstr "Unknown sell GM order" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3936,8 +3930,8 @@ msgid "Select a token" msgstr "Select a token" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "Error submitting shift" +#~ msgid "Error submitting shift" +#~ msgstr "Error submitting shift" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4600,7 +4594,6 @@ msgstr "Swap Order submitted!" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4870,8 +4863,8 @@ msgid "Close {longOrShortText} {0}" msgstr "Close {longOrShortText} {0}" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "Buying GM..." +#~ msgid "Buying GM..." +#~ msgstr "Buying GM..." #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4926,8 +4919,8 @@ msgid "LONG LIQ." msgstr "LONG LIQ." #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "Error submitting withdrawal" +#~ msgid "Error submitting withdrawal" +#~ msgstr "Error submitting withdrawal" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6115,9 +6108,6 @@ msgstr "Claim <0>{0}" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6757,8 +6747,8 @@ msgid "Position" msgstr "Position" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "Selling GM..." +#~ msgid "Selling GM..." +#~ msgstr "Selling GM..." #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6974,7 +6964,6 @@ msgstr "Order size is bigger than position, will only be executable if position #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "Buy" @@ -7021,8 +7010,8 @@ msgid "Referral Terms" msgstr "Referral Terms" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "Shifting GM..." +#~ msgid "Shifting GM..." +#~ msgstr "Shifting GM..." #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7192,8 +7181,8 @@ msgstr "Compound completed!" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "Confirm {operationText}" +#~ msgid "Confirm {operationText}" +#~ msgstr "Confirm {operationText}" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7755,7 +7744,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "Edit {longOrShortText} {0}" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "Sell" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 044aa5e1b5..0f173f01fb 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "La dirección del token esGMX (IOU) es {esGmxIouAddress}." msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "¡Orden de Intercambio enviada!" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "Posición" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "El tamaño de la orden es mayor que la posición, sólo se ejecutará si #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "Comprar" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "Términos de Referido" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index a39c68d952..a20b1c3fce 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "L'adresse du token esGMX (IOU - reconnaissance de dette) est {esGmxIouAd msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "Ordre d'échange soumis !" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "Position" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "Montant de l'ordre supérieure à la position, il sera exécutable seule #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "Acheter" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "Termes de parrainage" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 7929334878..ccc7c7dcaa 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "esGMX (IOU)トークンのアドレスは{esGmxIouAddress}です。" msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "スワップ注文提出済!" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "ポジション" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "注文サイズがポジションより大きいため、ポジション #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "購入" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "紹介の規約" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 24e20ee191..e9272f8f9d 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "esGMX (IOU) 토큰의 주소는 {esGmxIouAddress}입니다." msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "스왑 주문 제출 완료!" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "포지션" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "주문의 사이즈가 포지션을 초과했습니다. 포지션을 증 #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "구매" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "추천 약관" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index d74ab73571..8d1c0a7ef2 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "" msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 53e5108353..2be9aaa576 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "Адрес токена esGMX называется {esGmxIouAddress}." msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "<<<<<<< HEAD" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "Обменный Ордер подан!" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "<<<<<<< HEAD" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "Позиция" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "Размер ордера больше позиции, будет исп #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "Купить" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "Реферальные Условия" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 787246e0d0..f392759255 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -778,9 +778,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -1680,7 +1677,6 @@ msgstr "esGMX(IOU)代币的地址是{esGmxIouAddress}" msgid "GMX Alerts" msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx msgid "{0, plural, one {Pending {symbolsText} approval} other {Pending {symbolsText} approvals}}" @@ -3402,7 +3398,6 @@ msgid "Unsupported network" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Shift" msgstr "" @@ -3617,8 +3612,8 @@ msgid "Vesting Status" msgstr "<<<<<<< HEAD" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting deposit" -msgstr "" +#~ msgid "Error submitting deposit" +#~ msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "You have an active Limit Order to Increase {longOrShortText} {sizeInToken} {0} (${1}) at price ${2}" @@ -3893,7 +3888,6 @@ msgstr "" msgid "<0>Notifications are provided by Notifi and not affiliated with GMX. By subscribing, you agree that info you provide to Notifi will be governed by its <1>Privacy Policy<2> and <3>Terms of Use." msgstr "" -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -3933,8 +3927,8 @@ msgid "Select a token" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting shift" -msgstr "" +#~ msgid "Error submitting shift" +#~ msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/PositionItem/PositionItem.tsx @@ -4597,7 +4591,6 @@ msgstr "交易订单送出" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx #: src/components/Synthetics/Claims/Claims.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useSubmitButtonState.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -4867,8 +4860,8 @@ msgid "Close {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Buying GM..." -msgstr "" +#~ msgid "Buying GM..." +#~ msgstr "" #: src/pages/Stake/StakeV2.tsx msgid "Deposited!" @@ -4923,8 +4916,8 @@ msgid "LONG LIQ." msgstr "<<<<<<< HEAD" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Error submitting withdrawal" -msgstr "" +#~ msgid "Error submitting withdrawal" +#~ msgstr "" #: src/components/Exchange/PositionsList.jsx #: src/components/Exchange/PositionsList.jsx @@ -6109,9 +6102,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -6751,8 +6741,8 @@ msgid "Position" msgstr "仓位" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Selling GM..." -msgstr "" +#~ msgid "Selling GM..." +#~ msgstr "" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Bonus Rebate" @@ -6968,7 +6958,6 @@ msgstr "订单规模大于头寸,只有在头寸增加的情况下才会执行 #: src/components/Header/AppHeaderLinks.tsx #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Buy" msgstr "购买" @@ -7015,8 +7004,8 @@ msgid "Referral Terms" msgstr "推荐条款" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Shifting GM..." -msgstr "" +#~ msgid "Shifting GM..." +#~ msgstr "" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx @@ -7186,8 +7175,8 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx #: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx -msgid "Confirm {operationText}" -msgstr "" +#~ msgid "Confirm {operationText}" +#~ msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Initial collateral" @@ -7749,7 +7738,6 @@ msgid "Edit {longOrShortText} {0}" msgstr "" #: src/components/Synthetics/GmList/GmList.tsx -#: src/components/Synthetics/GmSwap/GmConfirmationBox/GmConfirmationBox.tsx msgid "Sell" msgstr "" From 69e7c61e64239c3d28f7b957fb055a34d45c6c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hub=C3=A9rt=20de=20Lalye?= Date: Sat, 31 Aug 2024 14:58:39 +0400 Subject: [PATCH 20/49] fixes in GM/GLV ui --- .../MarketSelector/PoolSelector.tsx | 23 ++++++++++--------- src/components/Synthetics/GmList/GmList.tsx | 5 +++- .../MarketStatsWithComposition.tsx | 4 ++-- .../components/CompositionTable.tsx | 8 +++---- src/config/contracts.ts | 8 +------ src/config/markets.ts | 9 +++++++- .../SyntheticsEventsProvider.tsx | 4 +++- .../SyntheticsStateContextProvider.tsx | 4 +++- .../selectors/globalSelectors.ts | 1 - .../synthetics/markets/useGlvMarkets.ts | 22 ++++++++++-------- .../synthetics/markets/useMarketTokensData.ts | 4 +++- src/domain/synthetics/markets/utils.ts | 6 ++--- 12 files changed, 56 insertions(+), 42 deletions(-) diff --git a/src/components/MarketSelector/PoolSelector.tsx b/src/components/MarketSelector/PoolSelector.tsx index a336d5d2c8..5cdda5429f 100644 --- a/src/components/MarketSelector/PoolSelector.tsx +++ b/src/components/MarketSelector/PoolSelector.tsx @@ -50,7 +50,10 @@ export function PoolSelector({ const marketsOptions: MarketOption[] = useMemo(() => { const allMarkets = markets - .filter((market) => !market.isDisabled && (showAllPools || getMarketIndexName(market) === selectedIndexName)) + .filter( + (market) => + !market.isDisabled && market.indexToken && (showAllPools || getMarketIndexName(market) === selectedIndexName) + ) .map((marketInfo) => { const indexName = getMarketIndexName(marketInfo); const poolName = getMarketPoolName(marketInfo); @@ -136,17 +139,15 @@ export function PoolSelector({ function displayPoolLabel(marketInfo: MarketInfo | undefined) { if (!marketInfo) return "..."; - const name = showAllPools - ? `${marketInfo.indexToken.symbol}: ${getMarketIndexName(marketInfo)}` - : getMarketPoolName(marketInfo); + const isGlvMarket = isGlv(marketInfo); + const tokenPrefix = isGlvMarket ? "GLV:" : "GM:"; - if (isGlv(marketInfo)) { - return ( -
setIsModalVisible(true)}> - GLV: {marketInfo.name} - -
- ); + let name; + + if (isGlvMarket) { + name = `${tokenPrefix} ${marketInfo.name}`; + } else { + name = showAllPools ? `${tokenPrefix} ${getMarketIndexName(marketInfo)}` : getMarketPoolName(marketInfo); } if (marketsOptions?.length > 1) { diff --git a/src/components/Synthetics/GmList/GmList.tsx b/src/components/Synthetics/GmList/GmList.tsx index 49ce628c2f..d6a348eeae 100644 --- a/src/components/Synthetics/GmList/GmList.tsx +++ b/src/components/Synthetics/GmList/GmList.tsx @@ -1,5 +1,6 @@ import { Trans, t } from "@lingui/macro"; import noop from "lodash/noop"; +import cx from "classnames"; import { useCallback, useMemo, useState } from "react"; import { Address, isAddress, isAddressEqual } from "viem"; import { useAccount } from "wagmi"; @@ -385,7 +386,9 @@ function GmListItem({ const shiftButton = useMemo(() => { const btn = (