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

Using wrappedToken in CompositeLiquidityRouter in ERC4626Pool operations #1201

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1ca2458
fist iteration
elshan-eth Dec 24, 2024
757545a
fix code and tests
elshan-eth Jan 7, 2025
9dbf7fc
change var name
elshan-eth Jan 8, 2025
4b39b72
refactoring prepareTokens
elshan-eth Jan 9, 2025
f6bcd4e
fixes
elshan-eth Jan 10, 2025
413315d
Update pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
c441933
Update pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
164cdae
Update pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
6d7f538
Update pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
c4a2662
Update pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
6b1c8db
Update pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
b0eeb6e
Update pkg/vault/contracts/CompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
6008eca
Update pkg/vault/contracts/CompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
06ab630
Update pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
9fe3242
Update pkg/vault/contracts/CompositeLiquidityRouter.sol
elshan-eth Jan 13, 2025
acac9ec
small fixes
elshan-eth Jan 13, 2025
8a876c8
Merge branch 'using-wrapped-amount-in-erc4626-operations-in-clr' of h…
elshan-eth Jan 13, 2025
cf43702
fixes
elshan-eth Jan 13, 2025
af63d70
update snapshots
elshan-eth Jan 13, 2025
8ca5aa6
small fixes
elshan-eth Jan 14, 2025
537f45f
small fixes
elshan-eth Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions pkg/interfaces/contracts/vault/ICompositeLiquidityRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ interface ICompositeLiquidityRouter {
* the "parent" pool, and also make sure limits are set properly.
*
* @param pool Address of the liquidity pool
* @param exactUnderlyingAmountsIn Exact amounts of underlying tokens in, sorted in token registration order of
* @param useWrappedTokens An array indicating whether the input token is a wrapper or underlying token
* @param exactAmountsIn Exact amounts of underlying/wrapped tokens in, sorted in token registration order of
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
* wrapped tokens in the pool
* @param minBptAmountOut Minimum amount of pool tokens to be received
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH
Expand All @@ -39,7 +40,8 @@ interface ICompositeLiquidityRouter {
*/
function addLiquidityUnbalancedToERC4626Pool(
address pool,
uint256[] memory exactUnderlyingAmountsIn,
bool[] memory useWrappedTokens,
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
uint256[] memory exactAmountsIn,
uint256 minBptAmountOut,
bool wethIsEth,
bytes memory userData
Expand All @@ -52,7 +54,8 @@ interface ICompositeLiquidityRouter {
* the "parent" pool, and also make sure limits are set properly.
*
* @param pool Address of the liquidity pool
* @param maxUnderlyingAmountsIn Maximum amounts of underlying tokens in, sorted in token registration order of
* @param useWrappedTokens An array indicating whether the input token is a wrapper or underlying token
* @param maxAmountsIn Maximum amounts of underlying/wrapped tokens in, sorted in token registration order of
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
* wrapped tokens in the pool
* @param exactBptAmountOut Exact amount of pool tokens to be received
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH
Expand All @@ -62,7 +65,8 @@ interface ICompositeLiquidityRouter {
*/
function addLiquidityProportionalToERC4626Pool(
address pool,
uint256[] memory maxUnderlyingAmountsIn,
bool[] memory useWrappedTokens,
uint256[] memory maxAmountsIn,
uint256 exactBptAmountOut,
bool wethIsEth,
bytes memory userData
Expand All @@ -72,35 +76,39 @@ interface ICompositeLiquidityRouter {
* @notice Remove proportional amounts of underlying from an ERC4626 pool, burning an exact pool token amount.
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI).
* @param pool Address of the liquidity pool
* @param useWrappedTokens An array indicating whether the output token is a wrapper or underlying token
* @param exactBptAmountIn Exact amount of pool tokens provided
* @param minUnderlyingAmountsOut Minimum amounts of underlying tokens out, sorted in token registration order of
* @param minAmountsOut Minimum amounts of underlying tokens out, sorted in token registration order of
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
* wrapped tokens in the pool
* @param wethIsEth If true, incoming ETH will be wrapped to WETH and outgoing WETH will be unwrapped to ETH
* @param userData Additional (optional) data required for removing liquidity
* @return underlyingAmountsOut Actual amounts of tokens received, sorted in token registration order of wrapped
* @return amountsOut Actual amounts of tokens received, sorted in token registration order of wrapped
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
* tokens in the pool
*/
function removeLiquidityProportionalFromERC4626Pool(
address pool,
bool[] memory useWrappedTokens,
uint256 exactBptAmountIn,
uint256[] memory minUnderlyingAmountsOut,
uint256[] memory minAmountsOut,
bool wethIsEth,
bytes memory userData
) external payable returns (uint256[] memory underlyingAmountsOut);
) external payable returns (uint256[] memory amountsOut);
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved

/**
* @notice Queries an `addLiquidityUnbalancedToERC4626Pool` operation without actually executing it.
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI).
* @param pool Address of the liquidity pool
* @param exactUnderlyingAmountsIn Exact amounts of underlying tokens in, sorted in token registration order of
* @param useWrappedTokens An array indicating whether the input token is a wrapper or underlying token
* @param exactAmountsIn Exact amounts of underlying/wrapped tokens in, sorted in token registration order of
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
* wrapped tokens in the pool
* @param sender The sender passed to the operation. It can influence results (e.g., with user-dependent hooks)
* @param userData Additional (optional) data required for the query
* @return bptAmountOut Expected amount of pool tokens to receive
*/
function queryAddLiquidityUnbalancedToERC4626Pool(
address pool,
uint256[] memory exactUnderlyingAmountsIn,
bool[] memory useWrappedTokens,
uint256[] memory exactAmountsIn,
address sender,
bytes memory userData
) external returns (uint256 bptAmountOut);
Expand All @@ -109,6 +117,7 @@ interface ICompositeLiquidityRouter {
* @notice Queries an `addLiquidityProportionalToERC4626Pool` operation without actually executing it.
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI).
* @param pool Address of the liquidity pool
* @param useWrappedTokens An array indicating whether the input token is a wrapper or underlying token
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
* @param exactBptAmountOut Exact amount of pool tokens to be received
* @param sender The sender passed to the operation. It can influence results (e.g., with user-dependent hooks)
* @param userData Additional (optional) data required for the query
Expand All @@ -117,6 +126,7 @@ interface ICompositeLiquidityRouter {
*/
function queryAddLiquidityProportionalToERC4626Pool(
address pool,
bool[] memory useWrappedTokens,
uint256 exactBptAmountOut,
address sender,
bytes memory userData
Expand All @@ -126,6 +136,7 @@ interface ICompositeLiquidityRouter {
* @notice Queries a `removeLiquidityProportionalFromERC4626Pool` operation without actually executing it.
* @dev An "ERC4626 pool" contains IERC4626 yield-bearing tokens (e.g., waDAI).
* @param pool Address of the liquidity pool
* @param useWrappedTokens An array indicating whether the output token is a wrapper or underlying token
elshan-eth marked this conversation as resolved.
Show resolved Hide resolved
* @param exactBptAmountIn Exact amount of pool tokens provided for the query
* @param sender The sender passed to the operation. It can influence results (e.g., with user-dependent hooks)
* @param userData Additional (optional) data required for the query
Expand All @@ -134,6 +145,7 @@ interface ICompositeLiquidityRouter {
*/
function queryRemoveLiquidityProportionalFromERC4626Pool(
address pool,
bool[] memory useWrappedTokens,
uint256 exactBptAmountIn,
address sender,
bytes memory userData
Expand Down
Loading
Loading