Skip to content
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

Fix withdrawal functionality when TVL limit is reached #174

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

od-hunter
Copy link

Description

This PR addresses the issue where withdrawal functionality was incorrectly disabled when a strategy reached 100% of its TVL limit. The changes ensure that only deposits are disabled when the TVL limit is hit, while withdrawals remain functional.

Changes Made

  1. Updated strategies.atoms.ts to separate deposit and withdrawal logic:
    • Added depositsDisabled property based on TVL limit
    • Set withdrawalsEnabled to always be true
  2. Modified Deposit.tsx component:
    • Updated UI to reflect deposit disabled state
    • Ensured withdrawal functionality remains active when TVL limit is reached
  3. Updated max amount calculation to consider depositsDisabled property
  4. Added error message to inform users when deposits are disabled due to TVL limit

How to Test

  1. Reduce the maxTVL for a strategy in strategies.atoms.ts to below its current TVL value
  2. Navigate to the strategies page
  3. Attempt to deposit (should be disabled)
  4. Attempt to withdraw (should still be functional)
  5. Check that the max button and input field work correctly for withdrawals
  6. Verify error messages are displayed appropriately

Closes #163

@od-hunter
Copy link
Author

od-hunter commented Oct 12, 2024

@akiraonstarknet , I pushed another pr please review

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.

bug: Withdraw functionality is disabled when 100% of TVL limit is hit
2 participants