Decentralized Loans: Is Under-collateralization Possible?
Trading ore for d'or

Decentralized Loans: Is Under-collateralization Possible?

When I first learned Solidity, after grasping the basics and writing a few simple smart contracts, my first significant learning experience involved trawling through the constellation of code libraries that make up Aave, the decentralized crypto-lending platform.

Side note: I do not recommend this approach to beginners unless you are a stubborn person with a masochistic streak. In hindsight, I would not choose it again, although it was a learning experience.

I found DeFi lending fascinating. Still do.

In traditional lending, unsecured loans and loans that are only partially collateralized?—?backed by nothing or perhaps some other asset that does not cover the total amount?—?can be issued based on an assessment of the borrower’s creditworthiness. In short, it helps if you know who you are lending to.

In DeFi, it is more complex. With anonymity and the ability to spin up a blockchain address in seconds on a chain such as Ethereum, you are lending blind. Add to that the dramatic volatility of cryptocurrencies and digital assets such as NFTs, and as a lender, you are in a bind.

Before Charles over at Resonance Security introduced me to Dmitry and Vlad, the founders of Primex Finance, I thought there were only two ways to manage anonymous loans on a blockchain:

  • over-collateralization, and
  • flash loans

Charles had his team audit some of the Primex code and thought I would be interested in the project. Clearly, he knows me well!

Over-collateralized loans

Over-collateralization is when you must deposit something worth more than the loan’s value as a second asset. For example, to borrow 100 USDC, you might have to deposit 150 dollars worth of ETH. In decentralized over-collateralized lending protocols, this is supposed to provide enough of a window for the collateral to be sold off to cover the loan if the value of the collateral starts to plummet, and there are incentives for people to monitor the market prices and trigger liquidation if those prices shift downwards too much.

Midjourney may have solved hands, but it hasn't solved trombones...

You can think of this as the equivalent of a pawnbroker being allowed to sell the antique trombone you pawned if (and only if) the market for antique trombones suddenly starts crashing.

Flash loans

A flash loan is taken out during an atomic transaction in which you receive the funds, use them for some purpose, and then repay the loan (plus any fees) all in one. If any part of the transaction doesn’t work, then the whole transaction fails.

This is the blockchain equivalent of someone saying: “Can I borrow your pen for a second?—?I’ll give it back straight away.”

A third?way

As a former test engineer, inventor, and staunch fallibilist, I would never bet on there only being two ways to handle anonymous loans. However, even though I spent a few weeks considering the problem back in 2020, I couldn’t come up with another method.

But that’s exactly what Dmitry and Vlad have done, and from what I can tell they’ve achieved it by using some genuine “out of the box” thinking in the real sense of the phrase.

Suppose you take the naive approach, and look at the problem of guaranteed anonymous loans from too close up, considering only the borrower and the lender. In that case, I predict you will have a hard time coming up with a lending protocol that isn’t based on over-collateralization or a time-limited atomic transaction.

However, if you step back and ask yourself, “What might the borrower want to do with the funds they receive?” new solutions become apparent.

In Primex’s case, they considered loans solely for margin trading, which opened the box and allowed them to think outside it.

Why is lending for margin trading different?

You can read all the details and practicalities of how Primex has implemented a lending system for margin trading traders here. Still, it helps to understand the basic underlying concept:

If a trader sees what they believe is an opportunity to invest in something for a limited time and turn a significant profit, they will want to borrow funds to maximize their returns. This is known as “margin trading”.

The lender will be OK with the loan if the traded asset increases in price (or stays the same). Either way, they get to charge interest on the loan and make a relatively safe profit.

However, if the traded asset decreases in price, then there comes a point where the collateral provided by the trader only just covers the loss. In traditional trading, this results in a “margin call”, whereby the trader or the broker liquidates the position to ensure losses to the trader do not become losses to the broker or lender (or the trader has to provide further funds to move the position out of the danger zone for the lender).

Decentralizing margin?calls

