What is DeFi lending?

Roger Willis
DAM_d2O
Published in
13 min readJul 24, 2022

This post explains how deFi lending works by making a comparison to banking and introducing the concept of credit as money.

Hey guys, I’m Roger, a contributor for DAM. I’m on the engineering side of things but have an interest in monetary economics and banking, so I thought I’d take some time out of writing smart contracts to explain a bit more about what we are up to.

In the DAM introduction post we wrote:

In the Protocol, investors are bankers, portfolios are collateral, d2O is the means of creating purchasing power, and DAM is a risk management wrapper.

What does this mean? Let’s start with “investors are bankers” and everything else flows from there.

Investors are bankers

So what actually is banking and what does it have to do with deFi?

A bank is a company which makes a market in credit. Banks are in the business of swapping their credit in return for your credit. In other words, banks give out loans of their credit and it just so happens that their credit is accepted as money in the general economy. When a bank issues a loan, it creates credit (or money) and their balance sheet gets larger (or “grosses up”). Therefore, the amount of credit (or money) circulating in the economy increases.

This is a good thing. Credit based monies allow for a flexible money supply and can, in theory, effectively respond to structural changes in the underlying economy, assuming governance is managed appropriately. E.g. politically neutral central bank governance, appropriately set interest rates and not issuing insane amounts of new credit 🤨

Let’s take an example.

When you buy a house and need a mortgage, what you are actually doing is swapping your credit (collateralised by the house which you are going to buy), which most people won’t accept, not least the seller of the house, for the bank’s credit — which almost everyone will accept.

DAM works in a similar way. Whilst you can create your own credit money collateralised against your crypto, it is unlikely anyone will accept it. At the very least, having to deal with a different coin per borrower is just annoying! Instead, DAM provides a set of rules and procedures which give a stable value to the credit you create. Anyone who uses DAM must follow the rules set out in the smart contracts. The benefit of this to users is the privilege of issuing d2O, a trusted credit based money (or stablecoin), as opposed to their own credit.

Back to mortgages. The interest rate you pay for the loan takes into account the bank’s view on you as a credit risk, the price of short term credit set by the central bank, time value of money and some other factors. In other words, the interest rate is the cost of money, it’s what you have to pay to get the bank to issue new credit for you, so you can buy the house. This credit is what we call money in day-to-day life.

A borrower gets a loan from a bank collateralised by the property. Note that the loan is the bank’s asset and the borrower’s liability. The deposit is the bank’s liability and the borrower’s asset. In other words, getting a loan from a bank is just a swap of your credit (the loan) for the bank’s credit (the deposit).

Why is bank credit, money, and my credit, not money?

It is due to trust. Trust is important for all types of money — even cryptocurrencies — and especially credit based money like USD, GBP, EUR, d2O and DAI.

Trust in the banking system is derived from a set of laws and prudential rules which govern what types of collateral banks can accept and what procedures they must have in place to ensure proper risk management and underwriting. It is these rules which provide confidence for everyone that the bank’s credit is worth what they claim it to be i.e. one dollar or one pound. This is why people will almost always accept bank credit as money, because they know it can always be redeemed — in this case that means transferred to another bank or converted to central bank credit, i.e. bank notes.

Regarding you, or us… It is simply not feasible for everyone to perform credit risk due diligence on everyone else to determine if their issued credit has value, or even what the specific value of it should be. Instead, we rely on banks to do this for us. That’s why banks are market makers in credit — they are credit risk managers and so, in theory, have the knowledge to navigate the credit markets effectively (but sometimes don’t).

Interestingly, the original Ripple created by a guy called Ryan Fugger, wanted to create a decentralised peer to peer credit based payment system, where participants could create credit lines with peers. The cool thing about the original Ripple was that it only required users to perform due diligence on their direct peers. Transitive credit flows were handled by the system whereby payments to someone who is not a direct peer of you could be routed through a mutual peer. I really like the idea of this but the network effects needed to get it working effectively are considerable. There was also no collateral in this system, making it only effective for smaller payments.

DAM has the same intention as the original Ripple — to create a decentralised credit based money. The main difference being that that the original Ripple was essentially a system with few common rules across borrowers. As such, there were many different credit monies created: $10 owed to you by Alice is not the same as $10 owed to you by Bob, even if they are in your close circle, and you had to manage this. In contrast, with DAM, all borrowers are subject to the same comprehensive set of risk management rules which ensure that the credit for all borrowers — the d2O they issue — can be treated as a fungible instrument. With this approach, all holders of d2O need to know is that 1 d2O is worth $1 and the protocol works to ensure this will be the case.

What happens if trust is broken?

Let’s imagine a hypothetical bank had poor underwriting procedures and accepted as collateral a bunch of uninsurable properties on a flood plain for high LTV/risky loans.

The properties subsequently flood and this is a problem for the bank.

