DeFi Saver
Search…
⌃K
⚖

BalancerV2Withdraw

Description

Action ID: 0x54f465c5
Network mainnet: (Deployed address | Code)
Return LP tokens to Balancer Vault in exchange for underlying tokens.

SDK Action

const balancerWithdrawAction = new dfs.actions.balancer.BalancerV2WithdrawAction(
poolId,
from,
to,
lpTokenAmount,
tokens,
minAmountsOut,
userData,
);

Contract

This is a DFS STANDARD_ACTION.
Input:
/// @param poolId Masked address of the pool with additional info
/// @param from Where are we pulling the lp tokens amount from
/// @param to The address we are sending the underlying tokens to
/// @param lpTokenAmount Amount of lp tokens
/// @param tokens Array of token addresses we are withdrawing
/// @param maxAmountsOut Array of max. amounts of tokens to pull out of the pool
/// @param userData Structured data of pool (array of amountsOut and other data depending on type of pool)
struct Params {
bytes32 poolId;
address from;
address to;
uint256 lpTokenAmount;
IAsset[] tokens;
uint256[] minAmountsOut;
bytes userData;
}
Return value:
return bytes32(poolLPTokensSent);
Events:
emit ActionEvent("BalancerV2Withdraw", logData);
​
logger.logActionDirectEvent("BalancerV2Withdraw", logData);