In the decentralized protocol provided by Primex, a variety of limit orders can be set up, positions can be managed, and most importantly, margin calls are acted on automatically. Through this mechanism, a lender can provide trading funds to a trader at a lower risk without requiring the trader to put up more funds than are lent as “collateral.”

By acting as an automatic intermediate system (this is called the Keeper Network), the Primex protocol ensures that:

  • lenders can’t liquidate the trader’s position just because they feel like it, and
  • the trader cannot continue to maintain the position if it could start to cause losses to the capital provided by the lender.

Of course, the mechanics behind this are a lot more complicated than the description I’ve provided above, but that, in a nutshell, is the idea that makes the system work.

Conclusion

I am not a trader?—?I tried it for a year back in 2018 or so and discovered that I simply do not have the temperament for risk-taking, and I like to be able to sleep at night. But some people seem to enjoy it.

What I find interesting is the mechanics behind it all, and in this case, it was fascinating to discover that it is possible to provide under-collateralized loans in DeFi.

Provided those loans are used for a specific, narrowly defined purpose.

In this case, to provide margin trading in a decentralized and automated manner, without lenders relying on a broker detecting that a margin call needs to be made and liquidating them on behalf of a trader to cover the losses.

All in all, it is a lovely example of how changing the scope of the problem you are looking at (either by going wide or, in this case, by going narrow) can result in a new solution?—?one that initially seemed impossible.


Paul F. Dowding

Blockchain & Distributed Ledger Technology Innovator | Co-Founder & Head of Design at L4S Corp.

1 年

Keir - as a person that wasn't trading in the legacy world but had to finance, settle, account, and report on all the positions, I would offer some advice from the TradFi world, which the DeFi world is learning iteratively, the hard way. Lending in DeFi is not lending as in "spread-based" lending. You are allowing the lender and holder of your collateral to enter into a total return swap without the requisite delta one hedge. It is a full risk-on transaction. That is not a problem, as long as it is disclosed, which it tends not to be. You may have over collateralized your loan to protect them but they are taking the collateral to high risk trades at a casino. Lastly, people should realize that "DeFi" is not a "De..." as people think. In fact the DeFi world looks remarkably similar to the legacy world. This video explains why and outlines a solution for either digital legacy assets or crypto assets within a regulated network. https://lnkd.in/gNAvyYnZ

回复
Monica Jimenez

Metaverse, NFTs & DAO. Helping people and businesses to navigate the Web 3.0. Building happy and hopeful human experiences.

1 年

Thanks for sharing Keir Finlow-Bates !

回复
Floris Kleemans ???

Information and value system engineering

1 年

Keir Finlow-Bates I’d recommend you to have a look at the high frequency traders (HFTs) in traditional finance, who use similar MOs but then at aggregated data sets with correlations. HFTs basically try to exploit information advantages by being fast(er). While many see HFTs as immoral operators, fact is that they tend to (more often than not) reduce market inefficiences, reduce bid-offer spreads and provide liquidity. The market crashes during the financial crises in 2008 (when there was basically no regular buying liquidity), were softened substantially by liquidity provision of high frequency traders (who didn’t lose as much as the market in general). Just beware, black swans can take entire operations down in a matter of seconds though, either by misinterpreted or “hallucinating” AI / machine learning or human reasoning. “Model investing” is a bit like driving a car by looking in your rearview mirror, as models have been built on past correlations and experiences. Regime shifts can be nasty buggers and without the centralised buffers in traditional finance, could have more serious ripple effects than in DeFi markets. Market liquidity optimising algos are probably more relevant for DeFi. Find liquidity and deploy it

回复
Rama Miriyappalli

Engineering Manager,Enterprise Data Architect & Strategy Leader, Application Development, Team & Thought Leader, Big Data, Cloud, Agile, Scrum, Data Governance, Process Improvements.Expert Engineer(E2)

1 年

Pretty cool if it works. Prevention is better than cure

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了