Joe Regenstein, CPA, FPAC

Introduction To Decentralized Finance (DeFi)

DeFi We live in a global, digital world. And yet, our financial systems have remained the same. We rely on central financial institutions to facilitate trade and payments – but what if there was a way to create a more decentralized finance system? What if we could use technology to raise capital, invest, and borrow without going through these centralized institutions? Well, there is! Decentralized finance (DeFi) is an emerging industry that allows for peer-to-peer lending, trading assets such as stocks or commodities, or even renting out your car. Here are the basics of how DeFi works and why you should care.

The best way to describe DeFi might be to contrast it to what we know about our banking and investing infrastructure and then discuss the problems it is trying to solve. We utilize a bank that provides locations, security, and technology to deposit and withdraw funds. Banks are gatekeepers for borrowing funds or accessing investment opportunities by controlling rates and fees. DeFi is also different from FinTech, an additional-technology layer over the existing centralized infrastructure. Some familiar names in FinTech are PayPal (peer-to-peer payment service), Stripe (online payment processing), and Plaid (interface for apps to connect to the customer’s bank accounts securely). Without centralized infrastructure, these services wouldn’t be possible. 

With all this infrastructure comes expense and inefficiency, such as paying 3% to process a credit card or waiting three days for a stock trade to settle. There is also opacity in the current financial system; it is challenging for a depositor to know the bank’s financial health. We rely on the FDIC to protect our deposits with oversight and insurance, but this is fallible, as demonstrated in the 2008 economic collapse of once-solid financial institutions. Things get even more complex when banking across borders.

According to Campbell Harvey in “DeFi and the Future of Finance,” DeFi solves “centralized control, limited access, inefficiency, lack of interoperability, opacitiy.” To do this, technology-minded individuals and groups created a new framework so peers could interact without a centralized organization. DeFi app (dApps) live on a decentralized ledger built on a blockchain most commonly associated with Bitcoin and Ethereum.  

Blockchains are a complex topic in and of itself, so we will only speak of it here as its function to provide security and the ability for anonymous systems to create trust. A block of transactions is chained to the previous blocks in thousands of ledgers maintained by individuals across the globe using cryptography.  

The node owners, also called Miners, validate transactions by solving a resource-intensive calculation called proof of work (PoW). The Miners use expensive computer rigs that need to run 24/7 and use a lot of electricity to earn crypto coins. Miners can trade the reward for US Dollars (or other fiat currency), spend it, or exchange it for other crypto assets. Countries where electricity is economical tend to have more miners as a result.  

There is a different type of validation that isn’t as resource-intensive, called proof of stake (PoS). Individuals stake large amounts of crypto assets to become a “validator.” Validators earn crypto coins for verifying a block of transactions is accurate and follows the rules. If they accept a block with false transactions, they can lose assets, and the network will block them as punishment.  

All transactions are visible to anyone with a node or using blockchain explorers. To hack transactions requires doing so on 51% of the ledgers at the same time or owning 51% of the asset. This type of attack would be costly and wouldn’t go unnoticed. The thousands of correct nodes would label the hacked version as illegitimate and cast it aside. As the height of the blockchain increases (the blocks stack vertically), it becomes less susceptible to attack, just like using a long password with letters, numbers, and symbols is much more secure. If someone did achieve 51% ownership, the asset’s value would drop, discouraging such an attack.

Back to DeFi

The dApps are the interface for smart contracts built on a blockchain.

“A crucial ingredient of DeFi is a smart contract platform, which goes beyond a simple payments network such as Bitcoin and enhances the chain’s capabilities. Ethereum is the primary example. A smart contract is code that can create and transform arbitrary data or tokens on top of the blockchain to which it belongs. Powerfully, it allows the user to trustlessly encode rules for any type of transaction and even create scarce assets with specialized functionality. Many of the clauses of traditional business agreements could be shifted to a smart contract, which not only would enumerate but also algorithmically enforce those clauses. Smart contracts go beyond finance to include gaming, data stewardship, and supply chain.”

Campbell R. Harvey – “DeFi and the Future of Finance”

Anyone who pays for their use can access the smart contract to complete the specified transaction. A contract built for gambling puts bettors’ money in escrow until the underlying event is complete. For this type of contract, an off-chain oracle feeds information to the smart contract. Let’s say the oracle in the betting contract is an ESPN.com application programming interface (API) that provides sporting event results. Then the smart contract pays out the winners based on the calculation coded into the contract. 

There are also lending contracts that allow someone to borrow against their crypto without selling to take advantage of arbitrage between assets. Since users are anonymous and there aren’t credit scores, borrowers need to put their crypto coins into escrow as collateral. The borrower may need to put up 150% of the loan value depending on the coin type. Once the borrower pays back the loan, they get their collateral back. In cases where the collateral falls below the threshold, the user needs to put more up or the position is closed out. There is an incentive for “Keepers” to monitor collateral levels and liquidate an undercollateralized loan. They get their liquidation fee, then the lender gets paid back, and if any funds remain, the borrower receives the balance. On websites such as Coinbase, an owner of ETH (coins used on the Eythum blockchain) could earn interest by converting their assets to DAI ( a stablecoin that tries to maintain a 1:1 relationship with the US dollar) with a current APY of 2.5%. That rate isn’t high but significantly higher than a two-year certificate deposit on Bankrate.com (less than 0.75% at this time). This transaction is known as yield farming and should produce higher interest rates over a certificate of deposit since we don’t have the overhead of a financial institution. Anytime an asset is lent, there are risks which we discuss later.

