Wednesday 29 December 2021

Understanding how Decentralized Finance "Defi" work

What is defi?

Defi

Defi is an acronym for decentralized finance in the centralized finance which is where there's a central authority that controls the flow of money the government and the banks control it they don't really say they do but they do they can print more of it if they want to they can stop you from borrowing it if they don't want you to they can even stop you from having a bank account if they wanted to at any time they could have your money they have your money so they could change it and you really couldn't argue against it, this mean you could but how would you prove it you gave your money to them it was based on trust also if you're running a business they limit what you can do.

for example let say you have a little magical tree business that may be for medicinal purposes they can tell you not to bring in any of that money from the business to the bank which seriously limits you it means you can't deposit it or invest it or even use them to keep it safe, the traditional finance is quite expensive pay day loans go up to $500 credit cards can average 25 and even personal loans can cost you 18 of your value these are really high rates but you pay them if you need to because that's what you got the alternative is decentralized finance where there are no banks instead there are pieces of code that run and act as a bank they're open to anyone they don't require you to trust them because they're literally a piece of code running a program if you wanted to you could read through it and verify that it's not going to scam you they are also censorship resistant and lastly they are much, much cheaper than traditional centralized finance.

Decentralized finance is built on three main important things which is cryptography, blockchain technology and smart contracts. The cryptography the blockchain and how smart contracts work there are five pillars of decentralized finance. Which as follows

1.     1. Stable Coins

Stable Coins

There are need to understand the bridge of decentralized finance to centralize finance and that is cryptocurrency that is matched to a real-world asset for example dai (DAI), tether(USDT), and USD Coin (USDC) are all what we call stable coins this is because their price is tied to the united states dollar think about it like this when you buy one for one dollar a new USD Coin is minted when you withdraw one a USD Coin is burned so the coin is always worth $1 one united states dollar now the purpose of this is to have a reliable way to buy and sell certain coins without having to buy and sell them instead we can just trade them here's.

Example of why this might be beneficial let's say you bought one ethereum (ETH) at $500 well now it's $1000 one thousand dollars and you want to sell because you think it's high you want to take your profits without stable coins you have to sell your ethereum (ETH) first at a centralized exchange like coinbase or binance and in return they will give you some united states dollars for it now of course they're going to take a cut of that transaction because they want a fee and they're going to take it also the its makes you pay tax on any gains that you make from trading or selling

Coinbase and Gemini will be snitching that you made it so you can't really get around it then wait for coinbase or binance to give them to your bank and then withdraw them from your bank because you don't really want the bank controlling your money well a month later let say  ethereum (ETH) drops to $250 and you want to buy more so you deposit your $1000 back into Coinbase and wait a few days for the transaction to clear because you have to wait and then buy for ethereum (ETH)  and hold them well ethereum rises again to $500 and you decide to sell so you sell them at your centralized exchange you bite the fee and then you wait a few more days for it to enter your bank account

Another clearly example there's a lot of fees there's taxes and there's waiting now let's say we utilized a stable coin like USDC you bought one ethereum at $500 five hundred dollars and it raises to $1000 one thousand dollars instead of going through all that headache you trade your one ethereum (ETH) for $1000 USDC and you just hold it a month later similar to the previous example it drops to $250 and you trade your $1000 USDC for for ethereum then it raises to $500 and here's the beneficial part within five minutes you sell your for ethereum for $2000 two thousand dollars the fees were less than one percent because you used what we call a decentralized exchange to trade which is something because of it you were able to trade almost instantly plus the USDC was secure and you trusted it because it's just code it doesn't change unlike Coinbase or Binance or Gemini which are controlled by the government and more importantly people they have been hacked before anyways.

The main purpose of stablecoin is you can be in the crypto space without actually using your government-owned bank now in alot of places we take banks for granted like let say in the US but some countries are really limiting and how much money you can move around or what currency you can buy them from in fact in the united states every transaction over $10,000 ten thousand dollars has to be vetted and approved by a bank mean while using a stable coin like USDC you can move $10,000,000 ten million dollars from one address to another without anyone blinking an eye for like a $5 five dollar fee you could never do that with united states dollars

2.    2.  Borrowing and lending 

borrowing and lending

another important pillar of decentralized finance is lending and borrowing in fact a huge part of our current financial situation in the world is based on lending and borrowing money so it would make sense that the blockchain could do it better one of the reasons we can reliably lend and borrow with banks is because we usually put something down like 20 collateral so that if we never pay back the full loan our government can come after us and throw us in jail or

make us pay that money in short there are legal consequences for not paying a loan back well with crypto this is a problem because one of the pros of crypto is anonymity you could put 20 down and run away with the rest of the loan never be seen again so we have to find a way to

