Deposit

This section outlines the process to deposit tokens into a Bancor liquidity pool.

1. Approve

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

If you wish to deposit ETH or have already set approval for a very large amount for the token, skip to step 3.

  1. Visit the relevant token contract. This can be found on Etherscan by searching for the token ticker, or by clicking the Etherscan link on Coingecko token pages. For example: BNT | DAI | LINK

  2. Connect your wallet as explained in "Using Etherscan"

  3. Fill in the fields in the Approve function, then click Write and complete the transaction.

_spender

The address of the BancorNetwork found here

_value

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

2. Deposit

Now that you have the approval in place, you are ready to deposit your tokens into the Bancor pool.

Execute the deposit function, with the token address, and the number of tokens you wish to deposit.

  1. Visit the BancorNetwork contract on etherscan

  2. Execute the deposit function (this is a Write function)

Name
Type
Description

deposit

uint256

ETH deposits ONLY:

Indicate the ETH amount in full units (10.5 ETH should be indicated as 10.5) For any other token, this should be set to 0

pool

uint256

The address of the token you wish to deposit

tokenAmount

uint256

The token (i.e BNT, ETH, DAI, LINK) amount you would like to deposit (using WEI format explained here)

Once executed successfully, the following will happen:

  1. Your tokens will be deposited into the Bancor pool

  2. The protocol will generate bnTokens that represent your position in the pool, and will transfer them to your wallet

Last updated