-
Notifications
You must be signed in to change notification settings - Fork 0
SOV-5270: allow withdrawing supplied balances #20
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
SOV-5270: allow withdrawing supplied balances #20
Conversation
✅ Deploy Preview for sovryn-layer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Pull request overview
This PR implements the ability for users to withdraw their supplied assets from the money market. The implementation includes a new withdraw dialog UI component, backend SDK support for withdrawal transactions, and necessary utility functions for amount calculations.
Key changes:
- Added
withdrawmethod to MoneyMarketManager SDK to handle withdrawal transactions for both native and non-native assets - Created WithdrawDialog component with form validation and maximum withdrawal calculation based on health factor requirements
- Introduced shared utilities including a
isFullAmounthelper andMINIMUM_HEALTH_FACTORconstant
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/lib/decimal.ts | Added MAX_UINT_256 constant to Decimal class for handling maximum withdrawal amounts |
| packages/sdk/src/managers/money-market/money-market.manager.ts | Implemented withdraw method with ABI definitions for withdraw and withdrawETH functions |
| apps/web-app/src/routes/money-market.tsx | Integrated WithdrawDialog component into the money market route |
| apps/web-app/src/lib/utils.ts | Added isFullAmount utility function for threshold-based amount comparisons |
| apps/web-app/src/components/ui/health-factor-bar.tsx | Updated to use shared MINIMUM_HEALTH_FACTOR constant |
| apps/web-app/src/components/MoneyMarket/stores/withdraw-request.store.ts | Created zustand store for managing withdrawal dialog state |
| apps/web-app/src/components/MoneyMarket/constants.ts | Defined MINIMUM_HEALTH_FACTOR constant (1.1) |
| apps/web-app/src/components/MoneyMarket/components/WithdrawDialog/WithdrawDialog.tsx | Implemented withdrawal dialog with form, validation, and health factor calculations |
| apps/web-app/src/components/MoneyMarket/components/LendPositionsList/components/AssetsTable/AssetsTable.tsx | Added withdraw button functionality to supply positions table |
| apps/web-app/src/components/MoneyMarket/components/LendDialog/LendDialog.tsx | Updated dialog description to be more descriptive |
| apps/web-app/src/components/MoneyMarket/components/BorrowDialog/BorrowDialog.tsx | Refactored to use shared MINIMUM_HEALTH_FACTOR constant |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
apps/web-app/src/components/MoneyMarket/components/WithdrawDialog/WithdrawDialog.tsx
Outdated
Show resolved
Hide resolved
apps/web-app/src/components/MoneyMarket/components/WithdrawDialog/WithdrawDialog.tsx
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://sovryn.atlassian.net/browse/SOV-5270