New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

ETHParis: Introduction to the Aave API

ETHGlobalWed, Oct 9, 2019, 12:00 AM

ETHParis workshop: "Introduction to the Aave API" The workshops explain how to use various tools and approaches for developers interested in building in ethereum and related technologies. ETHParis was an ethereum focused hackathon that took place in Paris, France as part of the ETHGlobal series of ethereum focused hackathons. For more information go to ETHGlobal.co March 9, 2019 at 42, the coding school in Paris, France.

Transcript

alright hey guys my name is Donny I'm from of and I'm bill we'll be presenting here with Andre one of her software engineers basically today we're going to talk about how to build decentralize finest and well these interest lending and a cup of words what is avi so basically Alva is behind of lending marketplace based on smart contracts called eteland and basically we started to build at the end a couple of years ago and on 2017 we went to Maine it with the product to basically its crypto back loans market a marketplace build on smart contracts so basically we have two sided marketplace where we connect borrowers and lenders with smart contracts so they can make secure transactions and basically users can pledge over 100 different kinds of collaterals including also you see 20 tokens etherium and recently we added PTC interoperability so you can also pledge PTC to Peru for example die it theorem or other assets and the marketplace is pretty much looks like this so we have borrowers for example who are pledging different kinds of assets and borrowing funds so we have here for example a user who borrowed died against zero acts tokens and we have for example here a user who borrowed against Civic tokens and he borrowed a theorem Fiat pegged well USD effect it theorem which is basic it was our solution before the stable coins and then we have for example in in the lower left corner a user pledging BTC to borrowed died so the idea kind of is that borrowers who doesn't want to solve their assets could actually get liquidity without selling them so it's kind of like 2:04 for example for trading going long or short or for example to get cash flow liquidity yeah so we recently launched another interesting product which is called a B'nai it's not that decent alized basically the idea was to create a gateway for at land so it land is basically a decent last marketplace and the issue is that once you borrow let's say die or aetherium you basically have to find your way to convert those funds and spend them in your for example real life scenarios paying bills or buying holidays and so forth so kind of like in it and we are a bit different because we have vertical approach so we try to build products directly to consumers and thinking like how we can improve the user experience so basically we came up with of a page where you can convert funds directly to fiat funds such as for example euro and USD and pounds so it kind of works this way that you insert amount that you want to basically send to yourself or you can for example use this facility to pay for example bills with cryptocurrency so we have different crypto so you can use for example aetherium land BTC and dive and and basically just insert the amount the person you want to send the bank account number so now you see my details so if someone wants to test test you can always send something something to me and I will try to send it back and then we show you basically how much do I you need to deposit to us and and we initiate the transaction once we get enough confirmations so the rate here is basically euro to USD and for example in dye it costs roughly 0.5% to to send USD or euros and today we're going to talk more about the Ave SDK which enables you the access to to build things on on top of the Edlund protocol and create programmatically for example loans and and and or borrow or just collects some interesting data and for this presentation Andre will come here and basically do the technical part and explain to you guys what you can actually do during this week and and we present also a couple of things that other people are already doing here Thanks yeah I will try to a little bit about our SDK yeah that's the main point of our SDK first of all we are introduced in the Atlanta market place to over SDK on our marketplace you can borrow and land in theorem egged theorem and land you can create long offers it means that you have some cryptocurrency to to do like I just had some troubles with the server and I'm a little bit in still okay if you have some crypto and you want to have some bonuses from it you can place it in our marketplace and then we will found find some board work for you and he will get this money and pay you some interest and loan request it if you have some tokens for example but you don't want to sell them right now but you want to use it some way for example you want to pay bills or do something because you trust that's these tokens will grow up later then you create a new on request place in the yo collateral we find in the lender for you it works like that okay when we create in the loan agreement it's creating the smart contracts now a smart contract and this smart contract has some states related with the long life cycle first of all that's in it and this time we are specifying the parameters of the Mart contracts like duration loan amount and all the stuff after that we are waiting for collateral that means that our Borger should place collateral and when it's placed and the amount is correct we are moving to funding states and on this state we are waiting for funds from borrow from creditor and it can be a one creditor or ten creditors it doesn't matter but when the all loan amount is funded we are going to waiting for payback state and then this time the loan go into the our border and he can do whatever he want okay and after that on this state we are waiting for payments from the borrower after each repayment lender can withdraw this amount to his wallet or cannot do that it depends on him and if repayment we will be missed and then he can withdraw the part of the collateral with the same amount as he should and if when when we receive in the last last pay back we are finishing the loan returning the collateral to the borrower and that's all the agreement is closed if during the life cycle the price of the collateral is going down and then collateral call can happen it means that the liquidation price is the same like the loan amount liquidation price it's the price of the collateral plus liquidation fee and at vfe and interest of the borrower okay and defaulted state it's means when the borrower is not repaying then the contract can go to this state for start working with the marketplace you should install our library and just create the instance of our class for gate and they pay secret okay we have documentation for it you should just call our methods and you with some data like email your password and you will get the access token and after that were important to check the marketplace metadata it's the information which collateral can be used which medium of exchange can be used and duration range available on our marketplace and all stuff like that and in our is DK we have some endpoints forget the data about the loans placed in our marketplace you can get all loans you can get just addresses you can get just one loan or some loans related with the some borrower or with some creditor whatever also we will include maybe some more filters to to make it during this presentation I will tell about loan requests loan offers has more or less the same logic and model is the same endpoints you can read about that later in the documentation when you plan into creating the new loan request you should specify some parameters and first of all you should understand how many how much you can get with your collateral you are making this API call with your collateral amount what you want to place a novel loan agreement type and the currency of the loan and then you will get the maximum amount what you can get with your collateral and also after that you could try to make the loan request you are specifying the medium of exchange currency it's a currency of the loan you will get a collateral amount collateral type the type at so the currency of your collateral ampere that's the amount monthly interest rate in the percentage and duration of the loan in month each month in our system is 30 days because it's hard to manage it and convert site this month is 28 this is the one then we have like a constant touch days is the month and after that you are calling our marketplace request create function and then you will get the plain web 3 transaction object and after that you can expose it in any web 3 provider it can be meta mask could be summed up it doesn't matter logic and worry that's why we return in just plain JSON object in most part of actions later we will need the Refresh collateral price method because we might be sure that's the data in our smart contracts is correct the rates of the currencies and all the stuff and before doing some transactions you should check and if the collateral price is not updated you should call this method ok and that's the example how to work with the place loan collateral you're checking first is collateral price updated and if it's updated let's find if not you need to call the previous function and update the Quadro price on a smart contract and the if state is correct and pop collateral are a surprise objected ablated we should also check is the borrower grant ask permission to transfer the funds from his wallet to our smart contract is the in case of year c 20 tokens we cannot indicate that the transaction happens if we transfer in a theorem then it's easy to know from from smart contract that that's it's placed already but if we are doing the g20 transfer we should make approval for a smart contract to do that ok and if the board were approved the possibility of making a transfer then it's fine and we can do that because after the this transaction smart contract will try to move funds from the bar over to the smart contract now morale is the same logic in the fund alone it's the next one yeah we placed the collateral and we can also do that we also should check everything and after that all this function and with the pay installment also more or less the same we should check approval and after that we can make the payback and if installed an installment will be missed then we can call their partial default like I told before it means that the part of corrado collateral will transfer to the lender and you should check it you should check that installment and missed and make this request and after that if it was many lenders each lender should also call the withdraw our parts of default amount no no no we will transfer only exact amount with the repayment on this moment no no no no we have for example 200 t th the collateral and on this repayment the borrower should repay only to e th and then we will withdraw only to e th from our collateral partial margin copy because the if for example borrower will not pay all all time then each month we will charge from him but we will not transfer all collateral in one month because it will be unfaithful to the borrower cause heels okay and what's next on our ap because at the moment it's not exposed no logic of the earth land for example on earth and we already have the support of BTC and we are planning to add it to our API also soon also we planning to do the notification system on registration you will specify the end point for callback and if something interesting will happen for example a collateral will be placed or a repayment will be missed then we will call your API endpoint and tell you that you should something with that and transfer this information to the Boer War creditor or whatever is in this case you will don't need to monitor all the time what happening you so lazy nothing the transparent and also we are planning to integrate the our pay for automata is the liquidation process because at the moment if collateral call happening then we are just transferring the tokens to the lender but it could be complicated to realize that he may sleep in this time and you will lose money and when we will integrate our pay it will be fully automatized and everyone will be in safe and also we will include a now SDK everything what we will do in so far we have a lot of plans or many things it will be complete thanks Andre me a couple of things like what you could basically build on on the ethylene marketplace so I mean it's it's it's a fascinating thing because a couple of years ago there wasn't much things around for example Eastern as well as finance now basically there said lenders make a doubt there's multiple things that you can actually do and one of the interesting things happening now is is that the ecosystem is growing which basically means that you can use different kinds of things to create very interesting products so one interesting stuff that we have been looking into is basically some sort of like money market fund so you could create a this endless fund where you have a fund manager manager and other people can participate into this fund and have different kinds of parameters for example for the interest rates for the loans long periods loan to value ratios that your phone will accept different types of collaterals for example do you accept certain years here 20 color rules that you consider that are worth while funding and worthwhile taking the risk and of course what kind of type of loan currency are you basic is your fun basically lending out dye it fail or what could be the interest there and of course you can when you're building on top of at land you could also think about the whole ecosystem for example you can try to think how you could make this your fund to work with for example make it our compound and other things that are available now on the etherium protocol and of course you can do other interesting stuff the one of the interesting things I heard here in it Paris and the whole week was this interesting project where a hacker is is working a building basically interest rate swaps between maker Dow and the Edlund so in at land we have fixed rate interest and in maker Dow C DPS you basically variable interest so kind of a way to hedge that Bonjour and that's pretty interesting projects that I'm looking forward to see how it progresses then of course you can do things for example listening events from at Langara in the data for some other use case or just creating some sort of thoughts to to borrow funds for for example for trading so there's a lot of things you can you can come up with and we have some bounties as well available I think Jordan Jordan knows they're a bit more about them and yeah it's pretty fascinating stuff so I really encourage to to look upon the the the SDK what's inside there and and how it's different than others and basically what could be the use case or if you're building into some interesting project now how is there any benefit for example from lending or colorization yeah one other thing quickly want to introduce is is basically our idea of getting news contributions about these endless finance so currently there's a lot of product launches on these endless finance there is a lot of product updates out there and basically what we have felt for the last of of years is that it's sometimes it's hard to get like a exposure for for your product and secondly there is kind of like missing place where you could read all the news about this influencer finance so basically we created a open repository so it's a open source collaborative collaborative way to publish your product launches and and product updates or just some articles related to the file so basically you create an issue and once a curator so anyone can be a curator here you can apply and it's basically just editing proofreading looking at the article is is in good quality and basically will be published at DDOT f5 and the idea is that we have a place for peace and those finance related news without kind of like censorship I mean censorship I mean you can't post anything like that is inappropriate but I mean whatever you're working on no matter how small or big the project is it should be able to be be there and people should know about it because currently there are the electron groups where you can talk about this and those finance but kind of like would be nice if people can search these things on online as well yeah so basically I think it's happy building time for everyone if there is some questions you guys want to ask we have some time for it Yegor you look like you have a question sure yeah that's a good question I think on the Oracles Andre can answer a bit more but on the governance structure basically what we are trying to look now is kind of like we for the past we basically have just developed developed the product the kind of crud governance has been on the side so what we are now focusing this year is basically looking different governance models and how we could actually put more community into the governance and we're looking definitely something similar that maker as but one issue is that kind of like we want people to participate and that's a big challenge now for example when it comes to voting and how easy it is to vote on different things one of course difference is that in in at land it's pretty open platform because you can create different constant loan requests interest rates so it's basically a match market so we don't have for example liquidity pools with arrange interest rates but that's something that we're looking now in this year so I think there's a lot of aspects on governance there and I think that's something where we're going to have a lot of community involvement as well and also we are looking in the governance management basically how we could use ericone and and to simplify the whole voting process and and get more of the community to involve in in at length yeah and for the Oracles I think probably Andre can say cup of word using the coin and providing from Cahuenga turquoise and from marketing and I was much concern this date yeah and the interesting part is that like because we have so many assets I mean we are using roughly like hundred assets so kind of getting prices is is pretty difficult so for example in the u.s. de th price we can easily use and the the makers USD price feed but ever for example because we have so many assets we chose that the the user updates refreshes usually the collateral price which is kind of like a bottleneck on the user experience but getting let's say 100 assets and and and basically every five minutes will be really really costly so kind of that's that's that's one issue but if there's more adoption then I think those cost can be shared and of course the the price feeds is very difficult because if the Luke price sources like for example my market cap or cognac or the exchange is like what is the actual value or price discovery of a token and and all the trading involved because one of the decisions that lenders are making when they're funding these loans they're looking what is the after market like how how traded the token is for example if I get into this exposure am I able to actually get out of it as well and that's a difficult question because like when we are looking at centralized exchanges it's hard to tell what volume is real and what not and it's still very difficult question and roughly it's because of the size of the market we have now but uh that's something that we are working all the time and thinking like how we can firstly mitigate the the risk failure points and how we can get actual real as realistic data as possible because it's not as easy as connecting to our market gap or or or quaint gecko and I think it's guys from moralize definitely knows this issues and it's kind of like what we were struggling as well but yeah so that's that's that's very interesting that we're following now and there's interesting initiatives on on price feed so yeah yeah thank you [Applause]

Automatic transcript — names and jargon may be misspelled.