Balancer
Disassembling
Unstake
- Label: Exit_Balancer-unstake
- Description: Unstake from gauge and exit pool on Balancer.
- Actions in execution process:
- Unstake BPT from Balancer gauge contract
 
TARGET_GAUGE · withdraw
Redeem TARGET_GAUGE tokens and receive TARGET_BPT tokens in exchange.
- 
Contract: TARGET_GAUGE
- 
Function: withdraw(uint256)Parameter Constraint valueequal to the amount of TARGET_GAUGEtokens
Withdraw proportionally
- Label: Exit_Balancer-proportional
- Description: Withdraw funds from a Balancer pool in proportional way, not to use for pools that are in recovery mode.
- Actions in execution process:
- Redeem Balancer BPT withdrawing liquidity proportionally
 
Vault · exitPool
Redeem TARGET_BPT tokens to the corresponding Balancer pool and receive TOKEN tokens in exchange.
- 
Contract: Vault
- 
Function: exitPool(bytes32,address,address,(address[],uint256[],bytes,bool))Parameter Constraint poolIdequal to TARGET_IDsenderequal to AVATARrecipientequal to AVATARrequest.assetslist of TOKENtokens in poolrequest.minAmountsOutlist of amounts for TOKENtokens in poolrequest.userDataequal to EXACT_BPT_IN_FOR_TOKENS_OUTorEXACT_BPT_IN_FOR_ALL_TOKENS_OUT(depending on pool type and version) and amount ofTARGET_BPTtokensrequest.toInternalBalanceFalse
Unstake and withdraw proportionally
- Label: Exit_Balancer-unstake-proportional
- Description: Unstake from gauge and exit pool on Balancer with proportional exit, not to use for pools in recovery mode.
- Actions in execution process:
- Unstake BPT from Balancer gauge contract
- Redeem Balancer BPT withdrawing liquidity proportionally
 
TARGET_GAUGE · withdraw
Redeem TARGET_GAUGE tokens and receive TARGET_BPT tokens in exchange.
- 
Contract: TARGET_GAUGE
- 
Function: withdraw(uint256)Parameter Constraint valueequal to the amount of TARGET_GAUGEtokens
Vault · exitPool
Redeem TARGET_BPT tokens to the corresponding Balancer pool and receive TOKEN tokens in exchange.
- 
Contract: Vault
- 
Function: exitPool(bytes32,address,address,(address[],uint256[],bytes,bool))Parameter Constraint poolIdequal to TARGET_IDsenderequal to AVATARrecipientequal to AVATARrequest.assetslist of TOKENtokens in poolrequest.minAmountsOutlist of amounts for TOKENtokens in poolrequest.userDataequal to EXACT_BPT_IN_FOR_TOKENS_OUTorEXACT_BPT_IN_FOR_ALL_TOKENS_OUT(depending on pool type and version) and amount ofTARGET_BPTtokensrequest.toInternalBalanceFalse
Withdraw proportionally (recovery mode)
- Label: Exit_Balancer-proportional-recovery
- Description: Withdraw funds from a Balancer pool in proportional way, ONLY to use for pools that are in recovery mode
- Actions in execution process:
- Redeem Balancer BPT withdrawing liquidity proportionally
 
Vault · exitPool
Redeem TARGET_BPT tokens to the corresponding Balancer pool and receive TOKEN tokens in exchange.
- Contract: Vault
- Function: exitPool(bytes32,address,address,(address[],uint256[],bytes,bool))
| Parameter | Constraint | 
|---|---|
| poolId | equal to TARGET_ID | 
| sender | equal to AVATAR | 
| recipient | equal to AVATAR | 
| request.assets | list of TOKENtokens in pool | 
| request.minAmountsOut | list of amounts for TOKENtokens in pool | 
| request.userData | equal to RECOVERY_MODE_EXIT_KINDand amount ofTARGET_BPTtokens | 
| request.toInternalBalance | False | 
Unstake and withdraw proportionally (recovery mode)
- Label: Exit_Balancer-unstake-proportional-recovery
- Description: Unstake from gauge and withdraw funds from a Balancer pool in proportional way, ONLY to use for pools that are in recovery mode
- Actions in execution process:
- Unstake BPT from the Balancer gauge contract
- Redeem Balancer BPT withdrawing liquidity proportionally
 
