-
Notifications
You must be signed in to change notification settings - Fork 45
feat: loan management form add/remove collateral #1715
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
apps/main/src/llamalend/features/manage-loan/components/AddCollateralForm.tsx
Outdated
Show resolved
Hide resolved
apps/main/src/llamalend/widgets/manage-loan/LoanInfoAccordion.tsx
Outdated
Show resolved
Hide resolved
apps/main/src/llamalend/widgets/manage-loan/LoanFormTokenInput.tsx
Outdated
Show resolved
Hide resolved
apps/main/src/llamalend/widgets/manage-loan/LoanInfoAccordion.tsx
Outdated
Show resolved
Hide resolved
apps/main/src/llamalend/features/manage-loan/components/AddCollateralForm.tsx
Outdated
Show resolved
Hide resolved
DanielSchiavini
left a comment
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.
LGTM comments are nitpicking
| value: decimal(new BigNumber(values.userCollateral).plus(state.collateral)) as Decimal, | ||
| tokenSymbol: collateralToken?.symbol, | ||
| }) ?? | ||
| null, |
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.
undefined should be OK too right?
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.
Shit I forgot to remove it, it's completely useless
| state.collateral && | ||
| values.userCollateral && { | ||
| value: decimal( | ||
| BigNumber.max('0', new BigNumber(state.collateral).minus(new BigNumber(values.userCollateral))), |
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.
| BigNumber.max('0', new BigNumber(state.collateral).minus(new BigNumber(values.userCollateral))), | |
| BigNumber.max(0, new BigNumber(state.collateral).minus(new BigNumber(values.userCollateral))), |
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.
btw I also found the clamp function which could be adapted to Decimal clamps
…d-collateral-form
55f70b9
…d-collateral-form
1767430
collateral,prevCollateral,prevHealth,prevDebtandprevLTVto the accordiongetErrorMessagefrom/loanand/lendint/llamalendGracefully handle user rejection (unlike my Ex):