Solve this in fact with the use of smart contracts we can actually allow others to use our funds while still keeping custody of them

Example person A wants to earn interest on his coins while person B wants to borrow some coins so person A goes to compound or ave which are two platforms that allow crypto borrowing and lending and person A deposits his coins into a smart contract, the smart contracts are just code that run a particular function in turn what he gets are called C tokens or a tokens that are a representation of his original coin plus interest whenever he wants to he can just turn his a tokens or C tokens into that smart contract that was created by compounder ave and they spit out his original deposit plus interest now the smart contract is created this way so that there's no human being that has to do the calculation or have to do the transaction it's all automatic by code so that solves person a wanting to earn interest by lending in a traditional way in the borrowing portion person B must do something called over collateralize his loan this means if he wants to borrow $100 he must put up $120 dollars so that way if he runs away and never pays back his loan the smart contract is written in a way that it can pay back person A their coins plus interest now at this point in time you might be asking what's the point of taking a loan if you already have the money well you're probably thinking in $ united states dollars say you have 10 ethereum worth $1000 because they're each worth 100 but you don't want to sell them because you greatly believe in the ethereum project so you put them up as collateral and borrow $800 worth of tether (USDT) which is a stable coin pegged to the $ united states dollar so you trade that $800 eight hundred dollars around you make some money you lose some money you make some more money and now it's time to pay back your loan , so you have $850  eight hundred and fifty dollars in tether and you pay back the original $800 eight hundred dollar loan to get back your 10 ethereum well in this example you made $50 fifty dollars from the little trades that you did and you got lucky but it has also been a few months and ethereum like it has done in the past few months exploded and now they're worth $150 each so now you have 10 ethereum (ETH)  at $150 dollars each so now you control $1500 plus the $50 dollars you made trading basically if you believe in ethereum and you have it but don't want to sell it and you want to use the value of it you can take a loan out on it hoping that it will be worth more whenever you cash it out however if you traded you lost some money you gained some money and then you lost some money and maybe you ended up with $750 dollars USDT tether you would have two options.

Option A: is to front the extra $50 to pay back the full loan the $800 to get back all of your collateral and

Option B: is to just keep your $750 and lose your 10 ethereum (ETH)  which could be worth a lot now this might be information overload but real quick there is a second type of loan in crypto called a flash loan.

The Flash loan which is a loan that lasts for like 10 seconds if you could buy ethereum for 10 on coinbase and then sell it for 11 on gemini theoretically you can make a dollar every time you did that and so you can use what we call is a flash loan to literally borrow millions of dollars you don't have to put any money down you just write a flash loan to borrow $10,000,000 ten million dollars you tell it to go buy ethereum for ten dollars and then immediately sell it for 11 and then you pay back the original loan 10 million dollars and all one small little smart contract that gets run in 10 seconds essentially you made a million dollars minus the fees that you had to pay for borrowing but these fees are small because the lender knew that you would have to pay them back and that it was for a very short period of time now this is a more advanced technique but you could never perform this type of  arbitrage in traditional finance                                                                              

3. Decentralized Exchanges

Decentralized exchange

For easy understanding let say you have a friend who traveled to london a few years ago from the united states now of course in london the standard currency is euros while over here in the US it's $ dollars so naturally he had to visit a foreign exchange booth and trade out his dollars for euros unfortunately for him the fee was like 15% so he immediately lost 15%  percent of his money because that's what foreign exchange traders do tourists don't know any better and they need local money so what they do is they take advantage of these people well when it comes to decentralized finance instead of a foreign exchange trader we have what is called a decentralized exchange where you can exchange your coins and tokens for other coins and tokens now the fees are usually very small like less than half of a percent which is a great benefit for anyone who regularly wants to trade their crypto assets most popular decentralized exchanges or dexes

work in a manner where investors pool their money together and then traders can trade that money the fee of every trade goes back to those investors and it's all written in code so it doesn't change a government can't step in and say you can't buy bitcoin anymore the fees and the percentages that you change are locked too they're written in code so they don't change and they can't raise to crazy prices like 15% decentralized exchanges open the world up to a whole new variety of tokens and coins.

Example: Coinbase the first centralized exchange to go public only allows you to buy and sell different cryptocurrencies at the moment since they are regulated by the government and have to abide by certain regulations they very closely analyze each coin before adding it the most popular decentralized exchange which is called uniswap literally has hundreds maybe even thousands of tokens that you can trade and they aren't regulated by anyone that's the decentralized part there are billions of dollars locked up in these liquidity pools so traders can trade but nobody can control these billions of dollars they're just following a program that someone wrote in fact only investors can be the ones to pull out their money out of the pool but if they did that the lending rates would rise and so new investors would come along and put their money in  the code can't be changed either it's what we call immutable so in the crypto space we like to say that the code is the law the government doesn't control it the code does and everyone has access to the code and it doesn't change

