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

Loading player…

PowerLoom 🛠 Hacking on DeFi data using PowerLoom Protocol - Anomit Ghosh, Swaroop Hegde

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Anomit Ghosh and Swaroop Hegde from PowerLoom for a workshop titled "Hacking on DeFi data using PowerLoom Protocol". And that wraps up 2022! ETHIndia 2022⎯the biggest Ethereum hackathon to this date with over 459 projects built within 36 hours. 🫂 2000 attendees from 🌆 321 cities that were 🌱 44% new to web3... ...joined forces in Bengaluru to write history. Thank you for taking part in it 🫶🔥 ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Applause] [Music] hi everyone my name is swarup and I'm one of the co-founders of paulum very excited to be here it was actually at um so animeth as my co-founder we have both been in the web series space for about five years we started with building a tool called block Visual and it actually ethi India was the last 18 year I think 2019 yeah when he first launched it and since then we've gone on to build rpc's for Matic before they were polygon and it's kind of the idea of problem also came along there so we we saw a lot of developers and especially the larger adapts and companies using the RPC in a lot of In-House indexing and trying to extract that data on chain and consume it in whether it's for their own use or whether it's for developers and there was no transparently there's also very centralized right so we started thinking about how can we solve this problem and so that's why the problem idea sort of kicked off uh it's kind of funny because we actually presented one of the first use cases at a global hackathon so it's very very dear to us to be able to do this also sponsor for the very first time open up our APS to you guys so nice to have you all here so I'm gonna just maybe quickly walk through about what problem does talk about the bounties and then anumet my co-founder is going to take over show you maybe how to do some of the apis so we also have a bit of uh we are open sourcing something uh today that's probably our first major uh product and he might give a little bit of an overview if you guys want to get your hands dirty that's one of the things you could uh probably attempt for this hackathon okay so paulum Aggregates data from on-chain sources and turns it into snapshots that can be consumed and be stored in a way that's already decent likes from day one right so our larger goal is to turn it into a network of its own where you know developers like you could propose data sets people could snapshot it or you could also be a snapshot of your own and in the end the network could incentivize people who want to either consume or even take part in the network so to just showcase what the current stage of our protocol does we built this use case called pulo and that is actually going to be the focus for what we are doing at this hackathon as well so Pooler is based off unisoft V2 smart contracts we are also supporting V3 for but for today's use case we are just going to focus on V2 so the idea is that you can I'm just going to show you one of these um front-end systems you can actually check out this code Elemental will probably walk you through it so if you've tried Texas like unisaw um uh like sushi swap quick stops on all these EPM chains must have noticed that they all have like an Analytics tool right so because you have all these markets now all of this data is on chain as an end user or as a Trader or as a developer who wants to build on it so it's very complex right so we have sort of shown how protocol works so as you can see here we are sort of snapshotting the data for all about 180 pairs or so on a month like for different um of Ethan other tokens and we snapshot the data aggregate that data and which is what you see here as liquidity volume fees so you can also check that it's actually not I mean hopefully the Wi-Fi works but look at it if this same data set is being stored on what we call you know hot storage so we use ipfs because that is already a decentralized storage mechanism for people to pull in so if you actually run an ipfs node you can pull this exact same CID as well so anyway I'll let it not worry about the Wi-Fi right now and we store the proof on on a chain right now just to show that when the snapshot was taking place so this you can check it out from our website uh so let me quickly walk you through um so let's see after Pooler it's okay so let's go through maybe the bounties that we are offering uh this is actually the first time we are doing this as well so our goal is to provide about ten thousand dollars in total bounties um so first prize four thousand second price three thousand and the third pricing two thousand but if you want to allocate an additional amount for anyone who's willing to attempt right because it's also we recognize is the first time we are presenting to the developer audience so if you're able to even use this in your existing project we would love to uh help you out and if you really are keen on building uh you know taking that open source code base and it's going to walk you through more in detail so we will help you and give you a grant after this hackathon as well so don't think that this is the you know the end of the uh Runway okay so there are two ways to do this um so I'll just very quickly go over it so one is we have turned the what I've shown you as a polar use case and we've given out some centralized apis so that it's very easy for you guys to consume it for the hackathon uh case so you essentially look at the API docs on with we'll walk you through this as well yeah get an API key we have built a simple dashboard for you guys and then come and try out one of these three ideas so these are just references you don't have to work on these three different ideas right so I'm we're just suggesting that this is few things you could build or if you are you know someone who knows how to write hardcore code you want to go into the low level stuff check out how what polar does and maybe build your own use case on top of our protocol so we are opening that up as well so we recognize the snapshotting process might be a lot more complex so we're actually providing a hosted instance so you can just play around with the polar code base so anyway it's going to probably go more in detail and um yeah I think uh in terms of the URL it's powerloom.io 18-22 that should take you to this notion page and if not you guys can probably go through your devfolio and eat Global prices list so this link is there as well okay over to you yeah all right you want to start with this one sure we'll start okay I'm not sure how loud I should talk is this like fine uh never okay fine all right uh so yeah speaking of the hackathon topics right like there are a couple of categories uh where we have broadly divided this so one is like you use the uh kind of pre-rendered API endpoints that we have for you know unit swap version 2 Data along with a couple of other protocols what you need to do right now is before you go into these integration ideas uh I wanted to take a look at the API doc so where do you find the API doctors you just scroll up over here and you'll find API dogs for sure right over here so I go over there don't worry about it so yeah one of the things that you first need to do is like you you got to get a API key right uh this is the very first step obviously I'll come to the postman collection after this uh you have a dashboard uh that we are doing like a self-serve you go register you get a API key I hope that's visible over there so this is the API key that you are going to use to interact with the endpoints including in this Postman collection right so these Postman collection apis they specifically refer to the first category of integration ideas uh let me quickly load those up I don't know what is up with the uh sure so these are the ones that these are like defy data hacks so some things that you can build that uh you already have data on top of units of V2 protocols uh analytical tool LP API comparison so I would not go so much deep into it these are like uh very well documented by one of our team members who is a D5 specialist so he has given you a good resource to get started with a good architecture that you can always refer so my point here is to kind of show you the Json responses from the apis I'll go straight and do it so that you can take a look at what these data points actually serve right and the ideas then you can go into the examples that we have compiled it for you to get started with so let me just shift to postman quickly how is the display coming awesome uh there are a few important endpoints like uh what you can see over here is the postman collection it already has placeholders uh where the base URL is set to one of those instances that we have included in the API docs and a token contract address for example like what is the token contract address in unison version two like there are erc20 contracts they come together to form a certain pair contract address so this is the individual token contract address erc20 as you can see that it comes with all the information already attached to it right so this is where things like building API token trackers liquidity trackers becomes really easy um now if I if I go over here this is something that is known as the daily stats sort of thing so as you can see this is a very short endpoint uh it gives you some idea of the trade volume over 24 hours and when we say previous value like if you read through a little bit for documentation you'll see that we do a snapshot based thing like even what you're seeing as a trade volume of 24 hours we always take a snapshot of where uh the last value was so that we can give you what exactly was the change percentage if I go to the next one this is uh possibly one of the most important endpoints this is the biggest summary endpoint that you will get uh it's like close to 180 85 pairs I guess that yeah thanks for zooming in just can you stretch that up a bit yeah zooming up zoom out oh no no it's not stretching all right um regardless like what I'm looking at is like a Json object of 185 pair contract addresses with the liquidity their trade volumes uh over 24 hours over seven days and then there are some ipfs cids associated with these data sets so it's not like you always have to rely on constantly calling the V2 pair so you can build this into if you're building a front end right you can have these responses cached you can use some ipfs helper libraries right which speeds up the fetches of these data sets makes your uh dashboard or whatever two layer building the rendering of it it becomes much much easier right so um like I I could walk you through uh quite a few things but here are the main points of using these data uh data points is that you have access to a history of changes that is what I'm trying to Showcase to you over here that when you start querying these endpoints you what you start seeing is a change of snapshots like as you can see that over here when I'm creating something called V2 pairs recent event logs right like okay what has been the swap event what has been the mint event right you get a Json object like this you run a filter over it on that uh event key right so you you get a data set that has already been recorded how it has changed over time and uh you can start filtering based on basically your needs if you just want to show mint events you could just go for it on this endpoint and yeah uh definitely there's the summary data point over here where you just passed like a very specific paired contractors right all right yeah and uh yeah but but most importantly like uh I really like the third idea over here and the protocol hacks I would really appreciate if someone picks up these uh the number three or the one after protocol hacks this is where you will see that we are already uh kind of giving you a centrally hosted sort of uh Pooler code that you can see that's running on these endpoints that we showed you right units of V2 overview like you see this over here this is the code that's already open sourced and uh if you just go over here you can see the entire architecture setup how do you hack into the uh cooler code base it's all available over here and most importantly like the part about maintaining snapshots having the changes tracked across time that is already taken care of you just have to enter this like one simple settings key that should take care of everything right so it's the same API key that I have on my self-serve dashboard that is enough for me to get started right over here this API key so when I take a look over here this is the API key this also will help you when uh hacking into the Fuller code base what we're looking for is that we already have certain data points over unisoft V2 style amm taxes that are being served we want something else other than this that would be the best thing that could come out of this or you could come up with a new snapshot service all together like there were people asking about curve Finance or other protocols compound are we uh you you could pick anything that you would like to uh hack on and follow what we have in the readme as a proper architecture so you have a full overview along with architectural uh documentation and code references which will take you to the right place within the code where things are working right uh I think this is what the hell no no no it's pointing to the internal repo we'll have to edit that okay uh we will fix the links that's not a cause of worry but the rest of the code is already available regardless the repo is open sourced we will fix the links so sorry yeah so there's also this um if you really want to maybe after the hackathon right so you could go through the white paper so there's this reference uh this it's available on our uh the home page as well on page as well so this really goes into how what is problem aiming to do where are we are today and how did we get here and what is you know polar being one of the examples and hopefully someone in this audience can probably build our next use case anyway once the Wi-Fi gets fixed that's the way to go about it okay it's loaded all right so let's go back to the I was thinking let's maybe go through the bounties again and just talk about yeah sure um kind of reiterating so uh I think I mentioned in the beginning so we are giving away ten thousand dollars in Bounty um so this is just a rough variation of how we are trying to divide it but it will be completely up to you if you have a more people do a fantastic job we are happy to you know even give a grant after the hackathon so don't worry about this in terms of effort uh being given and even if you're just you know you're completely new developer I love to Mentor um different hackathons like I'm actually not based out of India so I usually travel for many of these hackathons so I've met a lot of people so if you're one of those so don't worry about it don't get woven by what's uh what we sort of went through so even if you're able to play around with apis and sort of build something very very simple we would be happy to give you a small so that's what we have set up as a common price pool so as long as you've successfully integrate even a single API endpoint we're happy to give you a prize for that and for those who want to you know challenge yourself um we have the categories here I'm really looking forward to the protocol acts like people okay coming up I think we can open up for questions if people have yeah for sure I wonder if you have questions let's leave some time for that yeah we have some time okay uh is there a my quick and pass it on for the question I'm not sure if there are questions so no I don't think I actually can't hear it but let's see okay so close okay oh not seeing any questions no questions uh if we don't have and we can go through the integration ideas maybe a lot more if you want to show like hey to inspire people uh sure we have some about five ten minutes are there any questions just make I can't see actually it's okay even I can't lose lights blocking you know no okay so we'll just go through maybe some of these integration ideas do you want to did you cover the first one I think you covered I covered the first two that's okay all right uh one of the things that I don't know if you notice that we have three different uh endpoints open that are being snapshotted for you right uh for an example yeah once you want to open there no uh hold on so if you go back to the main page right like let's show you the endpoints that we have opened for you right go distance so the postman collection is already built for you to place this in what this will help you with is when you actually end into this LP apy idea if you end up taking this up the idea is to use these three different API endpoints that we already offer you use that come up with a certain sort of comparison see what you have from the last 24 hours fees that are generated right and usually this is the formula used if you're not familiar with D5 do not worry about it we do have people who are pretty experienced in D5 and to economics you can always ask them and we will make sure that even if you don't know much about D5 you can build out the data points that can come up with a unique use case right the idea is to also learn something while you're at it so it's not just about code you get to learn a little bit about Finance also right like it's the thing that you should learn regardless right so the API one I like but uh also one of my most favorite ideas happens to be the Dex aggregator over here so sure uh you have the same three different apis that you have right like uni swap Sushi Swap and quick swap apis right and this becomes a place where you have the current price of the token fetched from different dexes right uh why would you think you do that there is something that I don't know if you've heard there's something called Arbitrage right like how would you use this for Arbitrage right if you do not know these terms it's really a good study in just understanding finance and Game Theory itself so I I would highly suggest like the Dex aggregator is a very good place to start learning about it you can even there are a lot of good YouTube talks on these Financial topics you can definitely go check them out so yeah uh we have once more to reiterate three endpoints that are served for you right there uh quick swap Sushi Swap and Unice of V2 right do go ahead do check them out I'm just showing them a front end that shows all these things but yeah you will be using these are the front ends that are using the same apis that are included in the postman collection so like you can see the possibilities are quite a few you can build your front ends you can build uh insights you can build uh report tools like just go as creative as you want to right like you have all sorts of disabled points that are available to you it's a good place to start learning all about you know decent less Finance how data moves across blockchain learning how to build data generation tools insights reports Etc so we'll also be on Discord if you guys yeah we're on Discord uh right so the team is there so we have a booth right in the middle of it so if you see between I think noso safe and ether spot or one of the team spot so look for us come and ask questions if you want to ask in person so if you don't see us there at the booth then we'll be on the sponsor hyphen Power Loom discount uh on your eth global what right so go check it out and Yeah I think that's about it if there's any questions we can go over it otherwise we should be good to go so if you have trouble setting up the hacker dashboard or something it should be pretty straightforward you just sign in with your email uh it should give you the API key anything you wanted to go over the code uh maybe no I mean um if it would be good to have some some feedback from the I'm not sure who's uh having a question cool all right let's wrap it up cool um I guess since there are no questions we have gone over kind of the open integration ideas and protocol hacks to go through it we'll be waiting to hear from him yeah awesome thanks guys thank you

Automatic transcript — names and jargon may be misspelled.