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. (BNT withdrawals only) Approve vBNT
  • 2. Cooldown ID
  • 3. Identify which cooldown ID to use
  • 4. Identify if the cooldown period is over
  • 5. Complete the withdraw
  1. Developer Guides
  2. Bancor Etherscan Guide
  3. Withdrawing Tokens

Completing the Withdrawal

PreviousInitiating the WithdrawalNextMigrating V2.1 Positions

Last updated 2 years ago

This is the last step of the withdrawal process, after which, your funds will be returned to your wallet.

This can only be done once the cooldown time is completed

1. (BNT withdrawals only) Approve vBNT

Withdrawing BNT requires an equal number of vBNT to the bnBNT you are withdrawing. For example, withdrawing 10 bnBNT requires 10 vBNT.

For any other token, skip to

The BancorNetwork contract requires approval to perform the transaction with your vBNT tokens.

  • Visit the vBNT contract

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

_spender

_value

2. Cooldown ID

This step will explain how to identify the cooldown ID needed to complete the withdrawal.

  • Visit the PendingWithdrawals contract

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

Input variable

Name
Type
Description

provider

address

Your wallet address

Output response

Name
Type
Description

cooldownId

uint256

The ID of the existing cooldown requests you have (can be more than 1)

Save the cooldownIds as these represent the inputs needed for the next steps.

3. Identify which cooldown ID to use

This step will explain how to identify which cooldown ID to use.

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

Input variable

Name
Type
Description

id

uint256

One of the IDs generated from the previous step

Output response

Name
Type
Description

provider

address

The address that can interact with this cooldown request

poolToken

IPoolToken

The locked bnToken

reserveToken

Token

The underlying token

createdAt

uint32

The time when the request was created

poolTokenAmount

uint256

The locked bnToken amount

reserveTokenAmount

uint256

The expected amount of underlying asset to receive

Using the returned values,

  1. Identify the reserveToken you would like to withdraw

  2. Save the id for the next step

4. Identify if the cooldown period is over

This step will explain how to check if your cooldown is over and you can safely withdraw your tokens.

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

Input variable

Name
Type
Description

id

uint256

The cooldown ID you wish to finalize

Output response

Name
Type
Description

isReady

bool

5. Complete the withdraw

This step will explain how to complete the withdrawal process and call the withdraw function.

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

Input variable

Name
Type
Description

id

uint256

The cooldown ID you wish to withdraw

Output

This will complete the withdrawal process and return the underlying tokens to your wallet.

The address of the BancorNetwork

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

If you only have a single ID, skip to the .

Visit the PendingWithdrawals contract

Visit the BancorNetworkInfo contract

True/False indication on the status of the cooldown. (when True, )

Visit the BancorNetwork contract

on etherscan
on etherscan
on etherscan
next step
found here
explained here
proceed to next step
on etherscan
on etherscan
step 2