Skip to content

Commit

Permalink
fix: remove legacy risk score
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Jul 12, 2024
1 parent a41ce4f commit d8dde63
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 121 deletions.
1 change: 0 additions & 1 deletion apps/common/hooks/useFetchYearnVaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function useFetchYearnVaults(chainIDs?: number[] | undefined): {
orderBy: 'featuringScore',
orderDirection: 'desc',
strategiesDetails: 'withDetails',
strategiesRisk: 'withRisk',
strategiesCondition: 'inQueue',
chainIDs: chainIDs ? chainIDs.join(',') : [1, 10, 137, 250, 8453, 42161].join(','),
limit: '2500'
Expand Down
50 changes: 0 additions & 50 deletions apps/vaults/components/details/tabs/VaultDetailsStrategies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,10 @@ type TProps = {
strategy: TYDaemonVaultStrategy;
};

type TRiskScoreElementProps = {
label: string;
value?: number;
};

function RiskScoreElement({label, value}: TRiskScoreElementProps): ReactElement {
return (
<div className={'flex flex-row items-center justify-between'}>
<p className={'text-sm text-neutral-500'}>{label}</p>
<p className={'font-number text-sm text-neutral-900'}>{value}</p>
</div>
);
}

export function VaultDetailsStrategy({currentVault, strategy}: TProps): ReactElement {
const {yDaemonBaseUri} = useYDaemonBaseURI({chainID: currentVault.chainID});
const isMounted = useIsMounted();

const riskScoreElementsMap = useMemo((): TRiskScoreElementProps[] => {
const {riskDetails} = strategy.risk || {};

return [
{label: 'TVL Impact', value: riskDetails?.TVLImpact},
{label: 'Audit Score', value: riskDetails?.auditScore},
{label: 'Code Review Score', value: riskDetails?.codeReviewScore},
{label: 'Complexity Score', value: riskDetails?.complexityScore},
{label: 'Longevity Impact', value: riskDetails?.longevityImpact},
{
label: 'Protocol Safety Score',
value: riskDetails?.protocolSafetyScore
},
{
label: 'Team Knowledge Score',
value: riskDetails?.teamKnowledgeScore
},
{label: 'Testing Score', value: riskDetails?.testingScore}
];
}, [strategy]);

const {data: reports} = useFetch<TYDaemonReports>({
endpoint: `${yDaemonBaseUri}/reports/${strategy.address}`,
schema: yDaemonReportsSchema
Expand Down Expand Up @@ -139,21 +104,6 @@ export function VaultDetailsStrategy({currentVault, strategy}: TProps): ReactEle
</b>
</div>
</div>

<div className={'flex flex-col space-y-4 bg-neutral-200 p-2 md:p-4'}>
<p className={'text-base text-neutral-600'}>{'Risk score'}</p>
<div className={'mt-0 grid grid-cols-1 gap-x-12 gap-y-2 md:grid-cols-2'}>
{riskScoreElementsMap.map(
({label, value}): ReactElement => (
<RiskScoreElement
key={label}
label={label}
value={value || 0}
/>
)
)}
</div>
</div>
</div>
<div className={'col-span-12 flex size-full flex-col justify-between md:col-span-6'}>
<div className={'grid grid-cols-6 gap-6 md:gap-8'}>
Expand Down
1 change: 0 additions & 1 deletion pages/v3/[chainID]/[address].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function Index(): ReactElement | null {
endpoint: router.query.address
? `${yDaemonBaseUri}/vaults/${toAddress(router.query.address as string)}?${new URLSearchParams({
strategiesDetails: 'withDetails',
strategiesRisk: 'withRisk',
strategiesCondition: 'inQueue'
})}`
: null,
Expand Down
37 changes: 0 additions & 37 deletions pages/v3/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,43 +84,6 @@ function About(): ReactElement {
</div>
</div>

{/* Risk Score */}
<div className={'w-full bg-neutral-100 p-10'}>
<div
aria-label={'Risk Score'}
className={'flex flex-col pb-6'}>
<h2 className={'text-3xl font-bold'}>{'Risk Score'}</h2>
</div>
<div aria-label={'Risk Score details'}>
<p className={'pb-4 text-neutral-600'}>
{
'In order to give users the best risk-adjusted yields in DeFi, Yearn uses a comprehensive risk assessment framework for each strategy within a Vault. This framework combines to give each Vault a holistic Risk Score.'
}
</p>
<p className={'pb-4 text-neutral-600'}>
{
'Strategies are assessed against eight different factors; Audit, Code Review, Complexity, Longevity, Protocol Safety, Team Knowledge, Testing Score, TVL Impact. Since Vaults use multiple strategies, riskier strategies can be paired with more conservative ones to ensure the Vault has a robust and balanced Risk Score.'
}
</p>
<p className={'pb-4 font-bold text-neutral-600'}>
{
'One significant advancement in v3 is that the protocol allows for riskier strategies and Vaults to be created for users with a higher risk appetite. Make sure to bear this in mind when depositing into those riskier Vaults'
}
</p>
<p className={'text-neutral-600'}>
{'For a full breakdown read more about our '}
<a
href={'https://docs.yearn.fi/resources/risks/risk-score'}
target={'_blank'}
className={'text-neutral-900 underline'}
rel={'noreferrer'}>
{'Risk Scores'}
</a>
{'.'}
</p>
</div>
</div>

{/* APY */}
<div className={'w-full bg-neutral-100 p-10'}>
<div
Expand Down
1 change: 0 additions & 1 deletion pages/vaults/[chainID]/[address].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function Index(): ReactElement | null {
endpoint: router.query.address
? `${yDaemonBaseUri}/vaults/${toAddress(router.query.address as string)}?${new URLSearchParams({
strategiesDetails: 'withDetails',
strategiesRisk: 'withRisk',
strategiesCondition: 'inQueue'
})}`
: null,
Expand Down
31 changes: 0 additions & 31 deletions pages/vaults/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,6 @@ function About(): ReactElement {
</div>
</div>

<div className={'w-full bg-neutral-100 p-10'}>
<div
aria-label={'Risk Score'}
className={'flex flex-col pb-6'}>
<h2 className={'text-3xl font-bold'}>{'Risk Score'}</h2>
</div>
<div aria-label={'Risk Score details'}>
<p className={'pb-4 text-neutral-600'}>
{
'In order to give users the best risk-adjusted yields in DeFi, Yearn uses a comprehensive risk assessment framework for each strategy within a Vault. This framework combines to give each Vault a holistic Risk Score.'
}
</p>
<p className={'pb-4 text-neutral-600'}>
{
'Strategies are assessed against eight different factors; Audit, Code Review, Complexity, Longevity, Protocol Safety, Team Knowledge, Testing Score, TVL Impact. Since Vaults use multiple strategies, riskier strategies can be paired with more conservative ones to ensure the Vault has a robust and balanced Risk Score.'
}
</p>
<p className={'text-neutral-600'}>
{'For a full breakdown read more about our '}
<a
href={'https://docs.yearn.fi/resources/risks/risk-score'}
target={'_blank'}
className={'text-neutral-900 underline'}
rel={'noreferrer'}>
{'Risk Scores'}
</a>
{'.'}
</p>
</div>
</div>

<div className={'w-full bg-neutral-100 p-10'}>
<div
aria-label={'Fees'}
Expand Down

0 comments on commit d8dde63

Please sign in to comment.