Skip to content

Commit

Permalink
fix: remove GHO borrow reward - Merit round 7 (#2127)
Browse files Browse the repository at this point in the history
  • Loading branch information
NandyBa authored Jul 30, 2024
1 parent a9d6eb6 commit ac0ad3b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 108 deletions.
12 changes: 1 addition & 11 deletions src/components/transactions/Borrow/GhoBorrowModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
import { useGhoPoolReserve } from 'src/hooks/pool/useGhoPoolReserve';
import { useUserGhoPoolReserve } from 'src/hooks/pool/useUserGhoPoolReserve';
import { useAssetCaps } from 'src/hooks/useAssetCaps';
import { useMeritIncentives } from 'src/hooks/useMeritIncentives';
import { useModalContext } from 'src/hooks/useModal';
import { useRootStore } from 'src/store/root';
import { CustomMarket } from 'src/ui-config/marketsConfig';
Expand All @@ -39,11 +38,7 @@ import { CapType } from '../../caps/helper';
import { AssetInput } from '../AssetInput';
import { GasEstimationError } from '../FlowCommons/GasEstimationError';
import { ModalWrapperProps } from '../FlowCommons/ModalWrapper';
import {
DetailsHFLine,
DetailsIncentivesLine,
TxModalDetails,
} from '../FlowCommons/TxModalDetails';
import { DetailsHFLine, TxModalDetails } from '../FlowCommons/TxModalDetails';
import { BorrowActions } from './BorrowActions';
import { BorrowAmountWarning } from './BorrowAmountWarning';
import { GhoBorrowSuccessView } from './GhoBorrowSuccessView';
Expand Down Expand Up @@ -134,7 +129,6 @@ export const GhoBorrowModalContent = ({
const [interestRateMode, setInterestRateMode] = useState<InterestRate>(InterestRate.Variable);
const [amount, setAmount] = useState('');
const [riskCheckboxAccepted, setRiskCheckboxAccepted] = useState(false);
const { data: incentives } = useMeritIncentives('gho');

// Check if user has any open borrow positions on GHO
// Check if user can borrow at a discount
Expand Down Expand Up @@ -290,10 +284,6 @@ export const GhoBorrowModalContent = ({
healthFactor={user.healthFactor}
futureHealthFactor={newHealthFactor.toString(10)}
/>
<DetailsIncentivesLine
incentives={incentives ? [incentives] : []}
symbol={poolReserve.symbol}
/>
<Row
caption={
<Box>
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

24 changes: 4 additions & 20 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ msgstr "Add to wallet"
msgid "Add {0} to wallet to track your balance."
msgstr "Add {0} to wallet to track your balance."

#: src/modules/markets/Gho/GhoBanner.tsx
msgid "Additionally, GHO borrowers recieve periodic rewards through the Merit program. This is a program initiated and implemented by the decentralised Aave community. Aave Labs does not guarantee the program and accepts no liability."
msgstr "Additionally, GHO borrowers recieve periodic rewards through the Merit program. This is a program initiated and implemented by the decentralised Aave community. Aave Labs does not guarantee the program and accepts no liability."

#: src/ui-config/errorMapping.tsx
msgid "Address is not a contract"
msgstr "Address is not a contract"
Expand Down Expand Up @@ -529,6 +525,10 @@ msgstr "Borrow info"
msgid "Borrow power used"
msgstr "Borrow power used"

#: src/modules/markets/Gho/GhoBanner.tsx
msgid "Borrow rate"
msgstr "Borrow rate"

#: src/modules/history/actions/ActionDetails.tsx
msgid "Borrow rate change"
msgstr "Borrow rate change"
Expand Down Expand Up @@ -834,10 +834,6 @@ msgstr "Current LTV"
msgid "Current differential"
msgstr "Current differential"

#: src/modules/reserve-overview/Gho/GhoDiscountCalculator.tsx
msgid "Current rewards"
msgstr "Current rewards"

#: src/modules/migration/MigrationListMobileItem.tsx
msgid "Current v2 Balance"
msgstr "Current v2 Balance"
Expand Down Expand Up @@ -1094,10 +1090,6 @@ msgstr "Enter an amount"
msgid "Error connecting. Try refreshing the page."
msgstr "Error connecting. Try refreshing the page."

#: src/modules/markets/Gho/GhoBanner.tsx
msgid "Estimated borrow rate"
msgstr "Estimated borrow rate"

#: src/components/incentives/GhoIncentivesCard.tsx
msgid "Estimated compounding interest, including discount for Staking {0}AAVE in Safety Module."
msgstr "Estimated compounding interest, including discount for Staking {0}AAVE in Safety Module."
Expand Down Expand Up @@ -1213,10 +1205,6 @@ msgstr "Funds in the Safety Module"
msgid "GHO balance"
msgstr "GHO balance"

#: src/modules/reserve-overview/Gho/GhoDiscountCalculator.tsx
msgid "GHO borrowers recieve periodic rewards through the Merit program. This is a program initiated and implemented by the decentralised Aave community. Aave Labs does not guarantee the program and accepts no liability."
msgstr "GHO borrowers recieve periodic rewards through the Merit program. This is a program initiated and implemented by the decentralised Aave community. Aave Labs does not guarantee the program and accepts no liability."

#: src/modules/reserve-overview/Gho/GhoReserveConfiguration.tsx
msgid "GHO is a native decentralized, collateral-backed digital asset pegged to USD. It is created by users via borrowing against multiple collateral. When user repays their GHO borrow position, the protocol burns that user's GHO. All the interest payments accrued by minters of GHO would be directly transferred to the AaveDAO treasury."
msgstr "GHO is a native decentralized, collateral-backed digital asset pegged to USD. It is created by users via borrowing against multiple collateral. When user repays their GHO borrow position, the protocol burns that user's GHO. All the interest payments accrued by minters of GHO would be directly transferred to the AaveDAO treasury."
Expand Down Expand Up @@ -1587,10 +1575,6 @@ msgstr "Meet GHO"
msgid "Menu"
msgstr "Menu"

#: src/modules/reserve-overview/Gho/GhoDiscountCalculator.tsx
msgid "Merit Program"
msgstr "Merit Program"

#: src/components/transactions/MigrateV3/MigrateV3Actions.tsx
#: src/components/transactions/StakingMigrate/StakingMigrateActions.tsx
msgid "Migrate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Trans } from '@lingui/macro';
import { Box, Button, Stack, Tooltip, Typography, useMediaQuery, useTheme } from '@mui/material';
import { CapType } from 'src/components/caps/helper';
import { GhoIncentivesCard } from 'src/components/incentives/GhoIncentivesCard';
import { MeritIncentivesButton } from 'src/components/incentives/IncentivesButton';
import { AvailableTooltip } from 'src/components/infoTooltips/AvailableTooltip';
import { FixedAPYTooltip } from 'src/components/infoTooltips/FixedAPYTooltip';
import { ListColumn } from 'src/components/lists/ListColumn';
Expand Down Expand Up @@ -178,7 +177,6 @@ const GhoBorrowAssetsListItemDesktop = ({
forceShowTooltip
userQualifiesForDiscount
/>
<MeritIncentivesButton symbol="gho" />
</ListColumn>
<ListButtonsColumn>
<Button disabled={borrowButtonDisable} variant="contained" onClick={onBorrowClick}>
Expand Down Expand Up @@ -249,7 +247,6 @@ const GhoBorrowAssetsListItemMobile = ({
forceShowTooltip
userQualifiesForDiscount
/>
<MeritIncentivesButton symbol="gho" />
</Stack>
</Row>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Trans } from '@lingui/macro';
import { Box, Button, SvgIcon, useMediaQuery, useTheme } from '@mui/material';
import { ContentWithTooltip } from 'src/components/ContentWithTooltip';
import { GhoIncentivesCard } from 'src/components/incentives/GhoIncentivesCard';
import { UserMeritIncentivesButton } from 'src/components/incentives/IncentivesButton';
import { FixedAPYTooltipText } from 'src/components/infoTooltips/FixedAPYTooltip';
import { ROUTES } from 'src/components/primitives/Link';
import { Row } from 'src/components/primitives/Row';
Expand Down Expand Up @@ -171,7 +170,6 @@ const GhoBorrowedPositionsListItemDesktop = ({
ghoRoute={ROUTES.reserveOverview(underlyingAsset, currentMarket) + '/#discount'}
userQualifiesForDiscount={hasDiscount}
/>
<UserMeritIncentivesButton symbol="gho" />
</ListColumn>
<ListColumn>
<ContentWithTooltip tooltipContent={FixedAPYTooltipText} offset={[0, -4]} withoutHover>
Expand Down
26 changes: 3 additions & 23 deletions src/modules/markets/Gho/GhoBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
ComputedReserveData,
useAppDataContext,
} from 'src/hooks/app-data-provider/useAppDataProvider';
import { useMeritIncentives } from 'src/hooks/useMeritIncentives';
import { useRootStore } from 'src/store/root';

interface GhoBannerProps {
Expand All @@ -24,9 +23,6 @@ export const GhoBanner = ({ reserve }: GhoBannerProps) => {
const isMd = useMediaQuery(theme.breakpoints.up('xs'));
const currentMarket = useRootStore((store) => store.currentMarket);
const { ghoReserveData, ghoLoadingData } = useAppDataContext();
const { data: incentives } = useMeritIncentives('gho');

const ghoMeritAPR = incentives?.incentiveAPR || 0;

const totalBorrowed = BigNumber.min(
valueToBigNumber(reserve?.totalDebt || 0),
Expand Down Expand Up @@ -271,10 +267,7 @@ export const GhoBanner = ({ reserve }: GhoBannerProps) => {
}}
>
<GhoBorrowApyRange
minVal={Math.max(
0,
ghoReserveData.ghoBorrowAPYWithMaxDiscount - Number(ghoMeritAPR)
)}
minVal={ghoReserveData.ghoBorrowAPYWithMaxDiscount}
maxVal={ghoReserveData.ghoVariableBorrowAPY}
variant={isCustomBreakpoint ? 'h3' : isMd ? 'secondary16' : 'secondary14'}
percentVariant={isCustomBreakpoint ? 'h3' : isMd ? 'secondary16' : 'secondary14'}
Expand All @@ -301,26 +294,13 @@ export const GhoBanner = ({ reserve }: GhoBannerProps) => {
xs: 'caption',
},
}}
text={<Trans>Estimated borrow rate</Trans>}
text={<Trans>Borrow rate</Trans>}
>
<>
<Trans>
Users who stake AAVE in Safety Module (i.e. stkAAVE holders) receive a
discount on GHO borrow interest rate.
</Trans>{' '}
<Trans>
Additionally, GHO borrowers recieve periodic rewards through the Merit
program. This is a program initiated and implemented by the decentralised Aave
community. Aave Labs does not guarantee the program and accepts no liability.
</Trans>{' '}
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
sx={{ textDecoration: 'underline' }}
variant="caption"
color="text.secondary"
>
Learn more about Merit.
</Link>
</Trans>
</>
</TextWithTooltip>
</Typography>
Expand Down
48 changes: 0 additions & 48 deletions src/modules/reserve-overview/Gho/GhoDiscountCalculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { Link } from 'src/components/primitives/Link';
import { TokenIcon } from 'src/components/primitives/TokenIcon';
import { ReserveOverviewBox } from 'src/components/ReserveOverviewBox';
import { useAppDataContext } from 'src/hooks/app-data-provider/useAppDataProvider';
import { useMeritIncentives } from 'src/hooks/useMeritIncentives';
import { useRootStore } from 'src/store/root';
import { GENERAL, RESERVE_DETAILS } from 'src/utils/mixPanelEvents';

Expand Down Expand Up @@ -323,9 +322,6 @@ export const GhoDiscountCalculator = () => {
</Trans>
</Typography>
{downToXsm ? GhoDiscountCalculatorMobile : GhoDiscountCalculatorDesktop}
<Box sx={{ mt: downToXsm ? 4 : 10 }}>
<GhoMeritProgramIncentives downToXsm={downToXsm} />
</Box>
<Box sx={{ mt: downToXsm ? 4 : 10 }}>
<GhoDiscountParametersComponent
loading={ghoLoadingData}
Expand All @@ -337,50 +333,6 @@ export const GhoDiscountCalculator = () => {
);
};

const GhoMeritProgramIncentives = ({ downToXsm }: { downToXsm: boolean }) => {
const { data: meritIncentives, isFetching } = useMeritIncentives('gho');

const ghoMeritAPR = meritIncentives?.incentiveAPR || 0;

return (
<Box sx={{ flexGrow: 1, minWidth: 0, maxWidth: '100%', width: '100%' }}>
<Typography variant="subheader1" gutterBottom>
<Trans>Merit Program</Trans>
</Typography>
<Typography variant="caption" color="text.secondary" mb={6}>
<Trans>
GHO borrowers recieve periodic rewards through the Merit program. This is a program
initiated and implemented by the decentralised Aave community. Aave Labs does not
guarantee the program and accepts no liability.
</Trans>{' '}
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
sx={{ textDecoration: 'underline' }}
variant="caption"
color="text.secondary"
>
Learn more
</Link>
</Typography>
<ReserveOverviewBox fullWidth={downToXsm} title={<Trans>Current rewards</Trans>}>
{isFetching ? (
<Skeleton variant="text" width={75} />
) : (
<Stack direction="row" gap={1} alignItems="center">
<TokenIcon symbol="GHO" sx={{ fontSize: '14px', mr: 1 }} />
<FormattedNumber
value={ghoMeritAPR}
percent
variant="secondary14"
color="text.primary"
/>
</Stack>
)}
</ReserveOverviewBox>
</Box>
);
};

const GhoDiscountParametersComponent: React.FC<{
loading: boolean;
downToXsm: boolean;
Expand Down

1 comment on commit ac0ad3b

@github-actions
Copy link

Choose a reason for hiding this comment

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

This commit was deployed on ipfs

Please sign in to comment.