They will have to impair the loans against the flooded properties because at this point it becomes unlikely the loan will be repaid. Why does it matter if the loan doesn’t get repaid? Because if it doesn’t, then the bank’s assets decrease (their balance sheet “grosses down”) and their liabilities stay constant. To balance the accounting invariant of assets = liabilities + equity, they must take a hit to their equity. This means shareholders lose money. If enough loans go bad and they eat through all their equity, then the bank may end up in negative equity and become insolvent.

But before that would even happen, people would soon find out on Twitter that the bank underwrote risky loans for flooded properties and transfer their deposits to other banks. This is because trust in the system is beginning to falter. People don’t trust that this bank will make good on their credit obligations — or deposits — to their customers. People don’t want to accept this bank’s credit as money. This has the effect of reducing their assets (and liabilities, as deposits are liabilities) as transferring a deposit to another bank requires transferring an equivalent amount of central bank credit — via the inter-bank real-time gross settlement system or deferred net settlement system — which is an asset for the struggling bank, to the recipient bank.

In crypto parlance, this is equivalent to a stablecoin “losing the peg”.

If this happens, it is likely that this bank’s deposits or issued credit would trade at a discount to other bank’s deposits but in practise, people would just withdraw deposits until the bank would require explicit emergency support from the central bank or government E.g. what happened to Northern Rock, a UK based bank, in 2008.

Interestingly, some banks in the UK issue physical bank notes which is unusual these days. The Royal Bank of Scotland issues notes which could potentially trade at a discount to Bank of England issued notes if RBS were to have (another) solvency issue!

Of course, a DeFi protocol like DAM is completely transparent. Stakeholders can see in real-time the breakdown of collateral backing d2O and have confidence of the protocol’s solvency.

Why is credit issued by different banks fungible?

In other words, why is an HSBC deposit worth the same as a Barclays deposit?Many different banks with different balance sheets and risk profiles can issue credit and despite the banks being different, their credit or money usually trades at the same price — it is fungible. Shops don’t care which bank is the issuing bank for a debit or credit card. It’s all the same stuff to them.

It is the trust and confidence in the system, derived by the rules mentioned above which allow all this credit to have the same value and be perceived as a good/useful type of money even if one bank has a slightly riskier balance sheet than another. It doesn’t matter in the long run because it is assumed that the rules will force riskier banks to eventually de-lever and reduce their risk.

Having a central bank as a lender of last resort also clearly helps to maintain bank credit fungibility.

Lack of trust in the system as a whole is disastrous for credit based monies which is why central banks and governments will do anything to save the banking system and why lending protocols such as DAM and MakerDAO will do the same to ensure the stability of their respective eco-systems.

I can issue my own credit money, just not very much of it

As an aside, it turns out that anyone can create credit money but probably not very large amounts of it. I could create some £100 IOUs secured against the fact that I’m a good chap and promise to redeem them for £100 on demand. I just probably won’t be able to get many people to accept them because there is an absence of trust or it is difficult for the recipients to perform due diligence to establish trust. In which case it’s easier for potential recipients just to not accept the IOUs.

I could even secure the IOUs against some physical asset I own. That might make potential recipients of the IOUs more willing to accept them but still, they would be relying on me to custody the collateral and unless there’s no explicit legal agreement or lien written into the terms of the IOU, people still wouldn’t accept them, I imagine.

But what if there was a transparent way to force me to behave well in such a way that people would readily accept my IOUs? Hold that thought. This concept is particularly useful for when understanding how DAM works…

Enter: Decentralised banking

A decentralised approach to banking looks much like a regular bank except that all of the functions are outsourced to other parties. In many cases this makes DeFi protocols more accessible than traditional banks.

It might sound strange but with a decentralised approach to lending, the lender and the borrower are the same entity! In other words:

Investors are bankers

Just like the example above where I create my own IOUs, the protocol (DAM) allows the borrower to create new d2O (or credit) secured against their cryptocurrency collateral.

In this image, we can see that the bank and borrower has been compressed into a single entity, the borrower. There is still a loan and still a balance of money (d2O) but there’s no need for a bank deposit now and instead of the loan being originated by the bank, it is originated by the borrower themselves!

There is no need for a bank. The deposit function of the bank is not necessary in DeFi because people use wallets instead (either controlled by themselves or someone else — which is basically just a custody function).

How is this possible? DAM is a protocol and community which enforces a set of rules and it is these rules which provides the trust necessary for the newly issued d2O (or credit) to have value. The protocol defines the underwriting criteria for how much new d2O can be created and other risk management controls such as maximum d2O issuance across the whole protocol, what type of collateral can be accepted and the specific LTV for each type of collateral, etc.

It is the presence of these rules which are applied across each user (and their respective vaults) which allow the issued d2O by each vault to be worth the same for each user despite different amounts and types of collateral being present in their vaults. In this regard, a vault is analogous to a bank and just like how different banks each issue credit which is fungible, with DAM, different vaults each issue d2O which is fungible.

