Add isVaultDeleveraged conditional state to frontend#170
Closed
Cycxyz wants to merge 3 commits into
Closed
Conversation
When a vault's isVaultDeleveraged() returns true: - Overview shows only Your Position and "Vault is deprecated" description - Deposit tab hidden, only redeem via redeemCollateral() available - Preview uses previewRedeemCollateral() to show expected collateral - Points and VaultInfo dropdowns hidden - All other sections (FlashLoan, Actions, Rebalance, Auction) disabled Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a frontend “deleveraged/deprecated vault” mode driven by vaultLens.isVaultDeleveraged(), adjusting the Vault page UI to restrict user interactions to redemption-only behavior and hide/disable other vault features.
Changes:
- Added
isVaultDeleveragedtoVaultContextand fetches it viavaultLens.isVaultDeleveraged(). - Updated Vault page layout to hide points/vault-info UI and disable operational sections when the vault is deleveraged.
- Updated vault info and the main action form to support deprecated-mode redemption preview/submit via
previewRedeemCollateral()+redeemCollateral().
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/pages/Vault.tsx | Uses isVaultDeleveraged to hide dropdowns and disable sections (FlashLoan, Actions, Rebalance, Auction, etc.). |
| src/contexts/VaultContext.tsx | Adds isVaultDeleveraged to context and loads it from the vault lens. |
| src/components/vault/Info.tsx | Hides APY/points/TVL blocks and swaps description to “Vault is deprecated” when deleveraged. |
| src/components/vault/FlashLoanDepositWithdrawHandler.tsx | Implements deprecated-mode redeemCollateral flow + previewRedeemCollateral and UI branching. |
| src/components/vault/FlashLoanDepositWithdrawForm.tsx | Hides the deposit tab in deleveraged mode and forces withdraw/redeem behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a vault's isVaultDeleveraged() returns true: