DEFI (Cryptography, blockchain technology and smart contracts).

0xWeiss
4 min readJun 6, 2022

DEFI stands for decentralized finances and it's made of 6 main basics.

  • STABLECOINS:

Stablecoins are crypto matched to a real-world asset (DAI, USDC, THETER, etc ). Let's say that you want to sell Ethereum because it's high priced and there were no stable coins, you would have to go to a centralized exchange and they would give you dollars in exchange for the ether. But they want a fee, and also the government will make you pay taxes for any gains you made. Instead of all this process, with stablecoins, you can quickly sell and buy without almost fees and trust.

  • BORROWING AND LENDING:

With the use of smart contracts, we can allow others to use our funds while still keeping custody of them. For example, I want to gain interest in my coins while you want to borrow some coins. So you will go to compound or save (to DEFI projects that allow borrowing and lending), I will deposit my coins to a smart contract and I will get “X” tokens in exchange, which will be a representation of my original coins + interest.

So whenever I want I can return those “X” tokens to the smart contract and they will give me back my original deposit + interests. In this case, if you are the person that borrows the money, you will have to overcollateralize the loan. That means that if you have to borrow 1000 dollars, you will have to pay 1200$ ish. That means that if you don’t pay back the loan, you will still lose money, and the smart contract is written in a way that can still give back the lender the coins + interest.

  • FLASH LOANS:

Loans that are used to borrow cryptos within seconds. Everything is done instantly with a smart contract. So eventually, if you borrow with a flash loan a million dollars worth of Solana, which stands at 100$ each in Binance, and tell them to sell them in Coinbase which is currently selling at 110$, you could literally make 100K minus fees.

  • DEX:

They stand for decentralized exchanges like Uniswap or Pancakeswap. Not a lot to tell, exchanges with a lot of tokens and cryptocurrencies, not like the CEX(centralized exchanges) that are regulated so they need to have some filters with the coins they are listing. Fees in DEXs are like 0.5% which solves the problem of going to another country, changing the currency, and paying up to 20% because they take advantage of you.

  • INSURANCES:

IRL you pay 100$ a month to pay for your car’s insurance and if you have an accident they will pay you back the amount to repair the car. With DEFI the insurance company is code. Let’s say that you have a flower company and you want to buy some insurance for your flowers because you don’t want them to get damaged. We can write some code that says that if there is an entire week during any period of the year with no rain at all, you can get paid 15k dollars.

However, to start this smart contract, you will have to pay 3k. So you can buy your flowers insurance through the smart contract, which is just a code that sees if the conditions are the correct ones to pay you. But how does a smart contract know if it's raining or not? Where does the money to pay you for the sunny week come from?

There is something called ORACLES, which are trusted sources that become a bridge between the real world and the blockchain.

We could create an oracle in our city that reads the temperature and it’s verified by a few people to make sure that cannot be frauded. Then, the smart contract can use that as a data source to decide if the insurance requirements are met or not.

Secondly, the 15k come from other people that bought the insurance but did not get paid out because the requirements were not met and also can come from liquidity providers or investors that gain an interest rate by lending the money to the protocol/ smart contract.

  • Margin Trading:

You want to buy tesla stock for 100 bucks and you margin the stock by taking a loan that will automatically sell the stock if it goes below your down payments. So if you want to buy a 100$ stock you need a 100$ loan.

Then the bank agrees to give you the loan if you give them a 20% down payment initially and 5% a year. If the stock price increases let’s say to 130$ and you sell it, you then pay the loan back and you will have to pay takes upon that. All the way around if it decreases to the level of 80$, in this case, what you paid for the down payment then forces you to sell the stock at 80$ and give them to the bank to cover the loan, so you eventually have lost 20$. In Centralized Finances normally to trade on margin you have to prove who you are and have a minimum of a few thousand to be able just to margin trade and the fees and very high.

But in DEFI, this is much quicker, and it’s open to anybody in the world with money.

--

--