Relay Liquidation Guide
This article outlines how a liquidity provider can liquidate the holdings in their smart contract for ERC-20 tokens. This guide is intended to be used by experienced blockchain developers, and technical questions can be addressed to the Bancor Developers Telegram Group.
The Bancor Converter contract has a function that allows users to liquidate their entire relay holdings for all reserves in a single atomic action. The liquidation function was introduced to the Bancor Converter in Version 11. Earlier versions must first be upgraded to version 11 or the latest version.
You will need:
- [Converter Address]
- Find your relay token on etherscan
- Click the "read contract" tab
- Go to "owner"
- This is the address of the converter currently used and the one we would need to use for liquidation.
- Access to the wallet that holds the relay tokens
- Go to mycrypto.com (always use a trusted endpoint to execute transactions)
- Click “Contracts” in the top navigation menu
- Paste the following:
- Contract Address: [Converter Address]
- ABI / JSON Interface:
- Copy/paste the ABI from this URL:
- https://etherscan.io/address/[Converter Address]#code
- Click “Access”
- Scroll down to the next step
- Select the “liquidate” function from the drop down
- Enter the amount that you’d like to liquidate under _amount. You can liquidate the part or the entire amount
- Sign in to your wallet (this must be the wallet that owns the converter)
- Click “Write”
Note that when specifying the amount, you will need to put the wei amount as a whole number (without decimal points). So to liquidate 1 relay token, you usually need to put in 1000000000000000000.
Once this function is confirmed on the blockchain, the following will happen:
- The amount you liquidate will be destroyed
- You will receive both reserve tokens to the same account
- The amount you receive is equal to the relative amount of relay tokens you hold, from each reserve. So if you hold 50% of the relay tokens in existence, you will receive 50% of each reserve balance.