Skip to content

Commit

Permalink
Merge pull request #240 from mrgnlabs/man0s/generic-rewards
Browse files Browse the repository at this point in the history
feat(mfi-v2-ui): semi-generic LM display
  • Loading branch information
losman0s authored Sep 19, 2023
2 parents bfc5d77 + 8e8edec commit 84d257b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
Binary file added apps/marginfi-v2-ui/public/blze.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ import { useWalletContext } from "~/components/useWalletContext";

const CLOSE_BALANCE_TOAST_ID = "close-balance";
const BORROW_OR_LEND_TOAST_ID = "borrow-or-lend";
const EMISSION_MINT_INFO_MAP = new Map<string, { tokenSymbol: string; tokenLogoUri: string }>([
[
"UXD",
{
tokenSymbol: "UXP",
tokenLogoUri: "/uxp-icon-white.png",
},
],
[
"bSOL",
{
tokenSymbol: "BLZE",
tokenLogoUri: "/blze.png",
},
],
]);

const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} classes={{ popper: className }} />
Expand Down Expand Up @@ -394,7 +410,7 @@ const AssetRow: FC<{
}}
>
<div className="h-full w-full flex justify-end items-center gap-3">
{bank.meta.tokenSymbol === "UXD" && isInLendingMode && (
{bank.info.state.emissionsRate > 0 && EMISSION_MINT_INFO_MAP.get(bank.meta.tokenSymbol) !== undefined && isInLendingMode && (
<div className="w-1/2 flex justify-center sm:justify-end">
<HtmlTooltip
title={
Expand All @@ -404,7 +420,7 @@ const AssetRow: FC<{
</Typography>
{`${percentFormatter.format(bank.info.state.lendingRate)} Supply APY + ${percentFormatter.format(
bank.info.state.emissionsRate
)} UXP rewards.`}
)} ${EMISSION_MINT_INFO_MAP.get(bank.meta.tokenSymbol)!.tokenSymbol} rewards.`}
<br />
<a href="https://docs.marginfi.com">
<u>Learn more.</u>
Expand All @@ -413,7 +429,13 @@ const AssetRow: FC<{
}
placement="left"
>
<Image src="/uxp-icon-white.png" alt="info" height={16} width={16} className="pulse" />
<Image
src={EMISSION_MINT_INFO_MAP.get(bank.meta.tokenSymbol)!.tokenLogoUri}
alt="info"
height={16}
width={16}
className="pulse"
/>
</HtmlTooltip>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/marginfi-v2-ui-state/src/lib/points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const getPointsDataForUser = async (wallet: string | undefined): Promise<UserPoi
depositPoints,
borrowPoints,
referralPoints,
referralLink: pointsData.referral_link,
referralLink: userReferralCode,
isCustomReferralLink,
userRank,
totalPoints,
Expand Down

2 comments on commit 84d257b

@vercel
Copy link

@vercel vercel bot commented on 84d257b Sep 19, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

omni – ./apps/omni

omni-mrgn.vercel.app
omni-one.vercel.app
omni-git-production-mrgn.vercel.app
omni.marginfi.com

@vercel
Copy link

@vercel vercel bot commented on 84d257b Sep 19, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.