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

Informational - getSwappingPrice() doesn't make sense with single strategy and vault #44

Open
kitty-the-kat opened this issue Jan 11, 2023 · 1 comment

Comments

@kitty-the-kat
Copy link
Contributor

getSwappingPrice() is intended to get swapping price between to underlying assets in the tranche but this function and its implementation doesn't make sense when only one ERC4626 is deposited into the tranche.

Technical Details

The Gro protocol as examined only has one token that is deposited into it, as the return value of getYieldToken() shows. The current implementation of getSwappingPrice() allows any uint256 input values for function arguments i and j and always returns the input _amount which implies a 1-to-1 exchange rate between token i and token j. This return value doesn't make sense. It would make more sense to follow an implementation like getYieldToken() shows and only allow an i and j value of zero, reverting in other cases.

Impact

Informational.

Recommendation

Consider a different implementation for getSwappingPrice() rather than returning a value that assumes a 1-to-1 exchange rate between arbitrary input tokens. The function is not called by the existing Gro implementation so it is not very important.

@kitty-the-kat
Copy link
Contributor Author

Acknowledged - Wont fix, has little to no impact

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

When branches are created from issues, their pull requests are automatically linked.

1 participant