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

Balancer v3 nested erc4626 #887

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

johngrantuk
Copy link
Contributor

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

    • USDL: 0xbdc7c08592ee4aa51d06c27ee23d5087d65adbcd -- 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

@aburkut
Copy link
Member

aburkut commented Jan 31, 2025

BACK-1847

@aburkut aburkut self-assigned this Jan 31, 2025
@aburkut aburkut self-requested a review January 31, 2025 12:31
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.

2 participants