This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ad 1. All swaps are now performed through SwapHub and Uni Auto Router and 1inch handlers without any functional changes in UI. Test all possible combinations of swaps, swap and repay, short. Use token with varying decimals as input and output. Use 1inch / Uni protocols. In the latter case both exact input and output. SwapHub should also remove all issues around swapping stETH specifically on both protocols.
Ad 2. Instead of including the auto router through npm in FE, a new route is deployed in API providing the uni quotes. No extra items to test.
Ad 3. Fixes an issue with caclulating swap quotes when price impact is much larger on Uniswap than 1Inch, in which case 5 iterations of 1inch quoting in fetchCombinedQuote might not be enough to arrive at the solution. The fix is to first try swapping 1 unit of token on 1inch instead of the full amount and use the result as a price.
red coloring on available deposit if it is less than the amount required by the swap
when repaying using deposit, when the value of the deposit selected for a swap is less than the value of debt, the max button on the slider will set a full amount of the deposit to be used for repay. Under the hood, instead of calling swapAndRepay function, in this scenario a swap and burn max are added to the batch.
Edge case: the debt is self collateralized. In this case burn max would not only burn the amount received through the swap, but also as much of self collateral as possible (depending on the size of the debt). To avoid this, in case of self-collateralized debt, the swapAndRepay function is called as usual, but the max value on the slider is only approximated (vs used exactly) to match the value of available deposit.