DeFi stack and use cases

Laura Spinaci
12 min readOct 8, 2022

We live in an economic world based on the exchange of tangible and untangible assets, fungible or not fungible. Blockchain is the railway where the exchange takes place automatically real-time, peer-to-peer without the absolute need of 3rd parties intermediation, lowering counterparties risks and costs.

Services provided by DeFi, once regulated, will be an extension of the TradFi foundational services like exchanges, landing, borrowing, securities and derivatives. Due to the composable nature of DeFi stack primitives, compounded dApps create new financial services that will evolve in the future based on the specific jurisdiction regulations.

1. DeFi stack

2. DeFi use cases

Conclusion

1. DeFi STACK

The stack helps out to understand DeFi primitives and macro use cases workflow, although layers are not standardized since the segregation can change based on the type of blockchain.

Like TCP/IP it is worth analysing where dApps fit, or not, into those layers.

The DeFi Stack

SETTLEMENT LAYER

The settlement layer is the foundation of all activities, where financial transactions take place and the state of the network change: updating the balances, updating ownership, buying and selling tokens, token swapping, data updating, and Smart Contract execution.

It is where information, metadata, value, and ownership are stored securely. All these operations take place on L1, layer one, blockchain layer, also called the settlement layer. Examples of L1 blockchain that allows the execution of smart contracts: Ethereum, Bitcoin, Solana, Algorand, Tezos, Avalance, ESOS, Cardano, Polkadot, Binance Smart chain, Stellar, Cardano …

Tokens native to the blockchain like ETH belong to the settlement layers, like ERC20 standard for fungible tokens.

Tokens not native to the L1 blockchain, belong to the asset layer.

ASSETS LAYER

Although native assets, fungible tokens (exchangeable with the same value), are part of the settlement layer, not fungible NFT tokens belong to the Asset Layer. Tokens serve different purposes, have different functionalities, and follow different standards (like for example ERC20).

There are different types of tokens, or digital assets: native, security (reward), utility (governance and liquidity provision..), crypto collectables (NFTs), and stablecoins.

PROTOCOL LAYER

The protocol layer is where DeFi dApps are deployed as smart contracts. Smart contracts executed on the settlement layer using native and not native tokens, produce DeFi output, or dApps, at the protocol layer: exchanges, lending and borrowing platform, decentralized assets management, blockchain derivates, stablecoins, and synthetic assets.

APPLICATION LAYER

It is where Web3 accesses Web2. The application layer is a Web2 UI, user interface, to access to dApps. It is a front end that provides access to one Smart Contact.

THE AGGREGATION LAYER

It is an extension of the application layer, a web2 UI, that calls multiple applications or/and multiple smart contracts (like federated access to many applications) aggregating your trade into a single interface that aggregates all your trades.

This is called composability, which is the ability to combine different applications across layers to create new types of applications. Applications are built, not from scratch, but by combining elements of other applications to form money lego.

Examples of composability [2]:

  • Take out a loan in a cryptocurrency
  • Divide this loan into two amounts.
  • half bet
  • invest the other
  • Remove both values ​​simultaneously
  • Pay the loan and interest
  • keep profit

DeFI applications should be built in a way that allows access to other applications.

[2] Money Legos eliminates a lot of the time and hassle around building a new financial app. Developers don’t need to build all the tools they need before putting them together to build the desired protocol, as those tools already exist in the form of Legos money. Plus, some of the best ones are already listed by the hundreds on platforms like defipulse.com or defiprime.com, which means developers can simply find the tools they need and start building. Also, since DeFi Legos are combinable, they can be run in any order the developer wants.

2) DeFi USE CASES

Trade Finance

Trade finance, by definition, is when multiple stakeholders exchange business transactions across borders, cross country, and cross-jurisdiction. In order to finance the trade a minimum of 3 banks are involved that need to guarantee the documents, or credit, so the business can grow through debt.