TARGET_GAUGE · withdraw
Redeem TARGET_GAUGE tokens and receive TARGET_BPT tokens in exchange.
- 
Contract: TARGET_GAUGE
- 
Function: withdraw(uint256)
| Parameter | Constraint | 
|---|---|
| value | equal to the amount of TARGET_GAUGEtokens | 
Vault · exitPool
Redeem TARGET_BPT tokens to the corresponding Balancer pool and receive TOKEN tokens in exchange.
- Contract: Vault
- Function: exitPool(bytes32,address,address,(address[],uint256[],bytes,bool))
| Parameter | Constraint | 
|---|---|
| poolId | equal to TARGET_ID | 
| sender | equal to AVATAR | 
| recipient | equal to AVATAR | 
| request.assets | list of TOKENtokens in pool | 
| request.minAmountsOut | list of amounts for TOKENtokens in pool | 
| request.userData | equal to RECOVERY_MODE_EXIT_KINDand amount ofTARGET_BPTtokens | 
| request.toInternalBalance | False | 
Withdraw in a single token
- Label: Exit_Balancer-single
- Description: Withdraw funds from a Balancer pool in a single asset, not to use for pools that are in recovery mode, and not to use for pools including assets blacklisted for swapping.
- Actions in execution process:
- Redeem Balancer BPT withdrawing liquidity in a single asset
 
Vault · exitPool
Redeem TARGET_BPT tokens to the corresponding Balancer pool and receive TOKEN tokens in exchange.
- 
Contract: Vault
- 
Function: exitPool(bytes32,address,address,(address[],uint256[],bytes,bool))
| Parameter | Constraint | 
|---|---|
| poolId | equal to TARGET_ID | 
| sender | equal to AVATAR | 
| recipient | equal to AVATAR | 
| request.assets | list of TOKENtokens in pool | 
| request.minAmountsOut | list of amounts for TOKENtokens in pool | 
| request.userData | equal to EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, amount ofTARGET_BPTtokens and the desired exitTOKEN | 
| request.toInternalBalance | False | 
Unstake and withdraw in a single token
- Label: Exit_Balancer-unstake-single
- Description: Unstake from gauge and exit pool on Balancer with single asset exit, not to use for pools in recovery mode.
- Actions in execution process:
- Unstake BPT from Balancer gauge contract.
- Redeem Balancer BPT withdrawing liquidity in a single asset
 
TARGET_GAUGE · withdraw
Redeem TARGET_GAUGE tokens and receive TARGET_BPT tokens in exchange.
- Contract: TARGET_GAUGE
- Function: withdraw(uint256)
| Parameter | Constraint | 
|---|---|
| value | equal to the amount of TARGET_GAUGEtokens | 
Vault · exitPool
Redeem TARGET_BPT tokens to the corresponding Balancer pool and receive TOKEN tokens in exchange.
- Contract: Vault
- Function: exitPool(bytes32,address,address,(address[],uint256[],bytes,bool))
| Parameter | Constraint | 
|---|---|
| poolId | equal to TARGET_ID | 
| sender | equal to AVATAR | 
| recipient | equal to AVATAR | 
| request.assets | list of TOKENtokens in pool | 
| request.minAmountsOut | list of amounts for TOKENtokens in pool | 
| request.userData | equal to EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, amount ofTARGET_BPTtokens and the desired exitTOKEN | 
| request.toInternalBalance | False | 
Swap
SELL_TOKEN · approve
Approve Vault to spend SELL_TOKEN tokens on behalf of the avatar.
- 
Contract: SELL_TOKEN
- 
Function: approve(address,uint256)Parameter Constraint spenderVaultamountequal to the SELL_TOKENamount to swap
Vault · Swap
- Contract: Vault
- Function: swap(bytes32,uint8,address,address,uint256,bytes,address,bool,address,bool,uint256,uint256)
| Parameter | Constraint | 
|---|---|
| poolId | equal to TARGET_ID | 
| kind | equal to OutGivenExactIn | 
| assetIn | equal to SELL_TOKENaddress | 
| assetOut | equal to BUY_TOKENaddress | 
| amount | equal to SELL_TOKENtokens amount | 
| userData | equal to “0x” | 
| sender | equal to AVATAR | 
| fromInternalBalance | False | 
| recipient | equal to AVATAR | 
| toInternalBalance | False | 
| limit | equal to SELL_TOKENtimes (1-max slippage) | 
| deadline | equal to “600” |