Yield Farming Chapter Five - Smart Contracts

0 44
Avatar for CryptoMasterMiner
2 years ago

This is Chapter Five, focused on Smart Contracts, in a series of articles that will be released about yield farming. The purpose of this series is to introduce the concept of yield farming to those who are unfamiliar with it, then move into various yield farming strategies and finally step-by-step walkthrough of the process. I hope you enjoy the series and any feedback you have would be greatly appreciated.


Chapter Five - Smart Contracts

  Smart = programmed so as to be capable of some independent action

  Contracts = a written or spoken agreement

Smart Contracts are self-executing computer programs stored on a blockchain that run when predetermined conditions are achieved. These programs automate an agreement to take place on the blockchain so that each party understands the certainty of the outcome without the need for an intermediary to get involved.

What is a Smart Contract?

Smart Contracts are computer codes that manage financial agreements between two parties, one being a buyer or borrower and the other being a seller or lender. The smart contract code contains the executable agreement that is triggered when the conditions of the sale or loan are met. Once the code is executed on the blockchain, the transactions that take place due to the smart contract can be traced and are irreversible. 

Smart Contracts were first invented a full ten years before Bitcoin came into existence when Nick Szabo, an American computer scientist, invented a virtual currency called "Bit Gold." Although this launched in 1998, Szabo actually first proposed the idea of a smart contract four years earlier and this served as a basis for his newly invented currency. 

In reality, smart contracts are basically "if/then" codes that state "if" something happens "then" execute something to happen in response.

Smart Contract Analogy

You can think of a smart contract like a vending machine transaction. As the buyer, you agree to pay for an item for a predetermined amount of money. The seller is the owner of the vending machine who chooses the amount the item costs and provides the item within the vending machine. The vending machine's computer code acts as a smart contract, verifying the amount paid is equal to or greater than the amount required and then executes the transaction by expelling the item into the receiving area and refunding any overpayment. 

Just like with a smart contract, once the transaction takes place on a vending machine it cannot be reversed. 

Smart Contracts in Yield Farming

Back in chapter one we discussed three types of yield farming; staking, lending and liquidity providing. Smart contracts can execute transactions in each of these types of yield farming activities.

Staking - when staking your cryptocurrency, the simple smart contract will automatically provide you with the amount of interest as dictated by your agreed upon rate and at the agreed upon time intervals.

Lending - the smart contract will take the borrowers collateral and deposit that amount, which is equal to or greater than the value of the loan itself, into the lending platform. The borrower will then have to repay the amount of the loan plus the agreed upon interest or have the collateral "liquidated" and given to the lender. There are a number of conditions that can be placed onto any given loan within the contract including "early liquidation" if it appears the borrower is getting into trouble with his loan.

Liquidity Providing - smart contracts control a number of functions when providing liquidity including allowing users to exchange one token for another. Once your LP tokens are made, the smart contract ensures the underlying tokens maintain a 50/50 ratio in terms of value. It also ensures you are rewarded in interest for holding LP tokens by appropriating you with a percentage of the transaction fees based on the overall percentage of the total liquidity pool you own.

Key Benefits of Smart Contracts

In many ways, smart contracts in yield farming are actually safer than those used in loans in the real world. Part of this is due to the fact that the loans in cryptocurrency are often over collateralized and are locked into the smart contract. Also, loans in the real world take place in very bureaucratic organizations and take a lot of time to process, however, smart contracts can implement loans very quickly. Since rules are already established, there is far greater consistency in smart contracts than in traditional lending and borrowing.

Furthermore, smart contracts offer some very important additional benefits including:

Immutability - the blockchain smart contracts run on are decentralized and offer tamper-proof transactions that are secure and can be audited.

Permissionless - smart contracts manage tractions in decentralized financial applications allowing anyone with a crypto wallet and internet connection access to the application.

Transparency - the blockchain smart contracts are on record every transaction that takes place on the network and are verified by users on that network.

Interoperability -  ability of computer systems and the software code to exchange and make use of information allows the applications to work together in an integrated fashion.

Self-custodial - one of the great benefits of owing cryptocurrency is that the holder can control it fully. This is true of most yield farming actions as the transactions are performed on Web3 wallets controlled by the users.

Whiteboard Crypto YouTube Video - What are Smart Contracts in Crypto?

Zero width embed

Previous Chapters

Yield Farming Chapter One - What is Yield Farming?

Yield Farming Chapter Two - Decentralized Finance

Yield Farming Chapter Three - Automated Market Maker

Yield Farming Chapter Four - Liquidity Pools

1
$ 0.00
Avatar for CryptoMasterMiner
2 years ago

Comments