Skip to content

Add isVaultDeleveraged conditional state to frontend#170

Closed
Cycxyz wants to merge 3 commits into
devfrom
feature/vault-deleveraged-state
Closed

Add isVaultDeleveraged conditional state to frontend#170
Cycxyz wants to merge 3 commits into
devfrom
feature/vault-deleveraged-state

Conversation

@Cycxyz
Copy link
Copy Markdown
Collaborator

@Cycxyz Cycxyz commented Apr 11, 2026

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

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>
Copilot AI review requested due to automatic review settings April 11, 2026 19:20
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 isVaultDeleveraged to VaultContext and fetches it via vaultLens.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.

Comment thread src/components/vault/FlashLoanDepositWithdrawHandler.tsx
@andreysobol andreysobol marked this pull request as draft April 11, 2026 20:07
@andreysobol andreysobol deleted the feature/vault-deleveraged-state branch April 11, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants