Learn
Balancer

Balancer

Disassembling

Unstake

  • Label: Exit_Balancer-unstake
  • Description: Unstake from gauge and exit pool on Balancer.
  • Actions in execution process:
    1. 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)

    ParameterConstraint
    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:
    1. 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))

    ParameterConstraint
    poolIdequal to TARGET_ID
    senderequal to AVATAR
    recipientequal to AVATAR
    request.assetslist of TOKEN tokens in pool
    request.minAmountsOutlist of amounts for TOKEN tokens in pool
    request.userDataequal to EXACT_BPT_IN_FOR_TOKENS_OUT or EXACT_BPT_IN_FOR_ALL_TOKENS_OUT (depending on pool type and version) and amount of TARGET_BPT tokens
    request.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:
    1. Unstake BPT from Balancer gauge contract
    2. 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)

    ParameterConstraint
    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))

    ParameterConstraint
    poolIdequal to TARGET_ID
    senderequal to AVATAR
    recipientequal to AVATAR
    request.assetslist of TOKEN tokens in pool
    request.minAmountsOutlist of amounts for TOKEN tokens in pool
    request.userDataequal to EXACT_BPT_IN_FOR_TOKENS_OUT or EXACT_BPT_IN_FOR_ALL_TOKENS_OUT (depending on pool type and version) and amount of TARGET_BPT tokens
    request.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:
    1. 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))
ParameterConstraint
poolIdequal to TARGET_ID
senderequal to AVATAR
recipientequal to AVATAR
request.assetslist of TOKEN tokens in pool
request.minAmountsOutlist of amounts for TOKEN tokens in pool
request.userDataequal to RECOVERY_MODE_EXIT_KIND and amount of TARGET_BPT tokens
request.toInternalBalanceFalse

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:
    1. Unstake BPT from the Balancer gauge contract
    2. 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)

ParameterConstraint
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))
ParameterConstraint
poolIdequal to TARGET_ID
senderequal to AVATAR
recipientequal to AVATAR
request.assetslist of TOKEN tokens in pool
request.minAmountsOutlist of amounts for TOKEN tokens in pool
request.userDataequal to RECOVERY_MODE_EXIT_KIND and amount of TARGET_BPT tokens
request.toInternalBalanceFalse

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:
    1. 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))

ParameterConstraint
poolIdequal to TARGET_ID
senderequal to AVATAR
recipientequal to AVATAR
request.assetslist of TOKEN tokens in pool
request.minAmountsOutlist of amounts for TOKEN tokens in pool
request.userDataequal to EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, amount of TARGET_BPT tokens and the desired exit TOKEN
request.toInternalBalanceFalse

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:
    1. Unstake BPT from Balancer gauge contract.
    2. 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)
ParameterConstraint
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))
ParameterConstraint
poolIdequal to TARGET_ID
senderequal to AVATAR
recipientequal to AVATAR
request.assetslist of TOKEN tokens in pool
request.minAmountsOutlist of amounts for TOKEN tokens in pool
request.userDataequal to EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, amount of TARGET_BPT tokens and the desired exit TOKEN
request.toInternalBalanceFalse

Swap

SELL_TOKEN · approve

Approve Vault to spend SELL_TOKEN tokens on behalf of the avatar.

  • Contract: SELL_TOKEN

  • Function: approve(address,uint256)

    ParameterConstraint
    spenderVault
    amountequal to the SELL_TOKEN amount to swap

Vault · Swap

  • Contract: Vault
  • Function: swap(bytes32,uint8,address,address,uint256,bytes,address,bool,address,bool,uint256,uint256)
ParameterConstraint
poolIdequal to TARGET_ID
kindequal to OutGivenExactIn
assetInequal to SELL_TOKEN address
assetOutequal to BUY_TOKEN address
amountequal to SELL_TOKEN tokens amount
userDataequal to “0x”
senderequal to AVATAR
fromInternalBalanceFalse
recipientequal to AVATAR
toInternalBalanceFalse
limitequal to SELL_TOKEN times (1-max slippage)
deadlineequal to “600”