Bank’s letter of credit lays out the terms, removes counterparty risk, and guarantees payment collection. If on one end banks and financial institutions have high administrative costs and high risks, on the other end parties involved major hurdles is trust between so many people: lots of frauds, double financing, counterfeits, waste, manual fault due to lots of paperwork, information asymmetries, data standardisation, lots of validation and verification, lack of digitization.

Agreements between institutions, incompatible systems, cross-border regulations, different regulatory regimes between different countries, issues of trust among jurisdictions.

In trade finance blockchain networks' value proposition is trust between untrusted participants with a unique source of truth, a ledger that provides, provenance and state of the transactions, transparency, security with the combination of cryptography and a temper proof network, data integrity, operational efficiencies, cutting significant costs from counterfeits, and wastes.

Back Office — Operations

Remittance. By definition, remittance is a non-commercial, family and friends transfer of money by a foreign worker or a retail payment. The challenge with TradFi is that it takes from 2 to 5 days, and it is quite expensive.
Blockchain value proposition: the transaction is almost real-time, everywhere in the world and it’s cheap, only the cost of the transaction itself.
Reconciliation. The reconciliation process between two accounts' balances, or financial records, is done to verify if the figures in the two sets of records are correct and in agreement. It is obviously time-consuming and really expensive. Reconciling orders between different financial institutions make sure their data are consistent across the ledgers of their counterparties.
Blockchain provides a unique source of truth of shared data within a tamper-proof ledger where real-time transactions do not need to be reconciled or backed up.
Settlement & Clearing: in TradiFi the process is extremely inefficient since there are many intermediaries between the two parties in order to mitigate settlement risk as well as counterparty risk, which is the risk that the parties can default on their obligations. The clearinghouse makes sure the transaction between the two parties is settled without issues.
The main issues in the settlement and clearing process are:
- counterparty risk on the clearinghouse involved
- involving additional intermediary results in increased settlement (transaction) costs.
- various assets are cleared through various clearinghouses that imply more complex and less efficient liquidity management. In such a situation, a treasurer needs to optimize cash flows among a number of clearinghouses and constantly monitor sufficient funds.

How blockchain improves the process: blockchain enables trustless and decreases counterparty risk in a way that the delivery of an asset is directly linked to the instantaneous payment, reducing costs for various business processes. This can happen through a smart contract that includes relevant information. The result is that:
- the whole process is more efficient
- delivery of an asset is directly linked to the instantaneous payment for the asset.
- decreases the associated transaction costs
- decrease counterparty risk as it enables a trustless settlement process

Lending & Borrowing

Banks credit decision is based on depositors' creditworthiness. In TradiFi a loan is given only under certain conditions, credit score, that who is requiring the loan needs to satisfy to to assess the solvency.
In DeFi anyone can participate, there is no credit score, due to the disintermediation of those services. Customers instead of depositing their funds to a bank, they do it as liquidity into a smart contract that escrows these funds. Borrowers can only receive funds from the smart contract (which was originally provided by the depositors) after the borrower has posted sufficient collateral. Credit risk is minimized due to the overcollateralization (the collateral must be worth way more than the loan value) requirements and automatic liquidations. By taking out a loan against collateral, borrowers can still enjoy potential price appreciation of the collateral and create liquidity without incurring a taxable event (which would occur when selling). Borrowers still pay interest rates on their loans, which are hard coded in the smart contract and available transparently to all the participants. The loan would be done automatically, same for the interest rate.

DeFi atomic composability (several operations across multiple dApps bundled into a single transaction and executed together), allows innovations like ’flash loans' where the asset is borrowed, invested, and paid back within a single transaction.

Securities
By definitions, security is a financial instrument that hold value and can be traded between parties like stocks/equities, bonds, mutual funds, exchange-traded funds or other types of investments you can buy or sell.
There are substantial differences to buy stock/public company equity in TradiFi vs DeFi.
In TradiFi an equity transaction, like for example buying 50 shares of amazon stocks, start with an order sent on a phone, then the order is sent to the trading desk, that send to an exchange where the order is executed.
Confirmation of the order is sent to the buyer and seller then the exchange sends the order detail to the clearing house, which will settle the trade and send the settlement instructions to the buyer custodian and seller custodian. A total of three 3rd parties have been involved in this equity transaction: a trading desk, exchange, and clearing house.

