# Introduction to DeFi with Bartek Rutkowski

- Channel: [ETH Warsaw](https://streameth.org/eth-warsaw)
- Date: 2021-10-07
- Duration: 1:20:11
- Watch: https://streameth.org/watch/yt-ZevJVu_w7yI
- YouTube: https://www.youtube.com/watch?v=ZevJVu_w7yI

## Description

Workshops for blockhain beginner devs. Learn how to build on Ethereum!

BOUNTY LINKS:

Hermez Network:
https://gitcoin.co/issue/hermeznetwork/0xhack/1/100025692 https://gitcoin.co/issue/hermeznetwork/0xhack/2/100025700 https://gitcoin.co/issue/hermeznetwork/0xhack/3/100025693 https://gitcoin.co/issue/hermeznetwork/0xhack/4/100025694

DevCon:
https://gitcoin.co/issue/EthWorks/hackathons/1/100025722

Golem:
https://gitcoin.co/issue/golemfactory/hackathons/18/100025686

Polygon:
https://gitcoin.co/issue/maticnetwork/matic-bounties/21/100025715

Status:
https://gitcoin.co/issue/status-im/0xHack/3/100025685
https://gitcoin.co/issue/status-im/0xHack/2/100025680
https://gitcoin.co/issue/status-im/0xHack/2/100025680
https://gitcoin.co/issue/status-im/0xHack/1/100025679

Ethworks:
https://gitcoin.co/issue/EthWorks/useDApp/181/100025575
https://gitcoin.co/issue/EthWorks/useDApp/180/100025574
https://gitcoin.co/issue/EthWorks/useDApp/179/100025573
https://gitcoin.co/issue/EthWorks/useDApp/178/100025570
https://gitcoin.co/issue/EthWorks/useDApp/176/100025566

Moonbeam:
https://gitcoin.co/issue/PureStake/hackathon-0x-moonbeam/2/100025702
https://gitcoin.co/issue/PureStake/hackathon-0x-moonbeam/1/100025701

Ramp:
https://gitcoin.co/issue/RampNetwork/0xHack/1/100025724
https://gitcoin.co/issue/RampNetwork/0xHack/2/100025725
https://gitcoin.co/issue/RampNetwork/0xHack/3/100025726

Chainlink:
https://gitcoin.co/issue/smartcontractkit/chainlink/4375/100025683

## Transcript

okay i think uh you should see the presentation already and also me myself right okay so good to go uh hello uh thanks for joining me here today and welcome to my presentation introduction to d5 my name is bartek i'm blockchain developer for uh over three years now and i'm gonna tell you what the d5 is um and i'm gonna talk you through some uh examples of d5 products and instead of telling you why defy is cool just in general i'm gonna point you out like the exact examples of cool things that you can find here and why it all matters um i'm not gonna lie it's gonna be very very simple take even if there are some defy experts here they might might find some statements made by me as oversimplifications but this is as i say introduction so before we actually start i'm gonna do a super short blockchain recap so uh blockchain is a peer-to-peer network as we all know uh which is responsible for maintaining a ledger this ledger is of course not centralized as here is shown but it's distributed amongst uh all the actors of the network everyone has voice but no one can change the past or or influence anything that happened um in the past or is already written in the database it's just a no-go zone you cannot you cannot change anything and uh thing like that um is also a base layer of infrastructure for cryptocurrencies like bitcoin which works well for a lot of years already and there are of course better things than bitcoin for example ethereum which i'm gonna mostly uh gonna talk about and uh the what is the basic uh differentiation between ethereum and blog and bitcoin of course there are many but the main one that we are probably uh the most excited about is the presence of smart contracts smart contracts are like pieces of code that live online on top of the blockchain infrastructure that allow you to program the transactions in a fancy way so you don't need to worry about some automation level outside of the blockchain space but you can program various different things um directly on the blockchain within the transactions as you can see here there's like a super simple smart contract called splitter and the splitter does only one thing whenever you send the ether uh calling the split function it will send this ether to um to two other uh users that were predefined and therefore um like introduce some extra complexity to the simple cryptocurrency transactions that we normally have on the blockchains that do not have smart contracts and these transactions can be as complex as as you can imagine i'd say because they can be almost as complex yeah yeah there's like almost no no limit to that when it comes to your imagination of course there is like something into data processing but it's still like a fair limit to to explore and um the like the key concept of the smart contracts uh like the more like the let's say the most uh interesting and the most important uh smart contract type of all that we have uh the token so a token is like a cryptocurrency living on top of the other cryptocurrency oh i'm sorry that's here um and um and yeah and this sort of smart contract is like another cryptocurrency that doesn't have all the nodes all the all the mining all the different uh kind of stuff that you normally need to run the cryptocurrency but instead it utilizes the infrastructure of the ethereum blockchain and runs directly on it but implements its own logic it can be like some other just you know cryptocurrency that does some stuff or it can be like a token that represents us dollars other cryptocurrencies that live on other blockchains um like uh imagination is the the only what can a token be um okay so after this like short short recap and short introduction what the d5 is so the d5 stands for decentralized finance and basically d5 is the ecosystem of um of all different sorts of products protocols and that are implemented on blockchain with smart contracts and that give people opportunity to use different financial services without any trust without contact with bank just directly in the web browser um when i'm gonna be talking about defy i'm gonna mostly refer to the um to the defile that we have on um on ethereum blockchain because it's probably like the most uh like personally to me it's the the most interesting one but the defy is not limited to to ethereum blockchain d5 can also be on other blockchains d3 like at the theorem d5 can also refer to like the ecosystem of all blockchains and all the projects on top of other blockchains with other cryptocurrencies connected and so on so this is like a very let's say um broad term but um i'm gonna stick to uh ethereum blockchain and ethereum ecosystem uh for now um right and uh i have this like one old screenshot of the d5 pulse if i pauses the portal that kind of uh benchmarks all the um all the d5 like most used and most popular d5 protocols and like measures they their total value locked their traffic um and ranks and ranks them in a way and this is like a screenshot that i had an opportunity to take like one and a half years ago and where when defy on ethereum blockchain was actually really really young there were like only a couple of projects and at the time being there was like a half billion of dollars uh value locked in the in the d5 protocol so it was like more of a sandbox right um like a playground for for for for geeks rather than a real financial market but today the very same the very same website tells us that we have over 85 billion dollars locked in d5 so it's developing extremely quickly and it's gaining a lot of traction and a lot of people are working on that other people is using that and actually um it's gaining even like more attention from the media and from from from generally like all places uh all over the world so i would say that the work of um blockchain developers blockchain enthusiasts and cryptocurrency crypto anarchists uh pays off and and and we are getting somewhere right um this is the place where um where you want to be so defy is like an ecosystem of of all the products and now why they um why they really matter like what they can for example do um and um to to to kind of um imagine like the simplest the simplest thing that we can do within the pi ecosystem let's start with some super simple banking and some some super simple example so what the banking indeed indeed is from from the user perspective like me and you so bank is a place where you just put your money like you earn some cash like not cryptocurrency cash just regular cash and put it into the bank and sometime before in a distant past you were paying bank to do that because the bank was securing your your your hard earned money and you like you used the service of protection and you paid for that with your money and like like a little bit of your money the rest was just um just secured there but then it changed a little bit and banks realize that they can do something with that money so they do not necessarily need to get paid for that because they can just use this money to generate some interest to generate some profit and then that's like enough value for them so they just take this cash for free generate profit and that's how they make a living and even the other way around what we are actually used to and what we expect from the from our bank to do is that the bank is gonna take our money generate some simple profit and actually return us more uh share this profit with us that's what we that that's what we expect from uh from some saving accounts um or things like that and while banks are today extremely good at this part they're not necessarily that good at this part and we can try to fix that with uh smart contracts um because why not so let's explore compound compound is a smart contract based protocol that basically gives you an interface that allows you to put your now cryptocurrency cash in this case die that is a token as i said before so cryptocurrency living on top of other cryptocurrency that represents us dollars in the kind of this ecosystem of ethereum blockchain and compound lets you deposit die and then prints you some c die which is another token this seed token basically says okay so this guy has some dye inside of the compound and like it's like you know some some receipts something that allows you um that enables the withdrawal in the future so it's like um simple simple exchange and you put your die into into into the compound pool and on the other like kind of side of this of this machine someone puts a collateral collateral of other cryptocurrency for like the sake of the example that will be ether ether the native currency of ethereum blockchain and this person that put collateral um no i see i have connection problems i don't know if that still occurs okay that should be better now okay yeah so the person that um puts the collateral can now borrow our funds why collateral because we need to make sure that the debt that's taken that's that's created is going to be ever repaid and uh yeah basically let's let's let's stick to that explanation for now you can imagine that uh in a traditional finance that would be kind of like a piece of real estate locked in like the banking system um so we can take a loan complete the purchase and then when we repay our mortgage uh slowly buy um the real estate from the hands of the of the bank um right so there's a collateral there's some person that that that borrows these funds and then after some time um the funds are returned with with some interest and this interest goes uh i like i would really like to say that all the interest goes to the lender not all but most of it why not all because like the combo protocol needs to accrue some reserve fund in case of emergency but basically the the drill is that most of the funds most of the profit actually go to um to depositors to to the depositors to um to the people that want to uh that want to earn some interest and that's an extremely extremely efficient mechanism as it turns out because you don't need like you know thousands of physical places and thousands of workers that that are gonna you know take your your deposits and like process this all that stuff manually this is like extremely automatic and straight secured by the ethereum infrastructure and now you only like need a couple of developers that are just gonna that just gonna create it and then maybe add some new features but then it's it's it's done it's complete and it's ready to use and they're like no these like leaking um you know kind of like leaking leaking pieces of the of the machine that that kind of take your profit and instead of you um and uh yeah so uh and it apparently is um extremely simple extremely pure but extremely effective and this can even be um even more simpler even even more simple than simpler because there's actually no difference between this pool and the collateral part um what i'm talking about um the when you when you add the dye into the pool then you get seed right and then actually on the other end when somebody puts eve like ether also like needs to get some token that will say that there is collateral put in there and that's does it will be withdrawable at some at some point of time so on the other end the second person also gets c token which is c ether in this case and apparently not only this person can borrow our die but we using our pooled fans we also when we pull these funds we also like gain borrowing power and we can also borrow stuff that's like gathered in this pool um but not the stuff that we deposit but the other thing so we can like put something gain borrowing power and borrow whatever is in the bullet whatever is interesting for us yeah and now uh you may ask a question uh how it happens um uh these funds are even withdrawable uh because now we can see that this guy like this this girl on the left has like some sea dive there's a four sea dive but there's like only one dye inside of the pool because the rest is like went out and on the other on the other hand there's like still more see ether than there's ether inside so how how it happens that we are able to withdraw anything and apparently like first thing there are like lots of people that that do this so um whenever somebody wants to withdraw something there are still there is like a great chance that there there are funds for that person available in the in the post so there are like no problems with with kind of like exit liquidity of the system but then um there is also this other mechanism because the situation on the right we can imagine that if instead of this like one depositor there will be like four there's still like more more ether than um than one fourth of the of the c ether that was issued in total so it shouldn't be a problem to withdraw ether but this die like it looks pretty dangerous because there's like very small supply of dye in the pool and very big supply of sea dye so kind of like a very a very big supply of of demand like of potential demand for withdrawal and this is also like a beauty um of simplicity of this mechanism because um a system automatically adjusts uh adjusts uh interest rates and then if there's like a big demand for for an asset and there's like a low supply of this asset in the pool then this then this um then on one hand and the loan taken in die in this example uh becomes um extremely um expensive so so that the borrower needs to pay a lot of interest into the pool so he's like strongly incentivized to return it back and on the other hand if the interest rates are high then um it's a strong incentive for new depositors to deposit in the pool because then they can make a good buck out of it because there's like a high demand for their funds and the other way around for ether right now there's like not that big of a demand for for loans in in either so the interest rates are probably pretty low and people don't uh don't need um to deposit more because that's just enough and this loan in ether is is just cheap and this is also extremely automatic i'm not sure if i can say that this is extremely automatic it's just automatic and works well um left left alone and no one needs to interact with it and intervene in a way yeah and now um i want to bring to your attention the fact of the clutter so why this collateral is actually needed because i said that uh this is because we need to make sure that the funds will be repaid uh that's why you need to put some collateral because the system needs to somehow make sure that you are incentivized to return uh return the law and actually um i don't know if that was the exact reasoning and the exact um like kind of way of thinking of the of the the creators of the next mechanism i'm gonna describe but uh there is a project called ave and these guys probably feel something like this why do we need collateral to ensure that the funds will be repaid what is the other way that we can make sure that the funds will be repaid well there is other way we can um because like what's the what's what what's uh what's also like 100 percent sure in the blockchain world um the fact that transactions are atomic so you can always take a loan and if you are gonna return it in the same one transaction so take a loan and return it back in one transaction then you don't need any collateral right so you can just take this long and return it very quickly and this is gonna uh be just fine without collateral of course you cannot do this like you know performing like a simple transaction you're gonna need a special smart contract for that that's gonna do all this stuff so like take along do something useful and then return it in the same very transaction and you can pose a question very valid one um what is it for because like um what's what's the purpose of taking a loan for the time of um one transaction which is actually like zero time because like you take this loan and return it in the same like very moment actually i can give you example of of usage and uh this is something that's um that's that's this is extremely interesting in my in my my humble opinion um let's bring back the compound thing that we had that we had a couple of minutes ago and then there is the setup when somebody puts collateral now let's let's let's stick to this differentiation between pool and collateral somebody puts collateral and borrows some funds from the pool but then um it's possible that this person that took the loan you know just spent it like bought a lambo or whatever else and there's the dice are just gone and this person is not able to repay the debt but there's still this collateral and this person thinks that okay maybe maybe there is this debt but my collateral is worth more than my debt so i want it out i want to take this collateral out and repay that repay that debt and this is like not that simple to do anything simple in a like you know in a let's say um straightforward way because like these funds are locked and there is like a simple statement that's kind of defending them that you need to repair your debt in order to take this out so what you can do you can take loan from away like of course with a special smart contract but there are like probably some new deals from that i'm not sure whether you are you need to be um you need to be a developer to do that there are like you know products that do that for you you can take a loan from away repay your debt then as your debt is repaid um take out your your collateral cut it into like proper pieces sell this one half for for die repair die to other and just like keep the rest of the collateral and all this like needs to be performed in like one single blockchain transaction so so not like you know we are we are getting far um like far far away from from this like simple concept of you know transacting uh like a one bitcoin or something like that because now this like state transition um that happens within one blockchain transaction is like not only um even not only like depositing tokens or like calling some functions but now like it's engaging a lot of different protocols of different different products that cooperate and uh kind of uh and have some sort of synergy that allow you to achieve um like kind of effects that wouldn't be possible without that uh without that in place um yeah so that's like just the tip of the of the iceberg and since um because like returning back to the previous setup we talked about some like there is ether right we know what ether is that's like the the most obvious thing here because the um because it's because it's just the native native currency of uh of ethereum blockchain and then we have um seed i see ether which is also kind of like explained because these are like the tokens that are created when you deposit and they are burned when you when you withdraw this is like just this receipt that allows you to operate within the system but there's like one question what does actually die um because like this is some token that's worth one dollar why uh like who creates it uh how does it work and why is it actually worth one dollar what does this die and in order to answer that question we need to introduce like the idea of um synthetic acid um synth and what a synth is like the simplest possible synth is wrapped ether so you can imagine that there was a problematic thing when the d5 ecosystem started to start booming flourishing that most of these protocols were created for erc20 tokens so erc20 is the standard of a of a token um so die for example seed i see ether rubbed bitcoin and many other and why because like most of the assets that live on top of this your blockchain are erc20 contracts so you need to like implement your interface uh to work with erc20 your c20 contract yeah with vrc 20 standard standard token but then still like pulling these tokens aside the most popular asset on okay that's i'm not i'm not sure if that's true but that's very possible that and for sure it's one of the one of the most popular assets on the ethereum the ethereum blockchain which is just ether and ether is not um erc20 contract so how do we kind of implement all that to work with ethereum of course we can like duplicate every function and every like um in every and every product and just like you know put this like if statement done that that will kind of you know distinguish um these two different scenarios when you have like erc20 code erc20 token and and other token or ether and token and like you know just just add like extra complexity to every protocol which is not that cool because it like makes code far more complex and instead apparently what we can do is we can wrap this ether like this native ether with like kind of erc20 interface so we will create a smart contract that will take a deposit of ether and when the deposit is made then it just gives you um the balance of the token equal to the amount of ether that you just deposited or the other way around if you want your ether back like the real ether and then you can just call a function um say how much wrapped ether do you want to burn and then it's gonna be like just removed from the supply and you will get the real ether back and this mechanism on one hand um like simplifies all the all the ether interactions when the ether is not used as as as as a fuel um to to pay the transaction as a as a asset to pay for gas but when it's used as you know a thing that you want to put in some protocol exchange or whatever else and on the other hand it's it creates like this new thing that's always like one that's always worth one ether because like this mechanism ensures that this token is like always worth one ether because whatever you would buy it for less then you can always like exchange it for one ether and you will have profit or the other way around it's not it doesn't make any sense to buy it for more because it won't ever be more um done than eve so this kind of concept and you can uh and like this is this is like the purest i'd say um hard pegged um stable coin because they're like hard pegged stables or sims and soft packed and this is like a example of hard pegged one and probably like it's the hardest picked one because it's like insured by smart contracts that it's gonna work that way but then you have you have you have others um for example rap bitcoin uh usd coin uh through usd and these are like just tokens that have some entity um outside of the ethereum blockchain that says whenever you send me a bitcoin i will give you one wbtc token whenever you send me one wbtc token i will send you one real btc or the same with us dollars for example and that mechanism kind of uh help on board all sorts of different assets and onto the ethereum world so they can be used in the in the d5 ecosystem um yeah but still it doesn't answer the question what is what is dye because dye is a completely different animal it behaves differently it does different kind of things um and what it does uh dye is the soft pegged uh soft stable coin so it's not actually enforced um there's like no programmatic like a very hard programmatic way to enforce the the value of that but still um value of that floats somewhere around one dollar and it's like this floating let's say limits are very tight so it's not like you know between half dollar and two dollars it's like between 99 cents and one dollar and one cent i would put it like this and how it works so the maker foundation um came up with an idea that you can have some if put it in the vault and then when this ether is locked in that vault you can mint token against that like for example you have like some amount of eth locked in this in this vault and then you can mint four dice and what the system says in this very moment is more or less the statement that there is at least five five uh four in this case there's at least four dollars worth of eve in that vault so there is like at least that amount of value within within that book there are of course like all different sorts of mech engines that push this uh price up or down um depending on the needs but uh what's like the most intrinsic value of of of dye is the fact that it's backed by at least that amount of if the diazepa is worth itself right so so for like four uh four die you would have like probably at least four uh at least or at least six um dollars of if locked in in the vaults and that like gives um die real real value and you can do with this die whatever you want um like really whatever you want put it in some defy or spend it sell it keep it whatever whatever is your your dream and about your die and at the end of the day what you need to do is to repay your debt with like some interest and now like um because in compound for example you had to repay your debt in the token that you were borrowing but here it's impossible obviously because you like mint this die um out of thin air so you won't be able to repay your debt with die because you cannot like you can repay the debt but you cannot repay the interest with die because you cannot just get more die and because it's just you know you need to mint more and then in order to mint more you will need to mint more this is how the fiat money works but this is not how dye works so you need to repair your debt with um mkr token which is like an internal token of the um of the of the maker foundation issued by them um you you can buy this token from them and like just um just uh just just put it as the payment and then um we need to think about the scenario uh [Music] like what would happen if um your debt would be bigger than the amount of um that the amount of if that's that's actually in the vault or what would happen if the amount of uh like your debt and plus the the interest is actually worth more than the value of if that's locks inside the vault right then actually this is probably a similar problem to the one that we had in compound but we didn't mention that before so what would so what would happen in such a situation because that definitely breaks this equilibrium that we're talking about breaks this this this kind of like agreement that there is like at least some value accrued in the contract and it's bigger than the amount of debt that we are creating so there is this kind of like red line that that is that is that is drawn somewhere between value of if that's inside the vault and the amount of dye that you can mint which is called um collateralization ratio and this like line here it's like it's oversimplified but this is some proportion that says that for example you need to have at least um at least 35 percent more value inside the vault than you have the debt and if not then yeah then what if this collateralization ratio is met then the system says okay it's getting dangerous uh your debt is like pretty pretty high this value of the volt is dropping we don't want to risk the the scenario of of if going down even more and we just cancel your debt we sell this eve we like take this if out of the vault sell it uh repay your debt you can keep your die we don't care um like the the deal is over right so the deal is over your debt is repaid you we will save we will sell most of your if you will get to keep like this this this one this this like small a small amount that's that's that's on top but generally most of it is sold um and your debt is not uh it's it's it's not like a problem for you anymore because it's just it's just repay and the same situation would happen in case of just you know you not paying your your interest rate because then they can say at some point that's okay you are clearly really not interested in in in keeping the agreement so we just close this vault take this eve sell it repay your debt and uh you can keep your die and you can like you can never repay your your interest it's it's it's just that and the value of that holds but what happens in the scenario of value of if dropping so heavily that there is like no time to react because all that stuff takes time right there needs to be a system that says okay it's getting dangerous now we need to take this if out of the vault we need to sell it on some sort of auction and then we need to like sell it on some sort of auction to get some diet from the free market we pay that debt and like close everything that takes time and um and you need to also remember about the rhythm of of of of of life within the blockchain space which is the the the the mining time of of one block and it's possible that within like this 15 seconds it will the price will drop so heavily that that we won't be able to to maintain um this this status quo or even um we don't need like this this like a drop this rapid because we can just have the ethereum price drop like by half within a couple of hours and that would be enough because the the network will be so cluttered with all the people doing all sorts of stuff in order to react that we won't be able to like close all these walls sell all these if that would just you know kind of uh prevent uh prevent the the system from working properly just because there's like not enough block space to transact and that actually happened once so what uh at least once um so what will happen in such a situation the maker foundation which is responsible for which is responsible for maintaining this the system says that if we are not able to maintain uh and kind of to to enforce the rules that that we all agreed on then we are gonna mint new maker tokens and then we're gonna sell them to cover this bad debt that cannot be repaid and that's actually something um that is like an extremely good property of uh of d5 because here like this is a problem right so when like the the the price of the currency drops there is like a complete market crush it's like nose diving plummeting it's just a completely disastrous scenario then the kind of like our central bank of d5 which i think we can call maker our central bank of d5 um is not saying that we are now okay so now the die is gonna be under collateralized or now we're gonna just take some eve from other volts and put it and like from the over collateralized walls and put it in under collateralized walls so so everything is is even no they're not saying that they're not breaking the promises and they are not you know making the losses public they are taking uh they just taking the losses themselves and they are deluding their own currency to um to maintain the trust between the uh let's say foundation and the dao and the and the people that are using it and there's like we we are not like forced to use makers so if they were not to um they were not to um and preserve their own values and virtues then we'll just abandon maker in the default world it's possible so here we have like this extremely strong mechanism that um forces dowels and these products to behave in a way that people would want them to behave and yeah and this is not a behavior that you would see in the real world like the world non-blockchain world um yeah so basically you need to maintain this this like collateralization ratio keep your debt below the the the quadraturization ratio below the value of the of the vault and you're just you're just fine and what's what's what's cool about this mechanism is that you can actually like replace this eve with anything else uh i would say anything else of course the the decentralized organization that's um that's in charge of the the maker protocol is not letting any collateral to be put in inside the vaults but there are plenty of them and if you just want to use the value of your crypto but you're not eager to sell it then you can just use that and that will work well and hopefully in some future this is like now not about the present it's just about the future that i would really love to see maybe in the future you would be able to put a piece of real estate um inside the vault and then die against that and i think it's it's it's it's closer uh closer than you think and it will we will see this happening um soon trademark um yeah and now we can uh we can ask a question what can we all use that for right because we can borrow basically that's that's that's the like the outcome like we had like these two examples which are more or less like the same you can you can like put one cryptocurrency and then borrow um of course there was this like depositing and and earning interest when it comes to compounds but basically that the purpose is is just borrowing so what is it for and yeah you can build all sorts of things on top of this like very basic primitive which is which is which is borrowing um and for example you probably know what the leverage is if not then i'm gonna tell you uh so leverage is a kind of a mechanism that allows you to create artificial exposure to to an asset and so you actually kind of like borrow the asset to um like you borrow something to um to buy the asset to like artificially expose yourself um to the to the the price changes of that asset more than just you know spot holding that that asset and that's um that's extremely simple with with smart contracts because what you can do is to of course the now it's it's over complicated a little bit but i'm gonna i'm gonna simplify this in a moment so you can like create a vault put if inside of the vault then mint some dye convert the dye to eve create new world put that void that agreed yeah create a new vault put that if into the vault mint new die and so on and you just create this kind of like stairs like here and then um yeah and then um of course this is like not worth more because this value is not magically created in any way it's it's it's basically all the same but when you uh when the price changes then uh yeah because like let's let's let's let's dig into into the details maybe for for a second because like for example you have 200 worth of leaf and 100 dollars that and then you have 100 worth of and like it goes like straight away but then if the price changes then the value of your debt is the same but the value of the eat that you are holding instead of like having these these die changes and it can change really really really heavily and now instead of um earning like earning if you not real if if you weren't to realize your profits then you didn't learn anything but on paper um you now earned instead of 100 almost 200 just because of this structure of course this is like a dangerous because the opposite way you can lose more than you would normally lose but like you are probably um aware of that and you need to be you need to be careful with those are these like sorts of um sorts of mechanisms and here um i i would also like to to simplify this a little bit uh because like i here created three volts with and like made that tons of transactions you can do all that stuff with one transaction thanks to flash loan right because like you can like create a like a excel spreadsheet or take a piece of paper and calculate how many uh how much die you would be able to mint in total with all these volts how much if you get in total and then like when you have all these calculations you can just take a flash loan buy all this if create just one volt mean that minded die and then use the newly minted die to repay the you repay them and to repay the flash loan and you would have all this like kind of like squashed into like one volt thanks to a flashlight um yeah something like that um you can use that to create short uh and this is something that's normally uh very unnatural because the shorting is like profiting from the price going down and how you can do that um fairly simple you can just put your die into the into the pool take a loan in ether so borrow e sell this if to to die wait for the price of if to drop so now like your your debt is worth more because you need to still repay one if which you don't have so we will need to rebuy it but now it's worth more so you really buy this like one for for a smaller price you have some dye left and that's that's just your profit obviously the other way around if the price of if goes up then oh boy oh boy and i wouldn't i wouldn't want to be you in that in that case but that's um that's a that's a game for for big boys and you need to you need to always take care but it's possible and you can build even more stuff on top of them anyway you can actually use all these mechanisms to actually buy stuff and maybe that for some people that might be extremely obvious for other people that might be uh unexpected but you can actually instead of just selling your cryptocurrency you can just lock this cryptocurrency take a like create to create some debt of dice and then use this die that to fund your life um basically and then there are like three ways of uh of like handling the situation now because you kind of like live on alone so one one scenario you can probably expect the value of if to appreciate uh much faster than uh your debt is um is rising right because this this diet is not that expensive actually and it will like rise slowly and there is like a high probability that the value of eve will just go go up much much faster and you will be able in the future to even like take more debt because it's you you won't ever need to repay it because the of course the value of that will rise but the value of value of of collateral will go and go up um even even faster the other scenario is just to repay the the debt from your income right because maybe it's not the the thing that you want to live off your cryptocurrency but you just want to take a loan but you don't like banks you just don't want to explain what you're doing in your life you just don't want to like kind of uh you know interact with this sort of boomer services some people would say bold statement but some people would say and you just want to be kind of free um then it's possible it's it's even not like more expensive or more dangerous or anything you just put your cryptocurrency and then pay this off with your with your income um and like the final final probably the third scenario is that you can always you know use a user fashion to just sell the parts of your part of your uh part of your cryptocurrency portfolio later and when you think that okay it's it's it's time now to to sell the portion of eve and to repay the debt and just you know be debt-free that free again and um we were uh still we were always like talking about uh this selling and buying stuff and um that's uh that's that's actually really problematic because um in order to execute these scenarios that we are discussing we need to for example sell something um like within one transaction like so we kind of like need to sandwich this this this process of of of trade because we need to for example take a flash loan perform multiple scenarios that we already know that they're possible but then also trade something like exchange token for token and then like repay the flashlight and that's actually a thing that we didn't introduce uh yet how do we how do we trade uh on the blockchain and there are like all sorts of uh all sorts of options for us and generally uh the kind of like the exchange points of of tokens that live on top of blockchain are called taxes which stands for decentralized exchange and um there are as i say plenty of them and uh what's uh and interestingly some some of them are i would say skeuomorphic right so they kind of try to mimic our like the way of thinking about exchanges that we um that we have like off chain that we have like in a traditional finance but then we can actually like uh free ourselves from these like limitations from from this kind of like um you know um ideas about how exchange should look like and we can we can come up with um with um i see that i have a connection problem again yeah um so you can like create something new something something pure and not necessarily uh not necessarily um think about uh how it was before and just create something new and example of something new that's extremely pure again extremely simple and extremely powerful is the uni swap exchange so this is like the exchange that allows you to exchange any tokens right like you give one token you get another token and how is it how is it performed you can think uh about the about the uni swap exchange as about the scales right so this is like some some weight on one side some weight on the other side and then like the ratio between them determines kind of the price and when you want to execute the trade you just like have let's say one day here i came up with super simple example of uh exchange of die and usdc these coins are both worth around like one dollar so so we should see the equal amount of these of these tokens um in in inside the pair and yeah so the ratio is is one there's like equal amount of dye and equal amount of usdc inside of the pair and now someone wants to buy some usdc with dye so what happens and this person just puts dye on top of the pile of dyes and then takes like a proportional amount from the other side this is oversimplified yet but but i'm gonna i'm gonna fix that uh sometime soon and now this this sort of trade breaks the balance right so like breaks changes the balance maybe in terms of stable coins we can consider it breaking the balance but if they were like you know some some different coins like for example ether and and and and die then maybe it won't be like breaking the balance it will be just you know discovering the new price of eve but for the time being let's let's stick to the breaking advance idea so some of the broke the balance and now the ratio is one and a half in that particular scenario so in such a case someone with one usdc can like put one usdc and take one and a half die from this from this from there from from this from this other pile because that was duration and now what was oversimplified the problem is that this this ratio is like not frozen in the moment of like executing the trace so it doesn't work in a way that okay there is this ratio and this is like a fixed price so i like to just put an amount of token and like take an amount of token no um the the the ratio changes kind of um dynamically uh within the within the trade so so so the ratio uh is actually like changed um during the time of the trade so for example if you are putting a meaningful amount of one cryptocurrency on top of first pile then you are like making this heavier and you are changing the ratio and you can like take smaller and smaller um amounts from from the other side so here the person that was kind of breaking the balance paid one die to receive slightly less than one usdc and personally on the other side when the balance was broken a little bit i paid one usdc to get slightly more done than one than one die and this uh like extremely simple mechanisms of scales like drives most of the trade in defy and in blockchain of course with different assets these proportions would be different right so you would for example have like two if two ethers um on one side and like eight thousand dice on the other and they will be seen as equilibrium by the market because people will just see that there's like two ethers and just and eight thousand die and they will just say okay that's that's that's that's in balance that's that's that's fair uh yeah and it's all i i'd say it's that's that's that's it for amms because these sort of like exchange design is called amm which stands for automation my market maker and it's like extremely powerful and now it evolves it changes but uh but this is like kind of the let's say the the purest uh design that we had and that we've seen that we've seen so far in my in my humble opinion and um yeah now uh i'm gonna talk about something completely something completely else something uh something new uh the governance because um we uh where we are talking about defy so it's definitely phi because there's tons of financial stuff it's maybe the centralized a little bit because it lives on top of blockchain but still we have like developers we have these companies that create these products that create these protocols and aren't they like the central points of failures and aren't they like masters of of of the situation and aren't they holding too much power well um i would i would i would use a meme so well yes but actually no so uh some of them indeed hold a lot of power but they decentralized over time and some of these organizations um achieved a decent level of of decentralization already and they did that with the mechanism of governances so what is it all about i'm gonna take an example of compound so whenever you use components so for example like deposits stuff and then and then you are not only earning interest you're not only end earning interest in in in the in the currency that you deposited but also you accrue a small amount of comp token like there are different different ways of distributing like governance tokens of of of projects but let's say that's that's some that's something that's that's an idea for that so if you are a user then you are getting a small amount of com talk and this com token is just you know a token that says this person uses compound and this is like it's it's made by using compound it's it's it's brought to life by using you can of course keep this you keep this comp token or you can sell it you can do like whatever you want but then like over time you accrue more value in the scope talk and then there are people that accumulate like like a lot of these tokens and um and they make real decisions so then somebody with like a voting power of com tokens can for example say that we want to like change some parameter add new feature add new type of collateral do anything and people that have this comp token can actually vote and decide in a decentralized way so they're like the the protocol the smart contracts are not governed by the company um itself like the the company that just you know came up with the idea but the users are actually um are actually in charge of course there are like users this is like one kind of side of the coin they're like investors they're like there are different ways of um of distributing tokens but uh but generally it's like the concentration of power is not as dangerous as it is in um in a tradition and yeah um we're going uh we are we're kind of uh reaching reaching the end and um uh i'm posing a question is there more um and the answer is obviously yes um what i hear uh presented you is just like a tip of of of the iceberg it's just like the the beginning and the introduction um so there are like lots of different things uh that you can find within the deep ecosystem like starting with nfts that you are probably already heard of which are which are um pieces of pieces of art uh that live on top of ethereum blockchain and uh and can be exchanged like the all the collectibles or or or art artworks or um different things um so this is like a culture coming to defiance it's also like bringing real value there are options and all other more exotic and complicated derivative derivative products so um so like i use the simple loan to create leverage but then using that and other d5 primitives you can build really really complicated things um that are not necessarily always used by like maybe casual users by but also like by traders and and like kind of semi-professional or professional investors like you can go as complex as you uh as you can imagine um there are indexes so you can create like new tokens that are not like um they're not copying the behavior of other tokens but they're like tokens composed of many other tokens under the whole so for example like the example would be a dpi d5 pulse index and this index consists of er of governance tokens of different like the the most let's say prominent d5 protocols there are insurance funds so you can buy an insurance and that will pay you in case of bug happening in the in the smart contract so you can kind of buy some some safety uh in this world and yeah this is all uh like becoming this sort of internet of money like people are saying that blockchains are not that are not that useful and um and and people when like outside of the space when they ask like so what is the blockchain for and then like the most obvious answer is like money of course it's it's it's money um like cryptocurrency cryptocurrencies too but just you know the regular money also and then they're saying yeah okay like money and what what else what else and uh this is kind of in my opinion it's really really um under they they're really like underestimating the this power maybe ethereum doesn't like you know um [Music] maybe doesn't like cure cure cancer or or or or do any some any other thing that that doesn't fix the the the urgent needs of the um of the world but there's this thing which uh ethereum and and blockchains are extremely good at and that's managing money that's uh that's handling value that's storing value that's creating uh like a sandbox for for startups for fintechs for just times people to create and build all sorts of things that serve the people and not um yeah and that are just just just useful and that they just you know bring freedom and and help you accumulate uh value and maybe will help you help other people uh in the future yeah so uh that would be it and thank you for your attention thank you for uh for for hearing me uh if you have any questions um if you have any questions then okay i see there are some so i think uh [Music] i think i'm gonna pick them and answer them i don't want if you have any more questions then like don't hesitate to answer so um the first one that i'm gonna uh answer um what's the ratio between the collateral and the amount borrowed is it a fixed percent so it depends on the protocol and it's generally not fixed percent like as a as a whole let's say but this is a in most cases it's a fixed percent for uh for uh [Music] for a collateral type so for example in compound you have like some sort of collateral type and like the governance says that okay this is like a very volatile and the collateral uh the collateralization ratio needs to be high and it's gonna be like fixed for like for the time being until the governance changes changes the mind um but there are like different different models and for example in maker dao you can create three types as far as i'm as far as i remember i'm not sure at the at this this one but i think there are three types of if volts so you can for example create if with very high collateralization ratio and like it's gonna be like the the the the required uh collateralization ratio is gonna be pretty high but um but the the debt is gonna be pretty cheap so you're not gonna pay a lot for that but then they're like more aggressive votes with like smaller collateralization ratios but then your debt costs more so for example you can have like okay so now i just now i'm just guessing you can uh you can check the check check this out at maker dao's uh web app but for example you can have like a vault with 100 150 150 percent collateralization ratio and you will pay uh three and a half percent interest annually but then you can for example have like a vault with 120 um percent of collateralization ratio and you will pay like i don't know like nine percent of annually so they're like less and more risky risky scenarios um and then different like interest models this is like not fixed within the device space definitely and these are like not fixed within the um moving the protocols themselves but they're like not you know changing any minute these are like they're like governance these are the decisions made by the governors uh for example um i hope that uh that that answers the question um yeah i'm not very familiar with foreign can we example with real numbers um yeah so i think i think i can do that um i think i can do that i'm gonna okay so i'm gonna maybe return to that question in a moment um but actually this is something that you can probably uh check okay i i think because that would require me entering uh probably a web app of away or compound uh so i can so i can uh so i can then uh show the example i won't uh i won't come up with with an example just from there from the like top of my head so um so that in a minute can i use die for liquidity mind you another question yes definitely yes um it of course depends like there are multiple ways of um of earning interest on on on die but um there are several liquidity mining programs that um that include dye as one of the tokens in a pair so um probably i'm not sure if i should like recommend any concrete but i can say that definitely there are ways to to provide liquidity for example on like on some amm exchange and on the pair of dye and other tokens and then um mine mine some liquidity um the maker da foundation uh maker dao uh as far as i know they do not have any liquidity mining programs there is like the demand for dye is high enough but but but generally yes um yeah uh how would you suggest a financial organization shall adapt to the fight uh yes so that's a that's a tough question um and like here i'm gonna be completely honest with you i'm not a lawyer and um you need to um there are of course like for example different jurisdictions and mine is probably pretty niche it's not it's not the us um so so so so the things that i'm gonna say um are not gonna be that relatable to people uh somewhere else um this is generally i think it's not difficult from the technical perspective it's more um it's more uh complicated from the perspective of um [Music] of regulations and uh and this is uh not something that i'm uh that i'm too familiar with so i would i don't want to make an enable statement um maybe i would just add that um that i know that there are uh some sandboxes that some of the protocols are cooperating with more like institutional um customers and they're like um trying to to to bring defy to institutions and to bring institutions to d fight but this is not like it won't won't happen within like a snap of a finger it's it's a process and takes time and it's mostly the work around the regulations um yeah and when it comes uh returning to the to the to the first questions uh to the the second one so i think i think that [Music] yeah so i'm not sure if if if i have enough time uh now to uh to like a make like live presentation of for example ave okay but i'm gonna share the screen maybe for oh i cannot do that um yeah so i can i can i can say that for example right now on ave which is uh update.com slash markets uh like the main market of dai right now the market size is like 88 88 no 884 million millions of dollars of which 700 millions are borrowed and that makes uh a deposit apy for the for the depositors of some depositors earn uh 12 annually on that and the borrowers pay 60 percent uh 16 of that uh of that annually so that's that's more or less the thing on die when when it comes to other stable coins like usdc coin like for example the market size of usdc is on ave right now 3 billion and 2.7 billion are borrowed so that makes the deposit api to be 6.7 uh annually and the borrow api um the borrow api 8. 8.1 so uh this this this changes like from my experience i can say that the deposit api is uh very rarely drop five percent and the borrow and the ones and the borrow like adequate to that right now there is like a lot of movement and um there is like a lot of movement uh in the in the cryptocurrency world so um so they are higher but like i've been here through entire bear markets of like all these previous years like no 2018 and so and still like like kind of the the five percent is like maybe maybe not the floor value but uh you rarely see these uh these interest rates drops dropped below that yeah and uh i recommend like checking out uh um and checking out compound uh checking out some maker dashboards actually if you want more details and you're if you're still uh here still online um you can ping me on twitter you can ping me on uh on discord i actually [Music] actually recommend following me on twitter and there is the twitter handle uh visible on the screen and i'm open to dms and uh and uh yeah if anyone wants to chat a little more then uh then i'm eager to do so yeah i'm just gonna check out the chat once more maybe there are some questions there um oh yeah there was there was there was a question about the about the the what stands for w about rapture yes definitely and that was that was right um okay then um okay okay i see that there is one question i think what's the better way to get started in the d5 space for someone coming from c5 joining an effort or trying to build uh some ideas of own asking from point of view of ease of technical regulatory implementations yeah so uh honestly uh i would like at the very beginning i think that joining some other support is easier if you are asking from the point of view of ease of uh of the process um as a whole um like this is like a very it's a dynamic ecosystem so so i i i really recommend like joining uh during uh d5 projects defy defy startups uh um and even defy dao teams uh they're like operating very rapidly it's they're like really releasing very often um like the technology is always like cutting edge so i think [Music] like a new person joining the space can learn um a lot really really fast uh by joining one of the one of the organizations um because i think from the regulatory perspective okay when it comes to the regulatory perspective i'm not an expert when it comes to the technical perspective i know that um it's pretty easy it's it's relatively easy to start coding in solidity it's relatively easy to uh like kind of uh you know grasp a little bit so you like feel uh confident already but then there are like some you know this call is like working with money so so there are like audits there are like a lot of security things that you need to keep in mind when you are developing such protocols and i would say i would rather advise at the beginning to join somebody for some even short period of time and to learn a little bit see what are the problems what are the challenges um what are like the the the efforts and then uh and then uh and then again and then probably start from scratch with something and actually uh yeah yeah i think that would be i think that that it's it's it's not any different from um from from other um from other kind of sectors um yeah um maybe maybe here you just you just earned this experience slightly faster because everything is operating extremely fast and extremely rapid um yeah some people love it for for others that might be too fast but personally i i love it okay um okay i think i think that would be that would be it for questions i would i'll wait uh a minute more um okay yeah so i think i'm gonna be wrapping this up seriously guys if you have any questions if you want a chat if you want to talk and then feed me on twitter ping me on discord ping on github wherever else i always have the same handle which is barutco which just disappeared but you have plenty had plenty of time to see it yeah thank you for today we're gonna we're gonna meet sometime in the future because i'm also going to be helping on a hackathon so yeah see you around and have a good one bye you
