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 incorrect fee math in MetaSwapUtils #469

Merged
merged 17 commits into from
Dec 9, 2021
Merged

Fix incorrect fee math in MetaSwapUtils #469

merged 17 commits into from
Dec 9, 2021

Conversation

penandlim
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Nov 27, 2021

Codecov Report

Merging #469 (7b7060e) into master (6f37f97) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #469   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          15      15           
  Lines         982     994   +12     
  Branches      137     139    +2     
======================================
- Misses        982     994   +12     
Impacted Files Coverage Δ
contracts/meta/MetaSwapUtils.sol 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f37f97...7b7060e. Read the comment docs.

As base swaps have already been deployed, we cannot modify the current
ones. Although this is more gas-costly, it allows us to keep using the
same base pools.
@hermitsgame
Copy link

hermitsgame commented Nov 30, 2021

#470
@penandlim @alphastorm

@penandlim
Copy link
Contributor Author

@hermitsgame Nice catch!
Looks like we can scale dyFee the same way we scale v.dy here

if (tokenIndexTo >= baseLPTokenIndex) {
// When swapping to a base Swap token, scale down dy by its virtual price
v.dy = v.dy.mul(BASE_VIRTUAL_PRICE_PRECISION).div(
v.baseVirtualPrice
);
}

Thoughts? @ChiTimesChi

@penandlim penandlim merged commit 716d2de into master Dec 9, 2021
@penandlim penandlim deleted the vp-exploit branch December 9, 2021 23:12
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.

None yet

3 participants