From 597456a0d17e956d5f57fc6bc372bcc46d76c672 Mon Sep 17 00:00:00 2001 From: Jared Vu Date: Wed, 7 Feb 2024 09:49:46 -0800 Subject: [PATCH] JUP Asset details (#285) * :sparkles: add JUP assets * localize eg --- package.json | 2 +- pnpm-lock.yaml | 16 ++-- public/configs/env.json | 19 ++++- public/configs/markets.json | 7 ++ public/currencies/jup.png | Bin 0 -> 11451 bytes src/components/AssetIcon.tsx | 1 + src/constants/potentialMarkets.ts | 60 --------------- src/hooks/usePotentialMarkets.tsx | 70 ++++++++++++++++-- src/hooks/useURLConfigs.ts | 36 ++++----- .../NewMarketForm/NewMarketPreviewStep.tsx | 21 +++++- .../NewMarketForm/NewMarketSelectionStep.tsx | 15 ++-- 11 files changed, 141 insertions(+), 106 deletions(-) create mode 100644 public/currencies/jup.png diff --git a/package.json b/package.json index bb9292e..903e5c4 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@cosmjs/tendermint-rpc": "^0.32.1", "@dydxprotocol/v4-abacus": "^1.4.2", "@dydxprotocol/v4-client-js": "^1.0.20", - "@dydxprotocol/v4-localization": "^1.1.24", + "@dydxprotocol/v4-localization": "^1.1.25", "@ethersproject/providers": "^5.7.2", "@js-joda/core": "^5.5.3", "@radix-ui/react-accordion": "^1.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 949c0eb..2eb9489 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + overrides: follow-redirects: 1.15.3 @@ -32,8 +36,8 @@ dependencies: specifier: ^1.0.20 version: 1.0.20 '@dydxprotocol/v4-localization': - specifier: ^1.1.24 - version: 1.1.24 + specifier: ^1.1.25 + version: 1.1.25 '@ethersproject/providers': specifier: ^5.7.2 version: 5.7.2 @@ -1121,8 +1125,8 @@ packages: - utf-8-validate dev: false - /@dydxprotocol/v4-localization@1.1.24: - resolution: {integrity: sha512-75XpxxYTpy8eIFcJINyLlvw5J93t0TrS5LacE6J5Raz9LOUWRK4VyRbdLCU2QX8AG7xiTZk1ma8ytylVZOVx3A==} + /@dydxprotocol/v4-localization@1.1.25: + resolution: {integrity: sha512-84BJMybnZBrRnDpnHlMUcOYT1r0ODtgcdgrjdzTw8b0sViTY6ne9ob690fcn/vQO+6sEdDsdt+08ud0H+ZvyYg==} dev: false /@dydxprotocol/v4-proto@4.0.0-dev.0: @@ -14912,7 +14916,3 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: true - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false diff --git a/public/configs/env.json b/public/configs/env.json index 913e22c..a3a3dea 100644 --- a/public/configs/env.json +++ b/public/configs/env.json @@ -93,6 +93,7 @@ "documentation": "https://docs.dydx.exchange/", "community": "https://discord.com/invite/dydx", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -175,6 +176,7 @@ "documentation": "https://docs.dydx.exchange/", "community": "https://discord.com/invite/dydx", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -258,6 +260,7 @@ "documentation": "https://docs.dydx.exchange/", "community": "https://discord.com/invite/dydx", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -340,6 +343,7 @@ "documentation": "https://docs.dydx.exchange/", "community": "https://discord.com/invite/dydx", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -424,6 +428,7 @@ "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -503,7 +508,8 @@ "documentation": "https://v4-teacher.vercel.app/", "community": "https://discord.com/invite/dydx", "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog" + "blogs": "https://www.dydx.foundation/blog", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals" }, "wallets": { "walletconnect": { @@ -591,6 +597,7 @@ "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -679,6 +686,7 @@ "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -764,6 +772,7 @@ "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -849,6 +858,7 @@ "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -934,6 +944,7 @@ "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -1019,6 +1030,7 @@ "reduceOnlyLearnMore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnMore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnMore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnMore": "https://help.dydx.exchange/en/articles/8565867-secret-phrase-on-dydx-chain", @@ -1099,7 +1111,8 @@ "documentation": "https://docs.dydx.exchange/", "community": "https://discord.com/invite/dydx", "feedback": "https://docs.google.com/forms/d/e/1FAIpQLSezLsWCKvAYDEb7L-2O4wOON1T56xxro9A2Azvl6IxXHP_15Q/viewform", - "blogs": "https://www.dydx.foundation/blog" + "blogs": "https://www.dydx.foundation/blog", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals" }, "wallets": { "walletconnect": { @@ -1181,6 +1194,7 @@ "reduceOnlyLearnmore": "https://help.dydx.exchange/articles/6345793-reduce-only-orders", "mintscanBase": "https://testnet.mintscan.io/dydx-testnet", "governanceLearnmore": "https://help.dydx.exchange", + "newMarketProposalLearnMore": "https://dydx.exchange/blog/new-market-proposals", "stakingLearnmore": "https://help.dydx.exchange", "keplrDashboard": "https://testnet.keplr.app/", "accountExportLearnmore": "https://help.dydx.exchange", @@ -1266,6 +1280,7 @@ "community": "[HTTP link to community, can be null]", "help": "[HTTP link to help page, can be null]", "governanceLearnMore": "[HTTP link to governance learn more, can be null]", + "newMarketProposalLearnMore": "[HTTP link to new market proposal learn more, can be null]", "stakingLearnMore": "[HTTP link to staking learn more, can be null]", "keplrDashboard": "[HTTP link to keplr dashboard, can be null]", "accountExportLearnMore": "[HTTP link to account export learn more, can be null]", diff --git a/public/configs/markets.json b/public/configs/markets.json index f743aa3..f896c1d 100644 --- a/public/configs/markets.json +++ b/public/configs/markets.json @@ -176,6 +176,13 @@ "whitepaperLink": "https://dfinity.org/whitepaper.pdf", "coinMarketCapsLink": "https://coinmarketcap.com/currencies/internet-computer/" }, + "JUP-USD": { + "name": "Jupiter", + "tags": ["Defi"], + "websiteLink": "https://station.jup.ag/", + "whitepaperLink": "https://station.jup.ag/blog/green-paper", + "coinMarketCapsLink": "https://coinmarketcap.com/currencies/jupiter-ag/" + }, "LDO-USD": { "name": "Lido DAO", "tags": ["Defi"], diff --git a/public/currencies/jup.png b/public/currencies/jup.png new file mode 100644 index 0000000000000000000000000000000000000000..82e518e2b2a9457e30fee8752e897027e0b613cd GIT binary patch literal 11451 zcmV;sEJV|ZP)$)|kVfQ@X-6&o;+CkcTBlgUgnWH!LFvy-ryUBYg5CfUq0 z3CZq4o+lY#LN*}}0UH7sV~mX*@PTdlwk6q;Z{2QLhb2qun(zDT`m4Lu>Pxb0ctP&! z>h7xQ`rrDF_xt{81venl^D2tq8K{CsDT0D29w_MwR9dFz3{@@i`$0u%q}SZEm)fiIes6aKXD&o}`9WXg+=%m#^QMbVnTjOpz z-iYfM*Bt@Ui;B|G7gL2H+@~ta+F`Heu|tgtrN-e@Uv@XuZ^dxKa7d8O5!A>~mr zke*Xk z#JD5?U+wA;o`L4mZv<>roOpITx`=T_fE#e&y`VJG34hkzTK5vh3C0BhZv27w#`qz^ zH6;M2aO%+Di}=h8ycZO#R~#`KP9zXy+pBjqA|c2NP<^JIK-CK7W} z5A?a+eHdemxdqV7y+T+0HP7G28OSZD>SOM4_>zJBP#&#(GmLDsdgD(VpX`aFD&V3AI- z!Menh%>KTfj-41qj4Ad8`8`k9LUHuL(F^Od5R5-Pq_xlo53T=(+tHv{;2P1`qb^C3)hpL?3ViJkH86 z-;xF%?9wRbDp9E1Oz<7@Ih3O|^%wCjdS_v64 z2||HP8nzDWUpk79-#;_Tt|Gc5hzbF&w=~a)1#W+^RFHu!Mj*)Ug9lrV8|?2>DQ4&) z_t1=2ezAWPtwQuj5HSI6gdCr(!>R{Lanl`>ZDcUazHI&j5x^Vo|EZpcP%}zIhz@%1!l&6ENrr^F$b0!hB|y{&-^f7Zf4<=h#kH z!X`j!Zs{}hHNTA;7@YFG|9U+(zkX6^2`(Z-a$3B2&3lk#7hymqL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6sew}4-v-i z5_~2x3c=oRa9|9;U!=38u2}J?&*5_f1e<&%X<+VH48FF%F$TGWYSp2<__;Ok0$=qW z^)V{yY{eKN>RG@@5S>MoB`6L@KhdumpF>phxQ8#;Hm<1d8`lsV8(?toXVLog^6L$B z^0&en^VnFK`(cjZ+9N%uY@NsyJ|k{H47^su-->IDaX|nBH#!l<)4&@TR|GJ?fg&B* zGb(P37-2jPyn%5^00SaM7#dYPH~l%MmjKBo`&Tgl>TW~eGX^0KFsKHDgs55?A8?}P0R{{bd! VoikC@T=M_`002ovPDHLkV1hN6w9)_o literal 0 HcmV?d00001 diff --git a/src/components/AssetIcon.tsx b/src/components/AssetIcon.tsx index 9d30239..2a977d6 100644 --- a/src/components/AssetIcon.tsx +++ b/src/components/AssetIcon.tsx @@ -31,6 +31,7 @@ const assetIcons = { ETH: '/currencies/eth.png', FIL: '/currencies/fil.png', ICP: '/currencies/icp.png', + JUP: '/currencies/jup.png', LDO: '/currencies/ldo.png', LINK: '/currencies/link.png', LTC: '/currencies/ltc.png', diff --git a/src/constants/potentialMarkets.ts b/src/constants/potentialMarkets.ts index da2707d..e2292c3 100644 --- a/src/constants/potentialMarkets.ts +++ b/src/constants/potentialMarkets.ts @@ -1,42 +1,9 @@ -export type ExchangeConfigParsedCsv = Array<{ - base_asset: string; - exchange: string; - pair: string; - - adjust_by_market: string; - min_2_depth: string; - avg_30d_vol: string; - reference_price: string; - risk_assessment: string; - num_oracles: string; - liquidity_tier: string; - asset_name: string; -}>; - export type ExchangeConfigItem = { exchangeName: string; ticker: string; adjustByMarket?: string; }; -export type PotentialMarketParsedCsv = Array<{ - base_asset: string; - reference_price: string; - num_oracles: string; - liquidity_tier: string; - asset_name: string; - p: string; - atomic_resolution: string; - min_exchanges: string; - min_price_change_ppm: string; - price_exponent: string; - step_base_quantum: string; - ticksize_exponent: string; - subticks_per_tick: string; - min_order_size: string; - quantum_conversion_exponent: string; -}>; - export type PotentialMarketItem = { baseAsset: string; referencePrice: string; @@ -56,30 +23,3 @@ export type PotentialMarketItem = { }; export const NUM_ORACLES_TO_QUALIFY_AS_SAFE = 6; - -export const LIQUIDITY_TIERS = { - 0: { - label: 'Large-cap', - initialMarginFraction: 0.05, - maintenanceMarginFraction: 0.03, - impactNotional: 10_000, - }, - 1: { - label: 'Mid-cap', - initialMarginFraction: 0.1, - maintenanceMarginFraction: 0.05, - impactNotional: 5_000, - }, - 2: { - label: 'Long-tail', - initialMarginFraction: 0.2, - maintenanceMarginFraction: 0.1, - impactNotional: 2_500, - }, - 3: { - label: 'Safety', - initialMarginFraction: 1, - maintenanceMarginFraction: 0.2, - impactNotional: 2_500, - }, -}; diff --git a/src/hooks/usePotentialMarkets.tsx b/src/hooks/usePotentialMarkets.tsx index c1391a0..af1a9d8 100644 --- a/src/hooks/usePotentialMarkets.tsx +++ b/src/hooks/usePotentialMarkets.tsx @@ -1,18 +1,42 @@ -import { createContext, useContext, useEffect, useState } from 'react'; +import { createContext, useContext, useEffect, useMemo, useState } from 'react'; -import type { - ExchangeConfigItem, - ExchangeConfigParsedCsv, - PotentialMarketItem, - PotentialMarketParsedCsv, -} from '@/constants/potentialMarkets'; +import { STRING_KEYS } from '@/constants/localization'; +import type { ExchangeConfigItem, PotentialMarketItem } from '@/constants/potentialMarkets'; import { log } from '@/lib/telemetry'; +import { useStringGetter } from './useStringGetter'; + const PotentialMarketsContext = createContext>({ potentialMarkets: undefined, exchangeConfigs: undefined, hasPotentialMarketsData: false, + liquidityTiers: { + 0: { + label: 'Large-cap', + initialMarginFraction: 0.05, + maintenanceMarginFraction: 0.03, + impactNotional: 10_000, + }, + 1: { + label: 'Mid-cap', + initialMarginFraction: 0.1, + maintenanceMarginFraction: 0.05, + impactNotional: 5_000, + }, + 2: { + label: 'Long-tail', + initialMarginFraction: 0.2, + maintenanceMarginFraction: 0.1, + impactNotional: 2_500, + }, + 3: { + label: 'Safety', + initialMarginFraction: 1, + maintenanceMarginFraction: 0.2, + impactNotional: 2_500, + }, + }, }); PotentialMarketsContext.displayName = 'PotentialMarkets'; @@ -27,6 +51,7 @@ const EXCHANGE_CONFIG_FILE_PATH = '/configs/potentialMarketExchangeConfig.json'; const POTENTIAL_MARKETS_FILE_PATH = '/configs/potentialMarketParameters.json'; export const usePotentialMarketsContext = () => { + const stringGetter = useStringGetter(); const [potentialMarkets, setPotentialMarkets] = useState(); const [exchangeConfigs, setExchangeConfigs] = useState>(); @@ -54,9 +79,40 @@ export const usePotentialMarketsContext = () => { } }, []); + const liquidityTiers = useMemo( + () => ({ + 0: { + label: stringGetter({ key: STRING_KEYS.LARGE_CAP }), + initialMarginFraction: 0.05, + maintenanceMarginFraction: 0.03, + impactNotional: 10_000, + }, + 1: { + label: 'Mid-cap', + initialMarginFraction: 0.1, + maintenanceMarginFraction: 0.05, + impactNotional: 5_000, + }, + 2: { + label: stringGetter({ key: STRING_KEYS.LONG_TAIL }), + initialMarginFraction: 0.2, + maintenanceMarginFraction: 0.1, + impactNotional: 2_500, + }, + 3: { + label: stringGetter({ key: STRING_KEYS.SAFETY }), + initialMarginFraction: 1, + maintenanceMarginFraction: 0.2, + impactNotional: 2_500, + }, + }), + [stringGetter] + ); + return { potentialMarkets, exchangeConfigs, hasPotentialMarketsData: Boolean(potentialMarkets && exchangeConfigs), + liquidityTiers, }; }; diff --git a/src/hooks/useURLConfigs.ts b/src/hooks/useURLConfigs.ts index 9c92cd1..570fdff 100644 --- a/src/hooks/useURLConfigs.ts +++ b/src/hooks/useURLConfigs.ts @@ -5,23 +5,24 @@ import { useSelectedNetwork } from '@/hooks'; const FALLBACK_URL = 'https://help.dydx.exchange/'; export interface LinksConfigs { - tos: string, - privacy: string, - mintscan: string, - mintscanBase: string, - feedback?: string, - help?: string, - blogs?: string, - foundation?: string, - initialMarginFractionLearnMore?: string, - reduceOnlyLearnMore?: string, - documentation?: string, - community?: string, - governanceLearnMore?: string, - stakingLearnMore?: string, - keplrDashboard?: string, - accountExportLearnMore?: string, - walletLearnMore?: string + tos: string; + privacy: string; + mintscan: string; + mintscanBase: string; + feedback?: string; + help?: string; + blogs?: string; + foundation?: string; + initialMarginFractionLearnMore?: string; + reduceOnlyLearnMore?: string; + documentation?: string; + community?: string; + governanceLearnMore?: string; + newMarketProposalLearnMore: string; + stakingLearnMore?: string; + keplrDashboard?: string; + accountExportLearnMore?: string; + walletLearnMore?: string; } export const useURLConfigs = (): LinksConfigs => { @@ -42,6 +43,7 @@ export const useURLConfigs = (): LinksConfigs => { documentation: linksConfigs.documentation || FALLBACK_URL, community: linksConfigs.community || FALLBACK_URL, governanceLearnMore: linksConfigs.governanceLearnMore || FALLBACK_URL, + newMarketProposalLearnMore: linksConfigs.newMarketProposalLearnMore || FALLBACK_URL, stakingLearnMore: linksConfigs.stakingLearnMore || FALLBACK_URL, keplrDashboard: linksConfigs.keplrDashboard || FALLBACK_URL, accountExportLearnMore: linksConfigs.accountExportLearnMore || FALLBACK_URL, diff --git a/src/views/forms/NewMarketForm/NewMarketPreviewStep.tsx b/src/views/forms/NewMarketForm/NewMarketPreviewStep.tsx index d4edce3..e57b31e 100644 --- a/src/views/forms/NewMarketForm/NewMarketPreviewStep.tsx +++ b/src/views/forms/NewMarketForm/NewMarketPreviewStep.tsx @@ -11,7 +11,7 @@ import { DialogTypes } from '@/constants/dialogs'; import { STRING_KEYS } from '@/constants/localization'; import { isMainnet } from '@/constants/networks'; import { NumberSign, TOKEN_DECIMALS } from '@/constants/numbers'; -import { LIQUIDITY_TIERS, type PotentialMarketItem } from '@/constants/potentialMarkets'; +import type { PotentialMarketItem } from '@/constants/potentialMarkets'; import { useAccountBalance, @@ -19,6 +19,7 @@ import { useStringGetter, useSubaccount, useTokenConfigs, + useURLConfigs, } from '@/hooks'; import { usePotentialMarkets } from '@/hooks/usePotentialMarkets'; @@ -31,6 +32,7 @@ import { DiffOutput } from '@/components/DiffOutput'; import { FormInput } from '@/components/FormInput'; import { Icon, IconName } from '@/components/Icon'; import { InputType } from '@/components/Input'; +import { Link } from '@/components/Link'; import { Output, OutputType } from '@/components/Output'; import { Tag } from '@/components/Tag'; import { WithDetailsReceipt } from '@/components/WithDetailsReceipt'; @@ -62,9 +64,10 @@ export const NewMarketPreviewStep = ({ const stringGetter = useStringGetter(); const { chainTokenDecimals, chainTokenLabel } = useTokenConfigs(); const [errorMessage, setErrorMessage] = useState(); - const { exchangeConfigs } = usePotentialMarkets(); + const { exchangeConfigs, liquidityTiers } = usePotentialMarkets(); const { submitNewMarketProposal } = useSubaccount(); const { newMarketProposal } = useGovernanceVariables(); + const { newMarketProposalLearnMore } = useURLConfigs(); const initialDepositAmountBN = MustBigNumber(newMarketProposal.initialDepositAmount).div( Number(`1e${chainTokenDecimals}`) ); @@ -73,7 +76,7 @@ export const NewMarketPreviewStep = ({ const [hasAcceptedTerms, setHasAcceptedTerms] = useState(false); const { label, initialMarginFraction, maintenanceMarginFraction, impactNotional } = - LIQUIDITY_TIERS[liquidityTier as unknown as keyof typeof LIQUIDITY_TIERS]; + liquidityTiers[liquidityTier as unknown as keyof typeof liquidityTiers]; const ticker = `${assetData.baseAsset}-USD`; @@ -311,10 +314,15 @@ export const NewMarketPreviewStep = ({ {stringGetter({ - key: STRING_KEYS.PROPOSAL_DISCLAIMER, + key: STRING_KEYS.PROPOSAL_DISCLAIMER_1, params: { NUM_TOKENS_REQUIRED: initialDepositAmount, NATIVE_TOKEN_DENOM: chainTokenLabel, + HERE: ( + + {stringGetter({ key: STRING_KEYS.HERE })} + + ), }, })} @@ -394,3 +402,8 @@ Styled.ButtonRow = styled.div` Styled.Button = styled(Button)` --button-padding: 0; `; + +Styled.Link = styled(Link)` + --link-color: var(--color-accent); + display: inline; +`; diff --git a/src/views/forms/NewMarketForm/NewMarketSelectionStep.tsx b/src/views/forms/NewMarketForm/NewMarketSelectionStep.tsx index a2bbd1c..c3ffda6 100644 --- a/src/views/forms/NewMarketForm/NewMarketSelectionStep.tsx +++ b/src/views/forms/NewMarketForm/NewMarketSelectionStep.tsx @@ -12,7 +12,6 @@ import { isMainnet } from '@/constants/networks'; import { TOKEN_DECIMALS } from '@/constants/numbers'; import { - LIQUIDITY_TIERS, NUM_ORACLES_TO_QUALIFY_AS_SAFE, type PotentialMarketItem, } from '@/constants/potentialMarkets'; @@ -74,7 +73,7 @@ export const NewMarketSelectionStep = ({ const { isMobile } = useBreakpoints(); const marketIds = useSelector(getMarketIds, shallowEqual); const { chainTokenDecimals, chainTokenLabel } = useTokenConfigs(); - const { potentialMarkets, exchangeConfigs } = usePotentialMarkets(); + const { potentialMarkets, exchangeConfigs, liquidityTiers } = usePotentialMarkets(); const stringGetter = useStringGetter(); const { newMarketProposal } = useGovernanceVariables(); const initialDepositAmountBN = MustBigNumber(newMarketProposal.initialDepositAmount).div( @@ -166,7 +165,7 @@ export const NewMarketSelectionStep = ({ {assetToAdd?.assetName ?? assetToAdd.baseAsset} {assetToAdd?.baseAsset}-USD ) : ( - 'e.g. "BTC-USD"' + `${stringGetter({ key: STRING_KEYS.EG })} "BTC-USD"` )} {assetToAdd && ( @@ -210,9 +209,9 @@ export const NewMarketSelectionStep = ({ - {Object.keys(LIQUIDITY_TIERS).map((tier) => { + {Object.keys(liquidityTiers).map((tier) => { const { maintenanceMarginFraction, impactNotional, label, initialMarginFraction } = - LIQUIDITY_TIERS[tier as unknown as keyof typeof LIQUIDITY_TIERS]; + liquidityTiers[tier as unknown as keyof typeof liquidityTiers]; return (