BTC-pegged tokens liquidity for DeFi without impermanent loss

Camille Blanc
4 min readApr 11, 2020

--

Thanks to Ethereum’s smart contracts and their composability, the DeFi space has developed strongly in recent times : new and previous projects can combine together to create other unique solutions.

From an economic point of view, and according to DeFi Pulse, the total value locked (TVL) in decentralized finance is still around $700 million despite a peak of $1.239 billion on February 15, 2020.

Bitcoin, with a market cap 7 times higher than Ether, could be the game changer in the DeFi space. Thanks to cross-chain composability solutions, one BTC on the Bitcoin blockchain can be bridged to one tokenized bitcoin on the Ethereum blockchain. Provable Things have well described their solution and those of other teams in a series of articles.

Many decentralized exchanges (DEX) such as Bancor, Uniswap, Kyber, Airswap act as Automated Market Makers (AMM) by allowing instant conversion between tokens without the need to match sellers and buyers. The price is automatically calculated based on the amount traded and the balance of each token in the liquidity pool. Any token holder can lock his or her tokens in the pool and act as a liquidity provider incentivized by earning pool fees (generally between 0.1% and 0.5%). However the liquidity provider is exposed to impermanent loss caused by a different price evolution of each token in the same pool (e.g. ETH vs DAI).

In “Eliminating Impermanent loss” article, we learn that only stable pools where the underlying assets are more or less fixed at a 1:1 rate can avoid these losses (ETH+sETH on Uniswap, DAI+USDC+USDT+TUSD on Curve). Therefore, in order to efficiently bring the bitcoin’s liquidity to DeFi, all we need is a stable pool composed of tokenized bitcoin and it would be nice not to have to develop a smart contract for this purpose.

Finding a user customizable AMM

Until recently there was no solution available. First Balancer Labs released its beta where the team created liquidity pools, showing the possibilities for the future, but unfortunately we can’t create a pool ourselves yet.

Balancer Labs Shared Pools

Then one of the most ambitious DeFi project, whose ICO raised more than $150 million in 2017, finally woke up. Yes it is Bancor and its complex formula and implementation (for fun you should take a look at their BancorFormula.sol contract or not…).

BancorFormula Maclaurin summation

Surprisingly, the fact that bancor dex (accessible through bancor.network) exposes only conversions of tokens from pools of 2 evenly distributed tokens (e.g. BATBNT, ENJBNT, ETHUSDB) is more a marketing choice than a technical limitation because the code allows many more possibilities (any ERC20 token as reserve, adjustable weight and pool fees). And it’s precisely this potential that Pritam Roy, the Sustain Web3 Gitcoin hackaton winner, has leveraged with Katana Pools, a self-service portal for creating liquidity pools.

Choosing BTC-pegged tokens

WBTC, pBTC, rBTC, renBTC, tBTC, imBTC, HBTC : the list of tokenized bitcoin is long. Some are more censorship-proof than others but in the end let’s be pragmatic and select the tokens that best meet the following criteria:

  • Availability in a non custodial way
  • Decent circulating supply
  • Project maturity
  • Transparency
  • listed on CoinGecko
  • Integration with DeFi protocols/solutions
pBTC Dapp

I finally ended up with these 4 tokens :

  • WBTC: biggest circulating supply, ubiquitous in DeFi space
  • pBTC: new and already integrated with Bancor and Kyber
  • imBTC: fair circulating supply, important pool on uniswap
  • HBTC: fair circulating supply, available on DDEX and LendFMe

Building all together

After converting some ETH to 0.1 pBTC (via powerful 1inch DEX Aggregator) and borrowing the other tokenized bitcoin in the same proportions (via Compound, Lendfme or Aave), I started the pool creation process on Katana Pools which mainly act as an interface to the different Bancor smart contracts (Converter contract creation, SmartToken contract creation, approve and add each reserve to converter, define fees and rights, register new pool in Bancor Converter registry).

For the creation of this tokenized bitcoin liquidity pool, I set 25% weight for each of the 4 tokens, defined the pool name and set its symbol to “BTCDEFI”. Once the form validated, I had to sign more than 30 transactions via Metamask, for a total duration of about 1 hour and a total cost of 0.04 ETH.

And voila!

BTCDEFI on Katana Pools

The “BTC-pegged tokens for DeFi apps (BTCDEFI)” is live with an initial liquidity of 0.4 BTC and no risk of impermanent loss.

Once the pool is created, it is very easy to add liquidity through Katana while accessing to the View Pools tab, filtering with “BTCDEFI” and then choosing the amount to stake.

You can find a more complete tutorial here.

--

--