diff --git a/src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx b/src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx index 2f9f266c70..d7d5aa2f82 100644 --- a/src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +++ b/src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx @@ -4,6 +4,7 @@ import { lightFormat } from "date-fns"; import { useState } from "react"; import { useCopyToClipboard } from "react-use"; +import { REFERRALS_DOCS_URL } from "config/links"; import { useAffiliateTier, useCodeOwner, @@ -12,13 +13,18 @@ import { useTraderReferralStats, useUserReferralCode, } from "domain/referrals"; -import { getReferralCodeTradeUrl, getSharePercentage } from "domain/referrals/utils/referralsHelper"; +import { + getProtocolReferralCodeType, + getReferralCodeTradeUrl, + getSharePercentage, +} from "domain/referrals/utils/referralsHelper"; import { useTimeRange } from "domain/synthetics/markets/useTimeRange"; import { useChainId } from "lib/chains"; import { helperToast } from "lib/helperToast"; import { formatUsd } from "lib/numbers"; import Button from "components/Button/Button"; +import ExternalLink from "components/ExternalLink/ExternalLink"; import { Faq } from "components/Faq/Faq"; import ModalWithPortal from "components/Modal/ModalWithPortal"; import { ReferralsDocsCard } from "components/Referrals/shared/cards/ReferralsDocsCard"; @@ -147,14 +153,7 @@ export function ReferralsTradersContent({ account }: ReferralsTradersContentProp - -
- You're now receiving a {currentTierDiscount}% discount on your trades! -
-
- The reduced rate applies to every open and close fee. -
-
+
@@ -184,6 +183,55 @@ function Card({ children, className }: { children: React.ReactNode; className?: ); } +function ActiveCodeExplanation({ + currentTierDiscount, + codeString, +}: { + currentTierDiscount: string | number | undefined; + codeString: string | undefined; +}) { + const protocolCodeType = getProtocolReferralCodeType(codeString); + + if (protocolCodeType === "organic") { + return ( +
+ + You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a{" "} + {currentTierDiscount}% discount on opening and closing fees.{" "} + + Read more + + +
+ ); + } + + if (protocolCodeType === "graduated") { + return ( +
+ + Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral + program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees.{" "} + + Read more + + +
+ ); + } + + return ( + +
+ You're now receiving a {currentTierDiscount}% discount on your trades! +
+
+ The reduced rate applies to every open and close fee. +
+
+ ); +} + function formatUsdDelta(value: bigint): string { return formatUsd(value, { displayPlus: value >= 0n }) ?? ""; } diff --git a/src/domain/referrals/utils/referralsHelper.ts b/src/domain/referrals/utils/referralsHelper.ts index 5d76b6fa67..656bc21dbb 100644 --- a/src/domain/referrals/utils/referralsHelper.ts +++ b/src/domain/referrals/utils/referralsHelper.ts @@ -124,3 +124,20 @@ export function getCodeError(value: string): string { export function getReferralCodeTradeUrl(referralCode: string): string { return `${getRootUrl()}/#/trade/?${REFERRAL_CODE_QUERY_PARAM}=${referralCode}`; } + +export type ProtocolReferralCodeType = "organic" | "graduated"; + +const PROTOCOL_REFERRAL_CODES: Record = { + EARNED_TRADER_DISCOUNT_5: "organic", + EARNED_TRADER_DISCOUNT_10: "organic", + DIRECT_GMX_DISCOUNT_5: "graduated", + DIRECT_GMX_DISCOUNT_10: "graduated", +}; + +export function getProtocolReferralCodeType(codeString: string | undefined): ProtocolReferralCodeType | undefined { + if (!codeString) { + return undefined; + } + + return PROTOCOL_REFERRAL_CODES[codeString]; +} diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index 0befb0df59..d129f15c4e 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -6695,6 +6695,10 @@ msgstr "TP/SL-Orders überschreiten die Position" msgid "pay" msgstr "zahlen" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Ihr bisheriger Empfehlungscode wurde durch einen GMX-Protokollcode ersetzt, nachdem Ihre Trades die Abschluss-Schwelle des Empfehlungsprogramms erreicht haben. Sie behalten Ihren {currentTierDiscount}% Rabatt auf Eröffnungs- und Schließungsgebühren. <0>Mehr erfahren" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "Keine Möglichkeiten entsprechen Ihren Beständen" @@ -10221,6 +10225,10 @@ msgstr "Erneut signieren" msgid "Depositing to GMX Account..." msgstr "Einzahlung auf GMX Account..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Sie haben eine Handelsvolumen-Schwelle erreicht, daher hat GMX Ihnen diesen Protokoll-Empfehlungscode zugewiesen. Sie erhalten {currentTierDiscount}% Rabatt auf Eröffnungs- und Schließungsgebühren. <0>Mehr erfahren" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index e890a303f2..706f4c54f7 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -6695,6 +6695,10 @@ msgstr "TP/SL orders exceed the position" msgid "pay" msgstr "pay" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "No opportunities match your holdings" @@ -10221,6 +10225,10 @@ msgstr "Re-sign" msgid "Depositing to GMX Account..." msgstr "Depositing to GMX Account..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index ec0fc13139..5e2da2d95d 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -6695,6 +6695,10 @@ msgstr "Órdenes TP/SL exceden la posición" msgid "pay" msgstr "pagar" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Tu código de referido anterior fue reemplazado por un código del protocolo GMX después de que tus operaciones alcanzaran el umbral de graduación del programa de referidos. Conservas tu descuento del {currentTierDiscount}% en las comisiones de apertura y cierre. <0>Más información" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "Ninguna oportunidad coincide con sus tenencias" @@ -10221,6 +10225,10 @@ msgstr "Re-firmar" msgid "Depositing to GMX Account..." msgstr "Depositando en GMX Account..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Has alcanzado un umbral de volumen de trading, por lo que GMX te asignó este código de referido del protocolo. Estás recibiendo un descuento del {currentTierDiscount}% en las comisiones de apertura y cierre. <0>Más información" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 2c8ee325f0..839ec2772e 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -6695,6 +6695,10 @@ msgstr "Les ordres TP/SL dépassent la position" msgid "pay" msgstr "payer" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Votre code de parrainage précédent a été remplacé par un code de protocole GMX après que vos transactions ont atteint le seuil de fin du programme de parrainage. Vous conservez votre réduction de {currentTierDiscount}% sur les frais d'ouverture et de clôture. <0>En savoir plus" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "Aucune opportunité ne correspond à vos avoirs" @@ -10221,6 +10225,10 @@ msgstr "Re-signer" msgid "Depositing to GMX Account..." msgstr "Dépôt vers GMX Account en cours..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Vous avez atteint un seuil de volume de trading, donc GMX vous a attribué ce code de parrainage du protocole. Vous bénéficiez d'une réduction de {currentTierDiscount}% sur les frais d'ouverture et de clôture. <0>En savoir plus" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 743e557b79..afe9862cc6 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -6695,6 +6695,10 @@ msgstr "TP/SL注文がポジションを超過" msgid "pay" msgstr "支払い" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "お取引が紹介プログラムの卒業しきい値に達したため、以前の紹介コードはGMXプロトコルコードに置き換えられました。オープンおよびクローズ手数料の{currentTierDiscount}%割引は維持されます。<0>詳細" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "お持ちの資産に一致する機会はありません" @@ -10221,6 +10225,10 @@ msgstr "再署名" msgid "Depositing to GMX Account..." msgstr "GMX Account に入金中..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "取引高のしきい値に達したため、GMXがこのプロトコル紹介コードを割り当てました。オープンおよびクローズ手数料が{currentTierDiscount}%割引されます。<0>詳細" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index 1796d0f480..9203cab061 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -6695,6 +6695,10 @@ msgstr "TP/SL 주문이 포지션을 초과합니다" msgid "pay" msgstr "지불" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "거래가 추천 프로그램의 졸업 기준에 도달한 후 이전 추천 코드가 GMX 프로토콜 코드로 대체되었습니다. 개시 및 종료 수수료에 대한 {currentTierDiscount}% 할인이 유지됩니다. <0>자세히 보기" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "보유 자산과 일치하는 기회가 없습니다" @@ -10221,6 +10225,10 @@ msgstr "재서명" msgid "Depositing to GMX Account..." msgstr "GMX Account에 입금 중..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "거래량 기준에 도달하여 GMX가 이 프로토콜 추천 코드를 할당했습니다. 개시 및 종료 수수료에 대해 {currentTierDiscount}% 할인을 받고 있습니다. <0>자세히 보기" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index e1add70abc..dadd7d5ba3 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -6695,6 +6695,10 @@ msgstr "" msgid "pay" msgstr "" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "" @@ -10221,6 +10225,10 @@ msgstr "" msgid "Depositing to GMX Account..." msgstr "" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 3b978a5b64..a379b4a421 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -6695,6 +6695,10 @@ msgstr "Ордера TP/SL превышают позицию" msgid "pay" msgstr "оплатить" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Ваш предыдущий реферальный код был заменён на протокольный код GMX после того, как объём ваших сделок достиг порога завершения реферальной программы. Вы сохраняете скидку {currentTierDiscount}% на комиссии за открытие и закрытие. <0>Подробнее" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "Нет возможностей, соответствующих вашим активам" @@ -10221,6 +10225,10 @@ msgstr "Переподписать" msgid "Depositing to GMX Account..." msgstr "Депозит на GMX Account..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "Вы достигли порога объёма торгов, поэтому GMX присвоил вам этот протокольный реферальный код. Вы получаете скидку {currentTierDiscount}% на комиссии за открытие и закрытие. <0>Подробнее" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/zh-tw/messages.po b/src/locales/zh-tw/messages.po index d153922487..94316419c1 100644 --- a/src/locales/zh-tw/messages.po +++ b/src/locales/zh-tw/messages.po @@ -6695,6 +6695,10 @@ msgstr "TP/SL 訂單超過倉位" msgid "pay" msgstr "支付" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "在您的交易達到推薦計畫的畢業門檻後,您先前的推薦碼已被替換為 GMX 協議碼。您將保留開倉和平倉費用 {currentTierDiscount}% 的折扣。<0>瞭解更多" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "沒有符合您持有資產的機會" @@ -10221,6 +10225,10 @@ msgstr "重新簽署" msgid "Depositing to GMX Account..." msgstr "正在存入至 GMX Account..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "您已達到交易量門檻,因此 GMX 為您分配了此協議推薦碼。您將享有開倉和平倉費用 {currentTierDiscount}% 的折扣。<0>瞭解更多" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 3683d05c2b..97677cc42a 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -6695,6 +6695,10 @@ msgstr "TP/SL 订单超过头寸" msgid "pay" msgstr "支付" +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "Your previous referral code has been replaced with a GMX protocol code after your trades reached the referral program's graduation threshold. You keep your {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "在您的交易达到推荐计划的毕业门槛后,您之前的推荐码已被替换为 GMX 协议码。您将保留开仓和平仓费用 {currentTierDiscount}% 的折扣。<0>了解更多" + #: src/pages/Earn/EarnAdditionalOpportunitiesPage.tsx msgid "No opportunities match your holdings" msgstr "没有与您持仓匹配的机会" @@ -10221,6 +10225,10 @@ msgstr "重新签名" msgid "Depositing to GMX Account..." msgstr "正在存入 GMX Account..." +#: src/components/Referrals/traders/dashboard/ReferralsTradersContent.tsx +msgid "You've reached a trading volume threshold, so GMX assigned this protocol referral code. You're receiving a {currentTierDiscount}% discount on opening and closing fees. <0>Read more" +msgstr "您已达到交易量门槛,因此 GMX 为您分配了此协议推荐码。您将享受开仓和平仓费用 {currentTierDiscount}% 的折扣。<0>了解更多" + #: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/GmxAccountModal/MainView.tsx msgid "Address copied"