Deploying Liquidity Pools
Creating a liquidity pool requires just one transaction as of v0.6
As of v0.6, the Bancor ConverterRegistry
contract does most of the hard work deploying new liquidity pools. Developers can still use the manual process to test their converters (see Deploying a Liquidity Pool
in the Guides section), but the converter won't be discoverable to the rest of Bancor Network.
The v0.6 release will go live in mid June. Until then, please refer to the Deploying a Liquidity Pool for Testing guide found here. The process described will be deprecated to a testing-only function once v0.6 is live.
This guide is for developers integrating Bancor into their dApp or smart contract. Other pool creators can use one of the community-managed front ends (see: Katana Pools) to customize and deploy their pools.
Step #1 - Deploying a new Liquidity Pool
The newConverter function on the ConverterRegistry
contract takes the following parameters:
_type
: converter type_name
: name of your token or pool_symbol
: symbol for your token or pool_decimals
: number of decimals on your pool token_maxConversionFee
: maximum trading fee in parts per million for transactions passing through your converter_reserveTokens
: the addresses of the token reserves to be held in your pool_reserveWeights
: the relative weights of each reserve token in parts per million. The sum of the values in this array must be 1,000,000.
For integration into a smart contract, use the Solidity interfaces below. You'll first need to query for the current address of the ConverterRegistry
contract before executing the newConverter function.
Network | ContractRegistry Address |
|
|
|
|
If you're developing with Web3, you'll first need to copy our ContractRegistry
ABI into your project. Find that here.
Then you can copy our ConverterRegistry
ABI into your project. Find that here.
And your Web3 implementation would look something like this:
Step #2 - Adding Oracle and Activating the pool
This step is only relevant for Bancor V2 pools
Following pool creation, Bancor V2 pools require to set the relevant price oracles. Only once this function is called, the pool will be activated and can be used.
|
|
|
|
|
|
Make sure you use trusted oracles that are part of the white list
Oracles must use the same pair. It is recommended to use oracles with price to ETH
Step #3 - Accepting Ownership
As the capstone to the pool creation process, make sure to execute the acceptOwnership
function on the new converter contract. Etherscan should have automatically verified your contract and this should be easily callable from their UI, or alternatively via your Web3 connection or smart contract interface.
Last updated