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.
Adds support for nested ERC4626 swaps.
It is possible to have nested ERC4626 tokens in Balancer V3 pools, for example this pool:
https://balancer.fi/pools/ethereum/v3/0x10a04efba5b880e169920fd4348527c64fb29d4d
With:
csUSDC: 0x7204b7dbf9412567835633b6f00c3edc3a8d6330 -- ERC4626 Pool token
USDC: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 -- underlying
csUSDL: 0xbeefc011e94f43b8b7b455ebab290c7ab4e216f1 -- ERC4626 Pool token
wUSDL: 0x7751e2f4b8ae93ef6b79d86419d42fe3295a4559 -- ERC4626 underlying
The most useful swap paths in this case would be USDL<>USDC. This can be supported by simply adding an extra buffer step to the batch swap to wrap/unwrap as needed.
Fetch nested ERC4626 addresses from API and include these for token in/out consideration
Update ERC4626 onchain rate call to include nested
Handle extra wrap/unwrap steps for nested ERC4626
Add integration tests for USDC<>USDL