Deposit and Join
This section outlines the process to deposit tokens into a Bancor liquidity pool and join the rewards program in a single transaction.
This process reduces gas costs and ensures your tokens are earning the maximum available yield.
In order for the contract to interact with the tokens in your wallet and perform the transaction, an
Approvalmust be set first for the contract.
Writeto sign the
Approvein your wallet
In order to join the latest rewards program, you first need to identify the token's program ID.
For ETH use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
You will require the id value for the depositAndJoin function.
Now that you know the program ID and have the approval in place, you are ready to deposit your tokens into the Bancor pool and rewards contracts.
Execute the depositAndJoin function, with the id you received from the first step, and the number of tokens you wish to deposit.
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 automatically stake them into the rewards contract