SIP-236: Fix Exchange before fee reclaimation evaluation
Author | |
---|---|
Status | Implemented |
Type | Governance |
Network | Ethereum & Optimism |
Implementor | MEB (@barrasso) |
Release | Alpheratz |
Proposal | Loading status... |
Created | 2022-05-11 |
Simple Summary
Exchanger.exchange does not use the post-reclaim amount to calculate the amount of exchange for the user trade. This leads to the user being left with more of their source token then they should have had.
Abstract
Exchanger.exchange does not use the post-reclaim amount to calculate the amount of exchange for the user trade. This leads to the user being left with more of their source token then they should have had.
A similar bug has been found ExchangerWithFeeRecAlternatives
that would affect L1, and will be similarly patched.
Tests
In Exchanger
tests, the following are added:
- settlement tests
- trade sUSD->sEUR
- sEUR price doubles
- -> trade from sEUR->sBTC results in amount after fee reclamation
- sEUR price halves
- -> trade from sBTC->sEUR results in amount after fee reclamation
- sEUR price doubles
- trade sUSD->sEUR
N/A
Copyright
Copyright and related rights waived via CC0.