We need price discovery for d2O

It’s all very well issuing credit money but we need a means to value it and the only way to do this is to facilitate a market in it with some other instrument. With d2O we intend 1 d2O to be worth $1. Therefore, we need to facilitate a market in d2O with another instrument which is worth $1. It just so happens there’s a few dollar proxies: USDT, USDC, DAI, etc.

In our case, the market making function is likely to be a stableswap pool. The stableswap pool is analogous to an interbank payment system which allows holders of d2O to swap it for other credit based monies issued by other entities or users of decentralised protocols. You could also swap d2O for an algorithmic stablecoin but I wouldn’t recommend it!

Just like in the banking example above, if holders in d2O lose confidence because the underwriting rules set by the protocol are poorly conceived, then they are likely to sell their d2O for other stablecoins or cryptocurrencies and thus the value of d2O relative to the dollar (or proxy for it) will fall. On the other hand, because d2O will be over-collateralised and have prudent underwriting in place, it is likely that it will trade around $1 under normal circumstances. There’s a buffer of collateral and other preventative measures before d2O becomes under-collateralised.

If there is no need for a bank can I just create credit without DAM?

If the lender is the borrower, then, in theory, people can just create credit collateralised against their cryptocurrency portfolio without DAM.

You could try that but you would have to create an equivalent secure protocol yourself and convince people that the protocol can be trusted to safely lock the collateral and that you would put in place sensible governance around risk management. That’s quite a lot of effort and requires knowledge and restraint to be effective and trusted in the long-term.

It makes more sense to have a protocol which multiple people can use. It also makes sense to have multiple protocols which compete on capital efficiency, cost and utility.

What if something goes wrong?

Taking a specific vault into account, in the event that the collateral which d2O is redeemable for falls by what we — as the risk managers for the protocol — deem to be too much, then a portion of the collateral must be liquidated (sold) to pay back the outstanding loan of d2O. This de-levers or “grosses down” the vault and collective balance sheet of the protocol. By collective balance sheet, I mean the consolidated balance sheet comprising all the vaults.

If we do not forcibly de-lever the consolidated balance sheet of the protocol then holders of d2O may eventually lose out due to inflation, which is what happens if the value of collateral does not fully cover the value of issued d2O.

We certainly cannot have under-collateralised d2O floating around the markets because it undermines the confidence and trust in the currency as a whole. Indeed, this is why “unhealthy” vaults will be liquidated in advance of them actually being under-collateralised.

Liquidations are performed by third parties who can purchase the collateral associated to a vault in distress at a discount, so they can sell it back to the market for a small profit. They do this by sourcing d2O on the secondary markets and using it to purchase the collateral.

The protocol has a number of mechanisms to ensure that d2O borrowers always remain solvent and and that the d2O/dollar peg holds and we will articulate these closer to launch.

All this banking stuff is cool but what about stablecoins?

In the intro post we said:

d2O is the means of creating purchasing power

This means that, with DAM, it is possible for users to create credit or purchasing power against their own crypto portfolios.

In this regard, the issued d2O is the stablecoin. That’s basically it. So now you know what d2O is — d2O is a credit based money, collateralised by cryptocurrencies. And as we have seen above in the beginning of this article, stablecoins are conceptually no different to bank credit money or central bank credit money (otherwise known as fiat currency). Bank deposits are collateralised by loans to customers. Central bank deposits are collateralised by loans to the government, swap lines with other central banks, gold and various other financial instruments. DeFi stablecoins are collateralised by cryptocurrency, only because that’s the easiest thing for us to use as collateral. Hence, from the intro post quote above:

portfolios are collateral

However, there is no reason why d2O cannot be collateralised by real-world assets such as shares of real-world property, tokenised equities or fixed income instruments. In this regard, the fact that d2O is crypto-collateralised is orthogonal to the fact that it is a stablecoin.

Lastly, as mentioned above, the protocol allows people to be their own bank. Everything that the protocol allows has a parallel in traditional banking and the only reason why it works is because of the governance in place which sets the necessary credit risk management policy. In this regard:

DAM is a risk management wrapper

DAM, the protocol, doesn’t lend to users of the protocol. Instead, DAM and its community comprise the set of rules for making the protocol work. The smart contracts, the appropriately set risk management parameters and the means to have a set of experts on hand in case they are needed.

Roger Willis, DAM contributor.

References

It would be rude not to include — what I believe — are the two best sources to learn about monetary economics and banking. I was only able to write this blog post because I’ve learnt from the best:

  • Perry Mehrling, The Economics of Money and Banking, 2016
  • Alfred Mitchell-Inness, What is money?, The Banking Law Journal, May 1913, pages 377- 408

Medium Post was updated on December 5th to include the new stablecoin name d2O

--

--

Roger Willis
DAM_d2O

Defi developer contributing to @dam-dprime , software engineering, monetary economics, endurance running