Moreover in TradiFi like you don’t have control and ownership of cash sitting in a bank same is for stocks in Robynhood.

On the contrary in DeFi the process takes minutes, you can trade 24/7, you own the asset, and have the option to decide to get yield from that.

Staking

Staking comes from PoS — proof of staking consensus mechanism, the consensus mechanism so far most adopted by the majority of the blockchains. The consensus is the way to agree on which will be the next block linked to the blockchain. Consensus can be seen as blockchain’s Operating System.

Protocol Staking is when you hold a specific blockchain token and instead of lives it in a wallet, you locked it up to participate and secure the network, putting value at risk. When you protocol stake, you are running the protocol, running a node, securing the protocol, processing transactions, and holding tokens.
In bitcoin consensus mechanism PoW, there are miners and token holders, In PoS — proof of stacke, token holders that stake is also miners because you have to participate in the consensus running a node, the protocol, in order to earn some tokens onchain as form of reward of the work done. Protocol Staking is not passive interest, because you are doing the work to run the protocol through running a node, like validate others' transactions, secure the protocol...

From regulations standpoint it is not clear how to treat the reward from protocol staking, whether as income, or capital gain.

Stacking Lend — Liquidity- Yeal

Lend and Liquidity Staking, along with Yeal Farming, are different forms of staking, such as passive income [3].

Lend Staking: similar to a bank where they will lend out your tokens for a return. If those platforms are decentralized you are the owner of your tokens until you own your private key, otherwise, in a centralized platform the key, so the tokes, are managed by 3rd parties.

Liquidity Staking: Many automated market maker (AMM) platforms allow users to provide their tokens as liquidity and in return receive rewards. Lending platforms like Aave are decentralized and offer users a non-custodial way to participate (stake) as depositors or borrowers, in other words, you still control the keys to your assets. Centralized lending platforms like Celsuis on the other hand, offer a similar depositor and borrower reward structure, but they own the keys to your assets.
Staking even includes services like automated market maker protocols such as Uniswap, Sushiswap, and Curve. Within these AMMs, users can stake or lock tokens to provide liquidity to trading pairs, and in return, earn trading fees on the platform.
Yield farming is a way to earn passive income staking tokens. Users move their assets around between different high-yield marketplaces and staking protocols to attempt to maximize their returns.

Liquidity Pools

Liquidity by definition is the efficiency with which an asset or security in our case cryptocurrency can be converted into easy cash or another digital asset without affecting the market price.
The most liquid asset is cash, instead collectables and real estate is illiquid. If markets are not liquid becomes difficult to sell, or convert assets to cash. If the asset is valuable, but there is no market or interest from buyers, it becomes irrelevant. The same for crypto. The strongest crypto has deep liquidity, instead the newest one, struggles to create liquidity.
A liquidity pool is a collection of funds locked in a smart contract, in a permissionless environment where anyone can add liquidity.

Both retail and institutional investors can deposit, borrow, or trade crypto from the pool by leveraging smart contracts business logic. If pools are on the same chain, or made interoperable, this aggregates liquidity by attracting more investors.

Liquidity pools are the backbone of DEX decentralized exchanges. They are used to facilitate trading, lending, and also a foundational component for automated market makers (AMM), borrow-lend protocols, yield farming, synthetic assets, on-chain insurance, blockchain gaming and others.
Users called liquidity providers (LP) add an equal value of two tokens in a pool to create a market. In exchange for providing their funds, they earn trading fees from the trades that happen in their pool, proportional to their share of the total liquidity. Anyone can be a liquidity provider.

Atomic Swap

StableCoins

