-
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
4gontuk - LPs will withdraw more value than deposited during pegged token de-peg events #52
Comments
Escalate On behalf of the watson |
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. |
After additionally considering this issue, here's my understanding. Let's assume a scenario of 30% depeg and USDT = 0.7 USD.
Hence, even though it's not a direct loss of funds but a loss in value, this should be a valid medium (considering depeg as an extensive limitation). Thus, planning to accept the escalation and validate with medium severity. The duplicate is #113, are there any additional duplicates? |
Result: |
Escalations have been resolved successfully! Escalation status:
|
4gontuk
Medium
LPs will withdraw more value than deposited during pegged token de-peg events
Summary
The
CONTEXT
function ingl-sherlock/contracts/api.vy
uses the<quote-token>/USD
price for valuation, assuming a 1:1 peg between the quote token and USD. This assumption can fail during de-peg events, leading to incorrect valuations and potential exploitation.Root Cause
The
CONTEXT
function calls theprice
function from theoracle
contract to get the price of the quote token. This price is adjusted based on thequote_decimals
, implying it is using the<quote-token>/USD
price for valuation.Detailed Breakdown
CONTEXT
Function inapi.vy
:The
CONTEXT
function calls theprice
function from theoracle
contract to get the price of the quote token.price
Function inoracle.vy
:The
price
function inoracle.vy
uses theextract_price
function to get the price from the oracle.extract_price
Function inoracle.vy
:The
extract_price
function adjusts the price based on thequote_decimals
, which implies it is using the<quote-token>/USD
price for valuation.Impact
During a de-peg event, LPs can withdraw more value than they deposited, causing significant losses to the protocol.
Attack Path
Proof of Concept (PoC)
De-peg Event: The pegged token de-pegs to 0.70 USD (external event).
Withdraw:
Mitigation
To mitigate this issue, the protocol should use the
<base-token>/<quote-token>
price directly if available, or derive it from the<base-token>/USD
and<quote-token>/USD
prices. This ensures accurate valuations even if the quote token de-pegs from USD.The text was updated successfully, but these errors were encountered: