The Bancor Protocol enables automatic price determination and an autonomous liquidity mechanism for tokens on smart contract blockchains.

Autonomous (and automatic) liquidity — as in you will always get a buyer/seller for your assets instead of finding a p2p match on your own or relying on a centralized matching engine — sounds a bit fantastical, but it actually works. Bancor’s decentralized exchange (DEX) is actually one of the more convenient and mostly used solutions on the market right now.

How does it Work?

Implementing and utilizing the autonomous liquidity mechanism is possible via two approaches:

First, if you are launching a new ERC20-compatible token, you can implement it according to Bancor’s Smart Token Standard, by inheriting the SmartToken contract (https://github.com/bancorprotocol/contracts/blob/master/solidity/contracts/token/SmartToken.sol).

This approach will allow you to connect to a Bancor Converter directly.

In the case that you have a good reason to not go down this path, you can also create a Token Relay and use it to connect your token with the network.

Kudos on making all the code open, BTW.

Bancor Formula

Behind the autonomous liquidity mechanism, there is an automatic and deterministic price calculation, which is conceptually similar to how fractional reservers work (as described in the Bancor white paper).

Every Smart Token maintains a ratio between its total value (total supply, multiplied by token price) and its connector balance. This ratio is referred to as the Connector Weight (CW):

The Smart Token’s total value (i.e., its market cap) is the amount of money one would get by selling every token at its current price. The price of a Smart Token is denominated in the connected token (for example, the price of BNT is denominated in ETH, its connected token).

These relationships define Bancor’s pricing algorithm because they allow the system to calculate each Smart Token’s price as a function of 1) its Connector Weight, 2) the connector balance, and 3) the Smart Token’s outstanding supply:

Each connector will always have at any given time an accurate and irrefutable record of the size of its balance and the current number of Smart Tokens in supply. That way, it only needs to know the CW in order to continuously calculate the correct price for a Smart Token while both its connector balance is changing (with buys and sells as well as connected token price movement) and its supply is changing (with buys and sells, which occur by sending

to or withdrawing from the connector balance).

The CW is expressed as a percentage greater than 0% and up to 100%. As mentioned, it is initially set by the creator when a Smart Token is configured. The value chosen for the CW has significant implications for the pricing of the token, and may also be changed, depending on the Smart Token’s chosen settings.

Code is Law?

One major criticism of Bancor has been that the introduction of some safety hatches and upgradability tools (one of which has backfired, unfortunately) makes the system less decentralized.

It’s definitely a valid point and has been discussed at length, but we should also ask ourselves, what are the alternatives? An immutable and governed-by-code world highly resonates with me, but unfortunately the people who are crafting it are imperfect, to say the least. In the traditional world, we apply so many pre- and post-production tools to mitigate our errors: TDD, 100% code coverage by tests, 24/7 APM, data aggregation and analysis, self-healing code, blue/green deployment — just to name a few. Yet, as we all know, very few of these tools are actually available on Ethereum today (and unlikely will be available any time soon).

It would seem to me, that Bancor’s approach is a necessary compromise. It’s not perfect — but being familiar with all the advances and improvements that the team have been working on — the alternative of a stagnated and obsoleted system would be much worse.