Initiating the Withdrawal
Last updated
Last updated
Initiating the withdrawal requires depositing your pool tokens into the pending withdrawal contract, starting the cooldown period.
The process consists of 3 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
pool
Token
The address of the underlying token
amount
uint256
The amount of underlying token you would like to withdraw (in WEI
format)
Output response
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
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
This step will explain how to call the initiate cooldown function
Execute the initWithdrawal
function (this is a Write function)
Input variable
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