DexSwapperUManager
Inherits: UManager
Required Merkle Root Leaves
ERC20 approves with
router
spender.IUniswapV3Router.exactInput(params), with all desired paths.
State Variables
MAX_SLIPPAGE
allowedSlippage
Slippage check enforced after swaps.
router
The UniswapV3 Router.
balancerVault
The BalancerVault this uManager works with.
priceRouter
The PriceRouter contract used to check slippage.
Functions
constructor
setAllowedSlippage
Sets the maximum allowed slippage during a swap.
Callable by MULTISIG_ROLE.
swapWithUniswapV3
Performs a swap using the UniswapV3 Router, and enforces a slippage check.
Callable by STRATEGIST_ROLE.
Parameters
Name | Type | Description |
---|---|---|
|
| 2 manage proofs, the first one for the ERC20 approval, and the second for the router exactInput call |
|
| 2 DecodersAndSanitizers one that implements ERC20 approve, and one that implements IUniswapV3Router.exactInput(params) |
|
| the ERC20 token swap path |
|
| the fees to specify which pools to swap with |
|
| the amount of path[0] to swap |
|
| the minimum amount of path[path.length - 1] to get out from the swap |
|
| the swap deadline |
swapWithBalancerV2
Performs a swap using the BalancerV2 Vault, and enforces a slippage check.
Callable by STRATEGIST_ROLE.
Parameters
Name | Type | Description |
---|---|---|
|
| 2 manage proofs, the first one for the ERC20 approval, and the second for the swap |
|
| 2 DecodersAndSanitizers one that implements ERC20 approve, and one that implements BalancerV2Vault.swap |
|
| the swap data |
|
| the fund management data |
|
| the maximum amount of assetIn to swap, or the minimum amount of assets out to receive |
|
| the swap deadline |
swapWithCurve
Performs a swap using a Curve pool, and enforces a slippage check.
Callable by STRATEGIST_ROLE.
Parameters
Name | Type | Description |
---|---|---|
|
| 2 manage proofs, the first one for the ERC20 approval, and the second for the swap |
|
| 2 DecodersAndSanitizers one that implements ERC20 approve, and one that implements CurvePool.exchange |
|
| the Curve pool info |
|
| the index of the token to swap from |
|
| the index of the token to swap to |
|
| the amount of token i to swap |
|
| the minimum amount of token j to receive |
Events
SlippageUpdated
Errors
DexSwapperUManager__Slippage
DexSwapperUManager__NewSlippageTooLarge
DexSwapperUManager__UniswapV3BadPathOrFees
Structs
CurveInfo
Data needed to swap in a Curve pool
This was made into a struct to prevent stack too deep errors.