-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(beefy): add safety info #621
Conversation
const { category, title, score } = RISKS[risk] | ||
return { | ||
// from https://github.com/beefyfinance/beefy-v2/blob/3690e105c4bb98afcf06f9c3e385d13cc23af5cd/src/features/vault/components/SafetyCard/SafetyCard.tsx#L39 | ||
isPositive: score <= 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit confusing that isPositive
is whether the score is <=0 but I think the naming makes sense for what it would be used for, not sure what a better alternative would be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, I added a clarifying comment
categories[cat].push(risk) | ||
}) | ||
|
||
// reduce & clamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does clamp mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the math.min if the score goes above 1, taken literally from beefy code
const knownRisks = risks.filter((risk) => !!RISKS[risk]) | ||
|
||
if (knownRisks.length !== risks.length) { | ||
logger.warn({ vault }, 'Beefy vault has unknown risks') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice addition
'Categry-Beefy': 0.2, | ||
'Categry-Asset': 0.3, | ||
'Categry-Platform': 0.5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these typo's or is it literally Categry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, just taken directly from beefy codebase, didn't want to change it.
Taken from beefy codebase, tested by running locally and ensured getEarnPositions returns the expected info for the WETH pool