-
Notifications
You must be signed in to change notification settings - Fork 5
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
bughuntoor - If position goes to 0, the funding fees it should've received are never redistributed and are forever stuck #93
Comments
Escalate Issue should be a dup of #18. However, sponsor comments must be taken into account:
Will leave at HoJ discretion whether this should be low. |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
This issue should be low. The position should be liquidated before |
also #83 |
Result: |
Escalations have been resolved successfully! Escalation status:
|
This issue is duplicated with #83, look into this comment for details #83 (comment) |
bughuntoor
Medium
If position goes to 0, the funding fees it should've received are never redistributed and are forever stuck
Summary
If position goes to 0, the funding fees it should've received are never redistributed and are forever stuck
Vulnerability Detail
If a user position's collateral goes to 0, the user loses all of it, including any funding fees they should've received
However, the problem is that the amount they should've received is later not subtracted from the collateral and will remain permanently stuck.
For this reason, we can see that
FeesPaid
has afunding_received_want
arg which is intended to be used for that exact reason but is actually never used.Impact
Loss of funds
Code Snippet
https://github.com/sherlock-audit/2024-08-velar-artha/blob/main/gl-sherlock/contracts/positions.vy#L268
Tool used
Manual Review
Recommendation
Use the intended
funding_received_want
and subtract it from the collateral so it is not stuck and instead redistributed to LP providersDuplicate of #83
The text was updated successfully, but these errors were encountered: