DexSwapperUManager
Was this helpful?
Was this helpful?
Inherits: UManager
Required Merkle Root Leaves
ERC20 approves with router
spender.
IUniswapV3Router.exactInput(params), with all desired paths.
Slippage check enforced after swaps.
The UniswapV3 Router.
The BalancerVault this uManager works with.
The PriceRouter contract used to check slippage.
Sets the maximum allowed slippage during a swap.
Callable by MULTISIG_ROLE.
Performs a swap using the UniswapV3 Router, and enforces a slippage check.
Callable by STRATEGIST_ROLE.
Parameters
manageProofs
bytes32[][]
2 manage proofs, the first one for the ERC20 approval, and the second for the router exactInput call
decodersAndSanitizers
address[]
2 DecodersAndSanitizers one that implements ERC20 approve, and one that implements IUniswapV3Router.exactInput(params)
path
ERC20[]
the ERC20 token swap path
fees
uint24[]
the fees to specify which pools to swap with
amountIn
uint256
the amount of path[0] to swap
amountOutMinimum
uint256
the minimum amount of path[path.length - 1] to get out from the swap
deadline
uint256
the swap deadline
Performs a swap using the BalancerV2 Vault, and enforces a slippage check.
Callable by STRATEGIST_ROLE.
Parameters
manageProofs
bytes32[][]
2 manage proofs, the first one for the ERC20 approval, and the second for the swap
decodersAndSanitizers
address[]
2 DecodersAndSanitizers one that implements ERC20 approve, and one that implements BalancerV2Vault.swap
singleSwap
DecoderCustomTypes.SingleSwap
the swap data
funds
DecoderCustomTypes.FundManagement
the fund management data
limit
uint256
the maximum amount of assetIn to swap, or the minimum amount of assets out to receive
deadline
uint256
the swap deadline
Performs a swap using a Curve pool, and enforces a slippage check.
Callable by STRATEGIST_ROLE.
Parameters
manageProofs
bytes32[][]
2 manage proofs, the first one for the ERC20 approval, and the second for the swap
decodersAndSanitizers
address[]
2 DecodersAndSanitizers one that implements ERC20 approve, and one that implements CurvePool.exchange
info
CurveInfo
the Curve pool info
i
uint256
the index of the token to swap from
j
uint256
the index of the token to swap to
dx
uint256
the amount of token i to swap
min_dy
uint256
the minimum amount of token j to receive
Data needed to swap in a Curve pool
This was made into a struct to prevent stack too deep errors.