Skip to content

Conversation

@fionn223
Copy link
Contributor

Changes

  • VIP notification for users with $50k+ portfolio (equity + vault balance)
  • Shows once per browser session to connected wallets
  • Links to dYdX Whale Traders Telegram group
  • Uses proper localization
  • Minor styling updates to Free Deposit banner (line height, background)
  • Update localization package to v1.1.326

@fionn223 fionn223 requested a review from a team as a code owner September 26, 2025 09:11
@vercel
Copy link

vercel bot commented Sep 26, 2025

@fionn223 is attempting to deploy a commit to the dYdX Trading Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Sep 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
v4-staging Ready Ready Preview Comment Sep 26, 2025 2:43pm
v4-testnet Ready Ready Preview Comment Sep 26, 2025 2:43pm

@tyleroooo tyleroooo changed the title Add vip telegram notification for high-value users feat: add vip telegram notification for high-value users Sep 26, 2025
const turnkeyFF = useStatsigGateValue(StatsigFlags.ffTurnkeyWeb);

return forcedTurnkey || turnkeyFF;
return forcedTurnkey ?? turnkeyFF;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this failing lint or something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to undo this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forcedTurnkey will never be nullish


const title = stringGetter({
key: STRING_KEYS.YOURE_INVITED,
fallback: "You're Invited",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove fallbacks for now, it might actually be a good idea but it's best to follow the practices in the rest of the app

isToast,
notification,
portfolioValue: _portfolioValue,
telegramUrl = 'https://t.me/+NLOpf5jiAEVjODFh',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredvu do you think we should make this a config of some sort? Any risk here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the default telegrameUrl here and instead add it to

public/configs/v1/env.json under links for all environments except [mainnet_chain_id] as telegramVipUrl.

then you have to update useURLConfigs to return telegramVipUrl

export const VipTelegramNotification = ({
isToast,
notification,
portfolioValue: _portfolioValue,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why start with _?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed?

);
};

const $Icon = styled.img`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just inline all of these with tw=''

return;
}

const totalValue = equity != null ? equity + (vaultBalance ?? 0) : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could probably just be (equity ?? 0) + (vaultBalance ?? 0)


const title = stringGetter({
key: STRING_KEYS.YOURE_INVITED,
fallback: "You're Invited",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably don't need fallbacks here either

sessionStorage.setItem('vip-telegram-notification-shown', 'true');

trigger({
id: `vip-telegram-invitation-${Date.now()}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why include date in the id?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to remove it to get the notification localstorage behavior working

isToast={isToast}
notification={notification}
portfolioValue={totalValue}
telegramUrl="https://t.me/+NLOpf5jiAEVjODFh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird that this is hardcoded in two places

}, [equity, isConnected, stringGetter, trigger, vaultBalance]);
},

useNotificationAction: () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can probably just remove this or remove the comment at least

const equity = useAppSelector(getSubaccountEquity, shallowEqual);
const { data: vaultAccount } = useLoadedVaultAccount();
const vaultBalance = vaultAccount?.balanceUsdc;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After following steps in https://github.com/dydxprotocol/v4-web/pull/1901/files/50fdb651b95914e94f9965d01573902e02f13b37#r2383062316

You can use const { telegramVipUrl } = useUrlConfigs() and return if it doesn't exist, otherwise pass it into the notification being triggered.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we want to go through the trouble of adding it to the env config is so third party deployers that fork this repo are not forced to use these links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants