LogoLogo
  • About Bancor Network
    • Bancor V3
    • Bancor Basics
      • About Bancor
      • What Can I Do With Bancor?
      • Liquidity Pools
      • Single-Side Liquidity
      • Why Use Bancor?
      • Resources
    • Resources for DAOs
      • Token Whitelisting Requirements
      • Liquidity Mining
        • Auto Compounding Rewards
          • How Auto Compounding Rewards work
          • How to Create an Auto Compounding Rewards Program
          • Custom Rewards Programs
        • Dual Liquidity Mining
        • Standard (External) Rewards
    • Security & Audits
      • Multisig Rights
      • Oracles
      • DAO MSIG Intervention Policy
  • Contracts & Functions
    • Contracts
    • Write Functions
      • Transaction Prerequisites
        • approve() / allowance()
      • Trading
        • tradeBySourceAmount()
        • tradeByTargetAmount()
        • Trading Troubleshooting
      • Adding Liquidity
        • deposit()
        • depositFor()
        • Deposit Troubleshooting
        • depositAndJoin()
      • Removing Liquidity
        • Initiating Cooldown
          • initWithdrawal()
        • withdraw()
        • cancelWithdrawal()
        • Withdraw Troubleshooting
      • Flashloan
        • flashLoan()
        • Flashloan Troubleshooting
      • Migrating Liquidity to v3
        • Migrating Bancor positions to v3
          • migratePositions()
          • migratePoolTokens()
          • Errors and Troubleshooting
        • Migrating from Uniswap v2
          • migrateUniswapV2Position()
        • Migrating from Sushiswap
          • migrateSushiSwapV1Position()
      • Rewards
        • join()
        • stakeRewards()
        • autoProcessRewards()
        • claimRewards()
        • leave()
      • Surplus migration
        • withdrawPOL()
      • Network Fees
        • burnNetworkFees()
    • Read Functions
      • Rewards
        • Standard rewards
          • Identify if a program exists
            • Auto Compounding
            • Standard Rewards
          • programIds()
          • programs()
          • providerProgramIds()
          • pendingRewards()
          • latestProgramId()
          • isProgramActive()
          • isProgramEnabled()
          • providerStake()
          • programStake()
          • providerRewards()
        • Auto compounding rewards
          • bnToken balance
          • isProgramActive()
          • isProgramPaused()
          • pools()
          • program()
          • programs()
      • Liquidity Pool Details
        • liquidityPools()
        • isPoolValid()
        • isPoolStable()
        • tradingLiquidity()
        • depositingEnabled()
        • poolFundingLimit()
      • Trades
        • tradeOutputBySourceAmount()
        • tradeInputByTargetAmount()
        • tradingEnabled()
        • tradingFeePMM()
      • Withdrawals
        • isReadyForWithdrawal()
        • withdrawalRequest()
        • withdrawalAmounts()
        • withdrawalRequestIds()
        • withdrawalRequestCount()
        • lockDuration()
      • Pool Token Information
        • poolToken()
        • collectionByPool()
        • poolTokenToUnderlying()
        • underlyingToPoolToken()
      • Vortex
        • pendingNetworkFeeAmount()
        • minNetworkFeeBurn()
      • Surplus whitelist
        • protectedTokenWhitelist()
    • Data & Events
      • General Data
        • contextId
      • Trading Data
        • event TokensTraded()
      • Liquidity Data
        • TotalLiquidityUpdated()
        • TradingLiquidityUpdated()
        • TokensDeposited()
        • TokensWithdrawn()
        • WithdrawalInitiated()
        • WithdrawalCancelled()
        • WithdrawalCompleted()
        • LockDurationUpdated()
        • Cross AMM Migration Data
          • UniswapV2PositionMigrated()
          • SushiswapV1PositionMigrated()
      • Flashloan Data
        • FlashLoanCompleted()
        • FlashLoanFeePPMUpdated()
      • Rewards
        • Staking and Unstaking
          • Event ProviderJoined()
          • Event ProviderLeft()
        • Claiming and Restaking Rewards
          • Event RewardsClaimed()
          • Event RewardsStaked()
  • Developer Guides
    • Bancor Vortex Burner
    • Bancor Etherscan Guide
      • Etherscan Basics
      • Deposit
      • Deposit and Join
      • Rewards: Joining Standard Rewards
      • Rewards: Stake & Claim
      • Rewards: Leaving the Rewards Contract
      • Withdrawing Tokens
        • Initiating the Withdrawal
        • Completing the Withdrawal
      • Migrating V2.1 Positions
      • Rewards: Auto Compounding Rewards Distribution
    • REST API
      • API Reference
      • DLT Identifier
Powered by GitBook
On this page
  • 1. Determine the number of pool tokens to withdraw
  • 2. Approve
  • 3. Initiate the withdrawal (begin cooldown)
  1. Developer Guides
  2. Bancor Etherscan Guide
  3. Withdrawing Tokens

Initiating the Withdrawal

PreviousWithdrawing TokensNextCompleting the Withdrawal

Last updated 2 years ago

Initiating the withdrawal requires depositing your pool tokens into the pending withdrawal contract, starting the cooldown period.

The process consists of 3 steps:

1. Determine the number of pool tokens to withdraw

If you are withdrawing your entire balance, you can skip this step and use the total number of pool tokens in your wallet in the WEI format in the following steps.

This step will explain how to calculate the number of bnTokens you need to withdraw to receive a specific number of tokens.

  • Visit the BancorNetworkInfo

  • Execute the underlyingToPoolToken function (this is a Read function)

Input variable

Name
Type
Description

pool

Token

The address of the underlying token

amount

uint256

The amount of underlying token you would like to withdraw (in WEI format)

For ETH use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE

Output response

Name
Type
Description

poolTokenAmount

uint256

The amount of bnToken representing the underlying token amount

Save the value as this represent the input amount needed to use in the next steps

2. Approve

In order for the contract to interact with the tokens in your wallet and perform the transaction, an Approve must be set first for the contract.

  • Execute the Approve function (this is a Write function)

spender

value

The number of tokens you approve represents the bnToken you would like to liquidate

  • Click Write to sign the Approve in your wallet

3. Initiate the withdrawal (begin cooldown)

This step will explain how to call the initiate cooldown function

  • Execute the initWithdrawal function (this is a Write function)

Input variable

Name
Type
Description

poolToken

Token

poolTokenAmount

uint256

Visit the relevant pool token token contract, for example: | | |

The contract address of the BancorNetwork

The amount you would like to approve (it can be identical or more than the amount you wish to withdraw, BUT NOT LESS) in WEI format as

Visit BancorNetwork contract

The bnToken address ()

The amount of bnTokens to liquidate ()

This will initiate the cooldown process and allow to

bnBNT
bnETH
bnDAI
bnLINK
on etherscan
complete the withdrawal
found here
explained here
found here
found in step 1
on etherscan
Determine the number of pool tokens to withdraw
Approve
Initiate the withdrawal