Borrowing any token using any token as collateral

Moresh Kokane
5 min readJan 8, 2020

--

Creating a truly Open Money Market means allowing anyone with any token (say TknA) to be able to use that as collateral and borrow any other token (say TknB).

In the last 2 articles, listed below we discussed about how this can be achieved and how this is primarily predicated on the lenders accepting the tokens as collateral.

So if those holding TknA want to use them as collateral and borrow TknB then the TknB holders need to be ok with TknA as collateral.

In Compound there is a list of accepted tokens, 8 of them to be exact as of the date of this article. Any of these 8 tokens can be used to borrow against each other. Interest rates are market determined already on compound, the only thing that prevents Compound from accepting any token against any other token is how to determine the quality of the Asset against which a borrowing request .

How to determine how much can you borrow against an asset.

In Compound, they take the easy route: the amount you can borrow against each one of them is dictated by an admin set variable called collateral factor.

Collateral factor represents the fraction of your tokens value that you can borrow in the form of other assets.

In Compound this is hard coded and determined by admin.

However in an open model, this has to be market determined.

While lenders can still choose which tokens they want to specifically lend against (or go with a universal set) and determine the collateral ratios they are comfortable with, there has to be a mechanism whereby the collateral factors are calculated automatically.

Collateral factors are a function of the quality of asset, which in turn is a function of liquidity. If you put up the asset for sale, how easy or hard it is to offload the asset determines the collateral factors.

A token that has strong liquidity (like ETH for example) will have higher collateral factors and a token with hardly any buy sell activity happening in it will have a lower collateral factor. Less liquid tokens will hence command lower borrowing power and vice versa.

The two questions are how to measure liquidity and where to measure it.

The second question is not as critical but deserves an explanation.

Given that the model is designed to be open and censorship resistant, the best place to plug into for liquidity is Uniswap.

We have written a layman's explanation of how Uniswap works here

Uniswap is a decentralized and censorship resistant exchange for swapping any ERC20 token with any other.

The other question is how to measure liquidity and that needs to be investigated in greater detail.

When you trade, counterparty is the term used for the party you trade with.

For eg: If you swap ETH for DAI, then the party providing DAI is your counterparty.

In models such as Uniswap or Bancor there are no direct counterparties and the swapping is done against a pool, and the counterparties are effectively the liquidity providers to the pool.

Liquidity is a function of 3 main parameters based on the liquidity providers:

  1. How many?
  2. How much?
  3. How concentrated?

How Many and How Much

This is easy enough to understand, the more liquidity providers there are willing to swap your token the more liquid it is. And the more total amount there is up for swapping the better your odds of achieving liquidity.

How concentrated?

However the above 2 parameters by themselves are not enough. If you have 100 liquidity providers, with 99 contributing 1 token only and 1 whale contributing 99 tokens then your liquidity pool is unduly concentrated.

If the whale withdraws suddenly from the pool, the pool size shrinks by half.

So it is important to first measure how concentrated the pool is and then use it as an input parameter for our collateral factor calculations.

The way to do this would be first to determine the mean and median and then calculate the percentage difference between the mean and the median.

The mean (as we all learned in school) is basically the average of all without taking in account any concentrations, while the median is a more representative measure of the typical data point.

For the above example, the mean is 1.98 while the median is 1

The delta percentage is (1.98–1)/1 or 98%

This high figure is an indication of the lopsided dataset.

If the liquidity providers each only contributed 1 token only then the median and mean would both be same and the delta would be 0% which would indicate a more uniform distribution.

The more uniform our liquidity pool, the better it means in terms of the odds of achieving an exit on demand. A uniform pool is less dependent on any one actor and does not suffer from significant disruption if a small number of them exit.

The total amount being taken as collateral should always be only a small fraction of the amount available for liquidity on Uniswap.

For instance if there are 1 Million tokens available to be swapped on Uniswap liquidity pool, then 100,000 should be the maximum amount lent. This number can be set arbitrarily on the system as long as it leaves significant cushion.

The collateral factor for each token and the max borrowing limits should be calculated per block similar to the way interest rates are calculated.

If the borrowings for a loan exceed the value of the collateral then the same mechanisms that Compound uses can be used for liquidating the asset.

Such a mechanism of benchmarking liquidity takes the friction of collateral selection out of the users hands and makes the model simpler for everyone.

It also makes it possible for any token holder to borrow any token against the collateral held by him in an unstoppable manner.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response