-
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
0x37 - Traders may decrease their trading loss via mint/burn #12
Comments
Escalate Duplicate of #50 - the underlying issue is the same undistributed LP rewards. |
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. |
Result: |
Escalations have been resolved successfully! Escalation status:
|
0x37
High
Traders may decrease their trading loss via mint/burn
Summary
When traders have some trading loss, they can decrease their trading loss via mint LP before closing position and burn LP after closing position.
Vulnerability Detail
When traders open one position with long or short size, traders have some negative unrealized Pnl. When traders close their positions, LP holders as traders' counterparty, will take traders' loss as their profits.
The problem is that there is not any limitation for mint()/burn() functions. Traders can make use of this problem to decrease their trading loss.
For example:
In this way, Alice can avoid most of her trading loss.
Impact
Traders have ways to avoid trading loss. This means that LPs will lose some profits that they deserve.
Code Snippet
https://github.com/sherlock-audit/2024-08-velar-artha/blob/main/gl-sherlock/contracts/core.vy#L154-L226
Tool used
Manual Review
Recommendation
Add one LP locking mechanism. When someone mints some shares in the market, he cannot burn his shares immediately. After a cool down period, he can burn his shares.
Duplicate of #94
The text was updated successfully, but these errors were encountered: