From 78da92f4534155bdc6e3ac34aa675186654fe6bc Mon Sep 17 00:00:00 2001 From: saml33 Date: Fri, 4 Aug 2023 12:06:09 +1000 Subject: [PATCH] various fixes --- components/shared/TokenVaultWarnings.tsx | 6 +- components/swap/LimitSwapForm.tsx | 103 ++++++++--- components/swap/MarketSwapForm.tsx | 157 ++++++++++++++-- components/swap/SwapForm.tsx | 217 ++--------------------- components/swap/SwapTokenChart.tsx | 41 +++-- public/locales/en/trade.json | 3 +- public/locales/es/trade.json | 3 +- public/locales/ru/trade.json | 3 +- public/locales/zh/trade.json | 3 +- public/locales/zh_tw/trade.json | 3 +- 10 files changed, 269 insertions(+), 270 deletions(-) diff --git a/components/shared/TokenVaultWarnings.tsx b/components/shared/TokenVaultWarnings.tsx index 77793339..d0f3ea2a 100644 --- a/components/shared/TokenVaultWarnings.tsx +++ b/components/shared/TokenVaultWarnings.tsx @@ -23,7 +23,11 @@ const TokenVaultWarnings = ({ const [maxWithdraw, maxBorrow] = useMemo(() => { if (!mangoAccount || !group) return [0, 0] - const maxWithdraw = getMaxWithdrawForBank(group, bank, mangoAccount) + const maxWithdraw = getMaxWithdrawForBank( + group, + bank, + mangoAccount, + ).toNumber() const maxBorrow = mangoAccount.getMaxWithdrawWithBorrowForTokenUi( group, bank.mint, diff --git a/components/swap/LimitSwapForm.tsx b/components/swap/LimitSwapForm.tsx index af16db1c..9acc2747 100644 --- a/components/swap/LimitSwapForm.tsx +++ b/components/swap/LimitSwapForm.tsx @@ -5,6 +5,7 @@ import { useMemo, Dispatch, SetStateAction, + useLayoutEffect, } from 'react' import { ArrowDownIcon, ArrowsRightLeftIcon } from '@heroicons/react/20/solid' import NumberFormat, { @@ -34,6 +35,7 @@ import TokenLogo from '@components/shared/TokenLogo' import InlineNotification from '@components/shared/InlineNotification' import { handleFlipPrices } from './SwapTokenChart' import Select from '@components/forms/Select' +import useIpAddress from 'hooks/useIpAddress' type LimitSwapFormProps = { showTokenSelect: 'input' | 'output' | undefined @@ -65,10 +67,11 @@ const LimitSwapForm = ({ setShowTokenSelect, }: LimitSwapFormProps) => { const { t } = useTranslation(['common', 'swap', 'trade']) + const { ipAllowed, ipCountry } = useIpAddress() const [animateSwitchArrow, setAnimateSwitchArrow] = useState(0) const [triggerPrice, setTriggerPrice] = useState('') const [orderType, setOrderType] = useState(ORDER_TYPES[0]) - const [orderTypeMultiplier, setOrderTypeMultiplier] = useState(0.9) + const [orderTypeMultiplier, setOrderTypeMultiplier] = useState(1.1) const [submitting, setSubmitting] = useState(false) const [swapFormSizeUi] = useLocalStorageState(SIZE_INPUT_UI_KEY, 'slider') const [formErrors, setFormErrors] = useState({}) @@ -140,10 +143,18 @@ const LimitSwapForm = ({ useEffect(() => { if (!quotePrice) return if (!triggerPrice && !showTokenSelect) { - setTriggerPrice((quotePrice * 0.9).toFixed(inputBank?.mintDecimals)) + setTriggerPrice((quotePrice * 1.1).toFixed(inputBank?.mintDecimals)) } }, [inputBank, quotePrice, showTokenSelect, triggerPrice]) + // flip trigger price when chart direction is flipped + useLayoutEffect(() => { + if (!quotePrice) return + setTriggerPrice( + (quotePrice * orderTypeMultiplier).toFixed(inputBank?.mintDecimals), + ) + }, [flipPrices, orderTypeMultiplier]) + const triggerPriceDifference = useMemo(() => { if (!quotePrice) return 0 const triggerDifference = triggerPrice @@ -173,9 +184,7 @@ const LimitSwapForm = ({ return invalidFields }, []) - /* - If the use margin setting is toggled, clear the form values - */ + // If the use margin setting is toggled, clear the form values useEffect(() => { setAmountInFormValue('') setAmountOutFormValue('') @@ -400,22 +409,38 @@ const LimitSwapForm = ({ !triggerPrice ) return + const quoteString = !flipPrices ? `${inputBank.name} per ${outputBank.name}` : `${outputBank.name} per ${inputBank.name}` - if (inputBank.name === 'USDC') { + + const orderTypeString = + orderType === OrderTypes.STOP_LOSS + ? t('trade:falls-to') + : t('trade:rises-to') + + if (orderType === OrderTypes.REPAY_BORROW) { + return t('trade:repay-borrow-order-desc', { + amount: floorToDecimal(amountOutFormValue, outputBank.mintDecimals), + priceUnit: quoteString, + symbol: outputBank.name, + triggerPrice: floorToDecimal(triggerPrice, inputBank.mintDecimals), + }) + } else if (inputBank.name === 'USDC') { return t('trade:trigger-order-desc', { amount: floorToDecimal(amountOutFormValue, outputBank.mintDecimals), - symbol: outputBank.name, - triggerPrice: triggerPrice, + orderType: orderTypeString, priceUnit: quoteString, + symbol: outputBank.name, + triggerPrice: floorToDecimal(triggerPrice, inputBank.mintDecimals), }) } else { return t('trade:trigger-order-desc', { amount: floorToDecimal(amountInFormValue, inputBank.mintDecimals), - symbol: inputBank.name, - triggerPrice: triggerPrice, + orderType: orderTypeString, priceUnit: quoteString, + symbol: inputBank.name, + triggerPrice: floorToDecimal(triggerPrice, inputBank.mintDecimals), }) } }, [ @@ -423,6 +448,7 @@ const LimitSwapForm = ({ amountOutFormValue, flipPrices, inputBank, + orderType, outputBank, triggerPrice, ]) @@ -489,13 +515,20 @@ const LimitSwapForm = ({ setOrderType(newType) const triggerMultiplier = newType === OrderTypes.STOP_LOSS - ? 0.9 - : newType === OrderTypes.TAKE_PROFIT ? 1.1 + : newType === OrderTypes.TAKE_PROFIT + ? 0.9 : 1 setOrderTypeMultiplier(triggerMultiplier) const trigger = (quotePrice * triggerMultiplier).toString() setTriggerPrice(trigger) + if (amountInAsDecimal.gt(0)) { + const amountOut = getAmountOut( + amountInAsDecimal.toString(), + trigger, + ).toString() + setAmountOutFormValue(amountOut) + } }, [quotePrice, setOrderTypeMultiplier], ) @@ -619,7 +652,7 @@ const LimitSwapForm = ({ /> {swapFormSizeUi === 'slider' ? ( handleAmountInUi(v)} step={1 / 10 ** (inputBank?.mintDecimals || 6)} @@ -628,7 +661,7 @@ const LimitSwapForm = ({ handleAmountInUi(v)} - useMargin={useMargin} + useMargin={false} /> )} {orderDescription ? ( @@ -636,11 +669,13 @@ const LimitSwapForm = ({ - {inputBank?.name === 'USDC' ? ( - {t('buy')} - ) : ( - {t('sell')} - )}{' '} + {orderType !== OrderTypes.REPAY_BORROW ? ( + inputBank?.name === 'USDC' ? ( + {t('buy')} + ) : ( + {t('sell')} + ) + ) : null}{' '} {orderDescription} } @@ -648,19 +683,31 @@ const LimitSwapForm = ({ /> ) : null} - {orderType === 'repay-borrow' && !hasBorrowToRepay ? ( + {orderType === OrderTypes.REPAY_BORROW && !hasBorrowToRepay ? (
) : null} - + {ipAllowed ? ( + + ) : ( + + )} ) } diff --git a/components/swap/MarketSwapForm.tsx b/components/swap/MarketSwapForm.tsx index 752ceea7..2d3ed6e0 100644 --- a/components/swap/MarketSwapForm.tsx +++ b/components/swap/MarketSwapForm.tsx @@ -6,12 +6,16 @@ import { Dispatch, SetStateAction, } from 'react' -import { ArrowDownIcon } from '@heroicons/react/20/solid' +import { + ArrowDownIcon, + ExclamationCircleIcon, + LinkIcon, +} from '@heroicons/react/20/solid' import { NumberFormatValues, SourceInfo } from 'react-number-format' import Decimal from 'decimal.js' import mangoStore from '@store/mangoStore' import useDebounce from '../shared/useDebounce' -import { SIZE_INPUT_UI_KEY } from '../../utils/constants' +import { MANGO_MINT, SIZE_INPUT_UI_KEY, USDC_MINT } from '../../utils/constants' import { useWallet } from '@solana/wallet-adapter-react' import { RouteInfo } from 'types/jupiter' import useLocalStorageState from 'hooks/useLocalStorageState' @@ -19,11 +23,17 @@ import SwapSlider from './SwapSlider' import PercentageSelectButtons from './PercentageSelectButtons' import BuyTokenInput from './BuyTokenInput' import SellTokenInput from './SellTokenInput' +import Button from '@components/shared/Button' +import { Transition } from '@headlessui/react' +import SwapReviewRouteInfo from './SwapReviewRouteInfo' +import useIpAddress from 'hooks/useIpAddress' +import { useTranslation } from 'react-i18next' +import useQuoteRoutes from './useQuoteRoutes' +import { useTokenMax } from './useTokenMax' +import Loading from '@components/shared/Loading' +import InlineNotification from '@components/shared/InlineNotification' type MarketSwapFormProps = { - bestRoute: RouteInfo | undefined | null - selectedRoute: RouteInfo | undefined | null - setSelectedRoute: Dispatch> setShowTokenSelect: Dispatch> } @@ -39,17 +49,16 @@ export const NUMBER_FORMAT_CLASSNAMES = const set = mangoStore.getState().set -const MarketSwapForm = ({ - bestRoute, - selectedRoute, - setSelectedRoute, - setShowTokenSelect, -}: MarketSwapFormProps) => { +const MarketSwapForm = ({ setShowTokenSelect }: MarketSwapFormProps) => { + const { t } = useTranslation(['common', 'swap', 'trade']) + //initial state is undefined null is returned on error + const [selectedRoute, setSelectedRoute] = useState() const [animateSwitchArrow, setAnimateSwitchArrow] = useState(0) + const [showConfirm, setShowConfirm] = useState(false) const [swapFormSizeUi] = useLocalStorageState(SIZE_INPUT_UI_KEY, 'slider') - const { margin: useMargin, + slippage, inputBank, outputBank, amountIn: amountInFormValue, @@ -58,7 +67,16 @@ const MarketSwapForm = ({ } = mangoStore((s) => s.swap) const [debouncedAmountIn] = useDebounce(amountInFormValue, 300) const [debouncedAmountOut] = useDebounce(amountOutFormValue, 300) - const { connected } = useWallet() + const { connected, publicKey } = useWallet() + const { bestRoute, routes } = useQuoteRoutes({ + inputMint: inputBank?.mint.toString() || USDC_MINT, + outputMint: outputBank?.mint.toString() || MANGO_MINT, + amount: swapMode === 'ExactIn' ? debouncedAmountIn : debouncedAmountOut, + slippage, + swapMode, + wallet: publicKey?.toBase58(), + }) + const { ipAllowed, ipCountry } = useIpAddress() const amountInAsDecimal: Decimal | null = useMemo(() => { return Number(debouncedAmountIn) @@ -197,6 +215,27 @@ const MarketSwapForm = ({ return ( <> +
+ + setShowConfirm(false)} + amountIn={amountInAsDecimal} + slippage={slippage} + routes={routes} + selectedRoute={selectedRoute} + setSelectedRoute={setSelectedRoute} + /> + +
)} + {ipAllowed ? ( + + ) : ( + + )} ) } export default MarketSwapForm + +const SwapFormSubmitButton = ({ + amountIn, + amountOut, + inputSymbol, + loadingSwapDetails, + selectedRoute, + setShowConfirm, + useMargin, +}: { + amountIn: Decimal + amountOut: number | undefined + inputSymbol: string | undefined + loadingSwapDetails: boolean + selectedRoute: RouteInfo | undefined | null + setShowConfirm: (x: boolean) => void + useMargin: boolean +}) => { + const { t } = useTranslation('common') + const { connected, connect } = useWallet() + const { amount: tokenMax, amountWithBorrow } = useTokenMax(useMargin) + + const showInsufficientBalance = useMargin + ? amountWithBorrow.lt(amountIn) + : tokenMax.lt(amountIn) + + const disabled = + connected && + (!amountIn.toNumber() || + showInsufficientBalance || + !amountOut || + !selectedRoute) + + const onClick = connected ? () => setShowConfirm(true) : connect + + return ( + <> + + {selectedRoute === null && amountIn.gt(0) ? ( +
+ +
+ ) : null} + + ) +} diff --git a/components/swap/SwapForm.tsx b/components/swap/SwapForm.tsx index 74348b1d..b060e4c2 100644 --- a/components/swap/SwapForm.tsx +++ b/components/swap/SwapForm.tsx @@ -1,32 +1,16 @@ import { useState, useCallback, useMemo, useEffect } from 'react' import { PublicKey } from '@solana/web3.js' -import { - Cog8ToothIcon, - ExclamationCircleIcon, - LinkIcon, -} from '@heroicons/react/20/solid' -import Decimal from 'decimal.js' +import { Cog8ToothIcon } from '@heroicons/react/20/solid' import mangoStore from '@store/mangoStore' import ContentBox from '../shared/ContentBox' -import SwapReviewRouteInfo from './SwapReviewRouteInfo' -import useDebounce from '../shared/useDebounce' import { useTranslation } from 'next-i18next' import SwapFormTokenList from './SwapFormTokenList' -import { Transition } from '@headlessui/react' -import Button, { IconButton, LinkButton } from '../shared/Button' -import Loading from '../shared/Loading' +import { IconButton, LinkButton } from '../shared/Button' import { EnterBottomExitBottom } from '../shared/Transitions' -import useQuoteRoutes from './useQuoteRoutes' import { HealthType } from '@blockworks-foundation/mango-v4' -import { MANGO_MINT, SWAP_MARGIN_KEY, USDC_MINT } from '../../utils/constants' -import { useTokenMax } from './useTokenMax' +import { SWAP_MARGIN_KEY } from '../../utils/constants' import HealthImpact from '@components/shared/HealthImpact' -import { useWallet } from '@solana/wallet-adapter-react' -import useMangoAccount from 'hooks/useMangoAccount' -import { RouteInfo } from 'types/jupiter' -import useMangoGroup from 'hooks/useMangoGroup' import TokenVaultWarnings from '@components/shared/TokenVaultWarnings' -import useIpAddress from 'hooks/useIpAddress' import SwapSettings from './SwapSettings' import InlineNotification from '@components/shared/InlineNotification' import Tooltip from '@components/shared/Tooltip' @@ -40,18 +24,13 @@ const set = mangoStore.getState().set const SwapForm = () => { const { t } = useTranslation(['common', 'swap', 'trade']) - //initial state is undefined null is returned on error - const [selectedRoute, setSelectedRoute] = useState() const [showTokenSelect, setShowTokenSelect] = useState<'input' | 'output'>() const [showSettings, setShowSettings] = useState(false) - const [showConfirm, setShowConfirm] = useState(false) const [swapOrLimit, setSwapOrLimit] = useState('swap') - const { group } = useMangoGroup() const [, setSavedSwapMargin] = useLocalStorageState( SWAP_MARGIN_KEY, true, ) - const { ipAllowed, ipCountry } = useIpAddress() const { margin: useMargin, @@ -60,33 +39,7 @@ const SwapForm = () => { outputBank, amountIn: amountInFormValue, amountOut: amountOutFormValue, - swapMode, } = mangoStore((s) => s.swap) - const [debouncedAmountIn] = useDebounce(amountInFormValue, 300) - const [debouncedAmountOut] = useDebounce(amountOutFormValue, 300) - const { mangoAccount } = useMangoAccount() - const { connected, publicKey } = useWallet() - - const amountInAsDecimal: Decimal | null = useMemo(() => { - return Number(debouncedAmountIn) - ? new Decimal(debouncedAmountIn) - : new Decimal(0) - }, [debouncedAmountIn]) - - const amountOutAsDecimal: Decimal | null = useMemo(() => { - return Number(debouncedAmountOut) - ? new Decimal(debouncedAmountOut) - : new Decimal(0) - }, [debouncedAmountOut]) - - const { bestRoute, routes } = useQuoteRoutes({ - inputMint: inputBank?.mint.toString() || USDC_MINT, - outputMint: outputBank?.mint.toString() || MANGO_MINT, - amount: swapMode === 'ExactIn' ? debouncedAmountIn : debouncedAmountOut, - slippage, - swapMode, - wallet: publicKey?.toBase58(), - }) const handleTokenInSelect = useCallback((mintAddress: string) => { const group = mangoStore.getState().group @@ -114,14 +67,15 @@ const SwapForm = () => { const maintProjectedHealth = useMemo(() => { const group = mangoStore.getState().group + const mangoAccount = mangoStore.getState().mangoAccount.current if ( !inputBank || !mangoAccount || !outputBank || - !amountOutAsDecimal || + !amountOutFormValue || !group ) - return 0 + return 100 const simulatedHealthRatio = mangoAccount.simHealthRatioWithTokenPositionUiChanges( @@ -129,11 +83,11 @@ const SwapForm = () => { [ { mintPk: inputBank.mint, - uiTokenAmount: amountInAsDecimal.toNumber() * -1, + uiTokenAmount: parseFloat(amountInFormValue) * -1, }, { mintPk: outputBank.mint, - uiTokenAmount: amountOutAsDecimal.toNumber(), + uiTokenAmount: parseFloat(amountOutFormValue), }, ], HealthType.maint, @@ -143,28 +97,7 @@ const SwapForm = () => { : simulatedHealthRatio < 0 ? 0 : Math.trunc(simulatedHealthRatio) - }, [ - mangoAccount, - inputBank, - outputBank, - amountInAsDecimal, - amountOutAsDecimal, - ]) - - const loadingSwapDetails: boolean = useMemo(() => { - return ( - !!(amountInAsDecimal.toNumber() || amountOutAsDecimal.toNumber()) && - swapOrLimit === 'swap' && - connected && - typeof selectedRoute === 'undefined' - ) - }, [ - amountInAsDecimal, - amountOutAsDecimal, - connected, - selectedRoute, - swapOrLimit, - ]) + }, [inputBank, outputBank, amountInFormValue, amountOutFormValue]) const handleSwapOrLimit = useCallback( (orderType: string) => { @@ -185,15 +118,15 @@ const SwapForm = () => { const estSlippage = useMemo(() => { const { group } = mangoStore.getState() - if (!group || !inputBank || !amountInAsDecimal.gt(0)) return 0 - const amountIn = amountInAsDecimal.toNumber() + const amountIn = parseFloat(amountInFormValue) || 0 + if (!group || !inputBank || amountIn <= 0) return 0 const value = amountIn * inputBank.uiPrice const slippage = group.getPriceImpactByTokenIndex( inputBank.tokenIndex, value, ) return slippage - }, [amountInAsDecimal, inputBank]) + }, [amountInFormValue, inputBank]) return ( { className="relative overflow-hidden border-x-0 bg-th-bkg-1 md:border-l md:border-r-0 md:border-t-0 md:border-b-0" >
- - setShowConfirm(false)} - amountIn={amountInAsDecimal} - slippage={slippage} - routes={routes} - selectedRoute={selectedRoute} - setSelectedRoute={setSelectedRoute} - /> - {
{swapOrLimit === 'swap' ? ( - + ) : ( )} - {ipAllowed ? ( - swapOrLimit === 'swap' ? ( - - ) : null - ) : ( - - )} - {group && inputBank ? ( + {inputBank ? ( ) : null} {inputBank && @@ -355,7 +239,7 @@ const SwapForm = () => { ) : null} - {estSlippage > 0 && swapOrLimit === 'trade:trigger-order' ? ( + {estSlippage ? ( <>

@@ -392,74 +276,3 @@ const SwapForm = () => { } export default SwapForm - -const SwapFormSubmitButton = ({ - amountIn, - amountOut, - inputSymbol, - loadingSwapDetails, - selectedRoute, - setShowConfirm, - useMargin, -}: { - amountIn: Decimal - amountOut: number | undefined - inputSymbol: string | undefined - loadingSwapDetails: boolean - selectedRoute: RouteInfo | undefined | null - setShowConfirm: (x: boolean) => void - useMargin: boolean -}) => { - const { t } = useTranslation('common') - const { connected, connect } = useWallet() - const { amount: tokenMax, amountWithBorrow } = useTokenMax(useMargin) - - const showInsufficientBalance = useMargin - ? amountWithBorrow.lt(amountIn) - : tokenMax.lt(amountIn) - - const disabled = - connected && - (!amountIn.toNumber() || - showInsufficientBalance || - !amountOut || - !selectedRoute) - - const onClick = connected ? () => setShowConfirm(true) : connect - - return ( - <> - - {selectedRoute === null && amountIn.gt(0) ? ( -

- -
- ) : null} - - ) -} diff --git a/components/swap/SwapTokenChart.tsx b/components/swap/SwapTokenChart.tsx index 8d6b7a56..cbeff815 100644 --- a/components/swap/SwapTokenChart.tsx +++ b/components/swap/SwapTokenChart.tsx @@ -249,26 +249,6 @@ const SwapTokenChart = () => { : `${inputSymbol}/${outputSymbol}` }, [flipPrices, inputBank, inputCoingeckoId, outputBank]) - // const handleFlipPrices = useCallback( - // (flip: boolean) => { - // if (!flipPrices && flip) { - // setSwapChartSettings([ - // ...swapChartSettings, - // { pair: swapMarketName, flipPrices: true }, - // ]) - // } else { - // setSwapChartSettings( - // swapChartSettings.filter( - // (chart: SwapChartSettings) => - // !chart.pair.includes(inputBank!.name) && - // !chart.pair.includes(outputBank!.name), - // ), - // ) - // } - // }, - // [flipPrices, inputBank, outputBank, swapChartSettings, swapMarketName], - // ) - const handleSwapMouseEnter = useCallback( ( swap: SwapHistoryItem | undefined, @@ -460,6 +440,22 @@ const SwapTokenChart = () => { }) }, [coingeckoData, chartSwapTimes]) + const latestChartDataItem = useMemo(() => { + if (!inputBank || !outputBank) return [] + const price = !flipPrices + ? outputBank.uiPrice / inputBank.uiPrice + : inputBank.uiPrice / outputBank.uiPrice + const item: ChartDataItem[] = [ + { + price, + time: Date.now(), + inputTokenPrice: inputBank.uiPrice, + outputTokenPrice: outputBank.uiPrice, + }, + ] + return item + }, [flipPrices, inputBank, outputBank]) + const chartData = useMemo(() => { if (!coingeckoData || !coingeckoData.length || coingeckoData.length < 2) return [] @@ -469,7 +465,10 @@ const SwapTokenChart = () => { const swapPoints = swapHistoryPoints.filter( (point) => point.time >= minTime && point.time <= maxTime, ) - return coingeckoData.concat(swapPoints).sort((a, b) => a.time - b.time) + return coingeckoData + .concat(swapPoints) + .sort((a, b) => a.time - b.time) + .concat(latestChartDataItem) } else return coingeckoData }, [coingeckoData, swapHistoryPoints, showSwaps]) diff --git a/public/locales/en/trade.json b/public/locales/en/trade.json index 612dc7a4..f1674659 100644 --- a/public/locales/en/trade.json +++ b/public/locales/en/trade.json @@ -73,6 +73,7 @@ "realized-pnl": "Realized PnL", "reduce": "Reduce", "reduce-only": "Reduce Only", + "repay-borrow-order-desc": "Repay {{amount}} {{symbol}} if the oracle price reaches {{triggerPrice}} {{priceUnit}}", "sells": "Sells", "settle-funds": "Settle Funds", "settle-funds-error": "Failed to settle funds", @@ -104,7 +105,7 @@ "trades": "Trades", "trigger-price": "Trigger Price", "trigger-order": "Trigger Order", - "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price is {{triggerPrice}} {{priceUnit}}", + "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price {{orderType}} {{triggerPrice}} {{priceUnit}}", "trigger-orders": "Trigger Orders", "tweet-position": "Tweet", "unrealized-pnl": "Unrealized PnL", diff --git a/public/locales/es/trade.json b/public/locales/es/trade.json index 612dc7a4..f1674659 100644 --- a/public/locales/es/trade.json +++ b/public/locales/es/trade.json @@ -73,6 +73,7 @@ "realized-pnl": "Realized PnL", "reduce": "Reduce", "reduce-only": "Reduce Only", + "repay-borrow-order-desc": "Repay {{amount}} {{symbol}} if the oracle price reaches {{triggerPrice}} {{priceUnit}}", "sells": "Sells", "settle-funds": "Settle Funds", "settle-funds-error": "Failed to settle funds", @@ -104,7 +105,7 @@ "trades": "Trades", "trigger-price": "Trigger Price", "trigger-order": "Trigger Order", - "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price is {{triggerPrice}} {{priceUnit}}", + "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price {{orderType}} {{triggerPrice}} {{priceUnit}}", "trigger-orders": "Trigger Orders", "tweet-position": "Tweet", "unrealized-pnl": "Unrealized PnL", diff --git a/public/locales/ru/trade.json b/public/locales/ru/trade.json index 612dc7a4..f1674659 100644 --- a/public/locales/ru/trade.json +++ b/public/locales/ru/trade.json @@ -73,6 +73,7 @@ "realized-pnl": "Realized PnL", "reduce": "Reduce", "reduce-only": "Reduce Only", + "repay-borrow-order-desc": "Repay {{amount}} {{symbol}} if the oracle price reaches {{triggerPrice}} {{priceUnit}}", "sells": "Sells", "settle-funds": "Settle Funds", "settle-funds-error": "Failed to settle funds", @@ -104,7 +105,7 @@ "trades": "Trades", "trigger-price": "Trigger Price", "trigger-order": "Trigger Order", - "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price is {{triggerPrice}} {{priceUnit}}", + "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price {{orderType}} {{triggerPrice}} {{priceUnit}}", "trigger-orders": "Trigger Orders", "tweet-position": "Tweet", "unrealized-pnl": "Unrealized PnL", diff --git a/public/locales/zh/trade.json b/public/locales/zh/trade.json index a59b5c92..db9bf6a0 100644 --- a/public/locales/zh/trade.json +++ b/public/locales/zh/trade.json @@ -72,6 +72,7 @@ "quote": "计价", "reduce": "Reduce", "reduce-only": "限减少", + "repay-borrow-order-desc": "Repay {{amount}} {{symbol}} if the oracle price reaches {{triggerPrice}} {{priceUnit}}", "sells": "卖单", "settle-funds": "借清资金", "settle-funds-error": "借清出错", @@ -102,7 +103,7 @@ "tweet-position": "分享至Twitter", "trigger-price": "Trigger Price", "trigger-order": "Trigger Order", - "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price is {{triggerPrice}} {{priceUnit}}", + "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price {{orderType}} {{triggerPrice}} {{priceUnit}}", "trigger-orders": "Trigger Orders", "unsettled": "未結清", "volume-alert": "交易量警報", diff --git a/public/locales/zh_tw/trade.json b/public/locales/zh_tw/trade.json index 21cd676c..1248276a 100644 --- a/public/locales/zh_tw/trade.json +++ b/public/locales/zh_tw/trade.json @@ -73,6 +73,7 @@ "realized-pnl": "已實現的盈虧", "reduce": "Reduce", "reduce-only": "限減少", + "repay-borrow-order-desc": "Repay {{amount}} {{symbol}} if the oracle price reaches {{triggerPrice}} {{priceUnit}}", "sells": "賣單", "settle-funds": "借清資金", "settle-funds-error": "借清出錯", @@ -104,7 +105,7 @@ "trades": "交易", "trigger-price": "Trigger Price", "trigger-order": "Trigger Order", - "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price is {{triggerPrice}} {{priceUnit}}", + "trigger-order-desc": "{{amount}} {{symbol}} if the oracle price {{orderType}} {{triggerPrice}} {{priceUnit}}", "trigger-orders": "Trigger Orders", "tweet-position": "分享至Twitter", "unrealized-pnl": "未實現盈虧",