I previously mentioned proof of stake (PoS) and the reward for the validator. The Ethethium blockchain (PoW) is moving to Ethereum 2.0 (PoS). To become a validator on this new blockchain, a user must stake 32 ether to run a validator node. The validator earns interest on the asset tied up for this PoS activity. In January 2021, the APY was around 12% but has dropped to 4.5% at this time as more validators stake their ETH and set up nodes. Those who wish to participate but don’t have 32 ETH to stake can join pools of other users in platforms such as Coinbase.

There are even swaps that mimic real-world financial instruments. Smart contracts have a few versions, but a flash swap requires no upfront capital. In smart contract parlance, a flash loan is where the borrowing and paying back happen in the same transaction. If the arbitrage transaction the user is trying to execute resulted in a loss, this failure would mean the entire transaction never gets completed. This mechanism protects the lender since there is no way to collect from the anonymous counterparty. In the following example, the user sees the opportunity to take advantage of price inefficiency between two different decentralized exchanges (DEX).  One exchange says 1 USDC is worth 1 DAI while another says the USDC equivalent of DAI is .95 instead of 1.

Campbell R. Harvey – “DeFi and the Future of Finance”

The crypto used is DAI, a decentralized stablecoin used for lending on the Maker DAO dApp (Decentralized Autonomous Organization) and USDC (also called USD Coin, a fully regulated fiat-backed stablecoin). Stablecoin means it tries to maintain a 1:1 relationship with a real-world asset; in this case, both are tracking the US dollar. A Decentralized Autonomous Organization (DAO) is a business model powered by rules created with smart contracts on the blockchain, allowing participants to collect dividends or vote on decisions made by the DAO without the need of an intermediary. A DAO’s participants can either pay dividends or receive them from other participants in exchange for their contributions. They are autonomous because they make decisions based on consensus alone rather than a central party. I’ve written more about DAOs here.

 DeFi isn’t without issues that range from minor to severe. There are approximately 1.7 billion people without access to banks. DeFi could make savings and investing services available to anyone, but we still need the centralized system to withdraw hard currency and make payments in many places. Using these technologies, various methods to make money require a heavy knowledge of financial transactions and enough capital to make it worthwhile. I gave the example of staking money for Eth2 in exchange for 4.5% APY, which may be better than the typical savings account, but we aren’t going very far without a big bankroll. Participation requires the investor to have adequate liquidity to meet daily and emergency needs. The investor also needs a long enough time horizon to wait out market fluctuations and a high enough risk tolerance.

Smart contracts have risks as well. These contracts are visible to solve the issue of opacity, and a bad actor can take advantage of poor code to extract value that isn’t theirs. In November 2017, a hacker found an exploit in Parity’s digital wallet smart contract and removed $30 million worth of crypto. A simple omission allowed a bad actor to delegate responsibility and become the wallet owner.  

There is also a risk when using off-chain services for pricing and event information. Oracle risk is when an of-chain application is compromised.  

“Oracles represent significant risks to the systems they help support. If an oracle’s cost of corruption is ever less than an attacker’s potential profit from corruption, the oracle is extremely vulnerable to attack.” Campbell R. Harvey – “DeFi and the Future of Finance”

In our gambling example, assume the event scoring source is compromised, and a bad actor sends the smart contract an incorrect score. Since the contract’s rules are enforced algorithmically, the losing side would erroneously declare the winner. This example may be extreme as hacking is illegal, and this discrepancy wouldn’t go unnoticed.

Another oracle risk exists when it is the source of pricing information, and a small exchange that feeds pricing information to a larger one would benefit a bad actor. There is an arbitrage opportunity if the reward of a slight shift in a stable exchange is greater than the cost of manipulating the smaller, more volatile oracle.

Lastly is the regulatory risk when the activity is investing or lending. These are highly regulated industries in the US, and in China, crypto mining and trading have been banned. The SEC recently brought charges against a DeFi lender for raising $30 million in unregistered securities. They promised to back the minted crypto coins with real-world assets such as car loans. The originator of the coins was unable to do this and stood accused of making a fraudulent offer. Regulators are taking a closer look at these financial instruments to protect consumers.

How Else Might Smart Contracts Be Used

Another group that could benefit from a secure blockchain with smart contracts is Musicians. Digital Service Providers (DSPs) 

such as Apple and Spotify’s subscription services need to pay royalties to the artists’ streamed by their subscribers. Streaming subscription royalties is a complex topic, but a simple version goes like this:

  1. Digital Service Providers (DSPs) compute the Record Labels percentage of that month’s total streams and multiply by the revenue pool. Then they pay the Record Label.
  2. The Record Label computes the Artists’ percentage of the total streams and pays out according to the royalty percentage.

This process takes 2-3 months and is even longer when collecting royalties across the globe (9-12 months). If a blockchain manages royalty payments, it will cut out the overhead expense and opacity from the current system. There are so many streams of royalties from DSPs, public performances, radio play, and traditional sales of albums. Record Labels need Teams to interpret data for Artists. Then pile on a few lawyers and accountants, and now it becomes apparent why Artists get paid so little.

Conclusion

Decentralized finance has the potential to change the way we interact with the world. It’s a fast-growing industry that will revolutionize how people trade and invest in the future.

View original

#Blockchain #Cryptocurrency #Decentralized Finance #Smart Contracts