uniswap is one of the major exchanges on the ethereum network and it has billions of dollars in its pools, pancake swap is another exchange on the binance smart chain network that also has a few billion dollars of liquidity.

3.     4.Insurance

insurance

Example with car insurance you pay $100 a month to protect your new tesla however one day while using the autopilot feature another car causes the autopilot to glitch and you drive into a ditch unharmed though but you totally wrecked the car well since you paid insurance the insurance company pays you what the tesla was worth so that you can go buy a new one they use statistics to predict how many of their drivers will crash their cars and then use this data to predict how much they would have to pay each year to determine what the monthly price of the insurance should be which is also called the premium well with decentralized finance the insurance company can be code.

Another example let's say a farmer wants to buy crop insurance so if his crops die he still has income for planting them and taking that risk we could write a piece of code on the ethereum network that says if there's any days this summer that are 90 degrees fahrenheit or hotter four days in a row pay out farmer joseph $100 one hundred thousand dollars however to start this contract he has to pay two thousand dollars so farmer joseph can buy his crop insurance through what is called a smart contract which is just code that sees if the conditions are met to pay him so at this point in time you might have two questions how does the code know if it's

95 degrees fahrenheit and where does a hundred thousand dollars come from well to connect the real world to the blockchain we have to use something called oracles which are trusted sources that become a bridge between the real world and the crypto world we can create an oracle in our

city that reads the temperature and is verified by a few people to make sure that it can't be frauded then the smart contract can reliably use it as a data source to decide if insurance requirements are met or not secondly the one hundred thousand dollars comes from other people buying insurance that bought the premiums but maybe they didn't get paid out because the requirements were not met just like an insurance company makes profit people who provide liquidity to any decentralized finance platform may be incentivized within an interest rate to earn on their deposit in other words some of the $1000 hundred thousand dollars may come from investors who earn money by lending their money.

4.      5. Margin Trading 

magin trading

in the decentralized world so you want to buy the apple stock and let say it is $100 one hundred dollars so essentially what margin is it is a loan that will automatically sell your stock if the stock goes below your down payment so to buy a $100 hundred dollar stock you need a $100 hundred dollar loan and the bank agrees to give you that $100  hundred dollar loan if you can give them a $20 twenty dollar down payment and a small fee of 5% five percent a year so here's two scenarios that could happen the stock goes from $100 one hundred dollars to $150 one hundred fifty dollars you have paper hands so you decide to sell the stock and you get one $150 dollars you pay back $80 of your loan because the bank already had your original $20 as a down payment and you keep the rest which is a profit of $70 dollars so essentially you made $70 dollars by only spending 20.

This means that you more than tripled your money even though the stock only went up 50% percent this is the power of margin you use it when you think something is going to increase in value to multiply your own money now.

second scenario and it's if the stock drops to 50 well with margin you actually have to sell as soon as the value of what you bought can't pay back your loan so the stock starts out at $100 then it starts dropping $90-$85 and then as soon as it hits $80 then the bank forces you to sell your one stock of apple at $80 eighty dollars so that you can pay them back those $80 eighty dollars that you borrowed so the eighty dollars you made from selling the stock plus the $20 twenty dollars that you gave them as a down payment equalizes the loan and now the bank has their original one $100 they originally gave you so you're free and clear you've paid your loan back but you didn't profit anything in fact you lost your original $20 that you put up as down payment in centralized finance to trade on margin you usually need to be able to prove who you are along with have a minimum of a few thousand dollars to even have access to margin trading the fees are also much higher much higher than 5% five percent and decentralized finance margin trading can be a lot quicker open to anyone in the world with money and a lot safer as well.

RISK DISCLAIMERS

This website includes information about cryptocurrencies, (CFDs) and other financial instruments, and about brokers, exchanges and other entities trading in such instruments. Both cryptocurrencies and CFDs are complex instruments and come with a high risk of losing money. You should carefully consider whether you understand how these instruments work and whether you can afford to take the high risk of losing your money. knowaboutcryptocurrency.blogspot.com encourages you to perform your own research before making any investment decision, and to avoid investing in any financial instrument which you do not fully understand how it works and what are the risks involved. All contents on this site is for educational, and informational purposes only and does not constitute any financial advice. Consult relevant financial professionals in your country of residence to get personalized advice before you make any trading or investing decisions. Knowaboutcryptocurrency.blogspot.com may receive compensation from the brands or services mentioned on this website at no additional cost to you.

Risk Warning: Trading CFDs on leverage involves significant risk of loss to your capital.

                                                            


No comments:

Post a Comment