Stable Coins are crypto assets usually backed by US dollar, or other central bank fiat currency, but can be pegged also by CDBC, or commodities (such as gold, XAUt, which is digital token of Tether Gold).

There are three types of stablecoins: collateral backed like just mentioned, reserve, and algorithmic.

Today there are 134 stablecoins in the market, as per Coinmarketcap October 2022 that grew by 3,000% in the last two years, revealed by Binance Report.

Stablecoins with $147 billion market cap represents a 13.83% share of the total crypto (source Coin Gecko October 2022).

USDT, USD, BUSD, and DAI are the top four stablecoins by market capitalization.

Tether’s USDT is the leading stablecoin and the largest cryptocurrency after Bitcoin and Ether, while USD Coin (USDC), issued by BlackRock and Fidelity-backed Circle, is getting closer to the second position.

Although cryptocurrency can be considered a store of value and medium of exchange, due to its volatility, can’t be considered a good unit of account. Neither central bank's currencies are a solid unit of account due to the inflation …

Stablecoins aim to address the volatility of the crypto market through a stable price (without taking into account the inflation suffered by US dollar as well) while keeping the capabilities of crypto.

Stablecoins are permissionless, self-sovereign, and represent cash on the blockchain.

Stablecoins provide most of the liquidity in DeFi applications such as decentralized exchanges and lending protocols. They are been used as off-ramp/on-ramp solutions when the value crypto decrease, as bitcoin volatility edge, and where bitcoin has been banned by banks, as inflation edged in countries like Turkey, Argentina, and Venezuela where local currency lost more than 50% of its value.

Stablecoins have been greatly adopted by people that can’t have access to bank accounts since too expensive, to the lack of trust in institutions due to the depreciation of the local currency and want to use the US dollar, still seen as the strongest currency to transact, and want to get dollars out of the country as soon as possible and in the most efficient way. Stablecoins massively used in developing countries where the local currency is collapsing is driving the adoption of cryptocurrency since they are usually used as the first non-fiat currency to own.

There are stablecoins custodian or centralized, and not custodian or decentralized stablecoins. The most famous custodian stablecoins have been Facebook’s Diem, meant to be used as a payment method to be offered to the 2 billion Facebook users. Diem, due to its significant number of customers base, was a potential competitor of central banks. It was shut down by Facebook at the beginning of this year, 2022, and sold to Silvergate Capital Corporation (“Silvergate”) to enable a Silvergate-issued stablecoin, regulated and scalable, that will power the future of global payments.

Diem experiment accelerated the interest in Central Banks' digital currencies (CDBC), triggering more than 70 Central Banks pilots around the world.

The downside of stablecoins in regard to massive adoption is that the decentralized nature of stablecoins and lack of interoperability with banking legacy systems makes their universal acceptance problematic and legally still ambiguous.

Conclusion

We live in an economic world based on the exchange of tangible and intangible assets, fungible or not fungible. Blockchain is the railway where the exchange takes place automatically in real-time, peer-to-peer without the absolute need for 3rd parties intermediation, lowering counterparties' risks and costs.

Services provided by DeFi, once regulated, will be an extension of the TradFi foundational services like exchanges, landing, borrowing, securities, and derivatives. Due to the composable nature of DeFi stack primitives, compounded dApps create new financial services that will evolve in the future based on specific jurisdiction regulations.
DeFi self-custody introduces major capabilities, censorship resistant, and self-sovereign of your own money, it is also an opportunity for Financial Institutions, Banks, and custodians, to support the many that won’t take the risk that goes along with private keys self-custody.

The distinction between TradFi and DeFi will be blurry in the next 10 years and potentially disappears in the next 20–30 years.

[1] https://our.status.im/whats-with-defi-and-money-legos/

[2] Composability https://portalcripto.com.br/en/money-lego-building-blocks-of-defi/

[3] Staking

https://www.figment.io/resources/misconceptions-about-staking-protocol-staking-vs-liquidity-lending

--

--

Laura Spinaci

Business Transformation, Sustainable Data Centers, Impact investing