Creating an app to calculate curation APR on Hive with Claude

Creating an app to calculate curation APR on Hive with Claude by @achim03 on 3Speak

For the Liotes project, we always need tools and sometimes the tools we use stop working. This was the case just recently. A tool that we used was not available anymore and we were thinking that th...

Tags: #tribes #claude #ai #coding

Transcript

Okay, welcome to this video. I'm not really sure whether it's working already or... Okay, it seems I'm live, I have no idea... Sorry, it's the first time I'm doing that, and I don't really know how things work. So let me just tell you what is the idea of this project we are using for the Lyotus project continuously tools. and these tools, they sometimes stop working. And this was the case just recently. And we have our Lyotis voter project that is actually paying to delegators' rewards on a daily basis, and we base that on the curation APR that we generate. So since the page that calculated this doesn't work anymore, we came to the idea that it would be a good idea to actually... build such a tool by ourselves, and that's what I want to do. And since my colleague doesn't really know how to use Cloud and how such things are done with Cloud, I thought it would be a good idea at first to show him how I do things with Cloud and also to try out the streaming of ThreeSpeaks. I'm not even sure whether things are working, so hopefully it works. So, first of all, before I get started, what we would like to do is to create something like that. This is Hive Stats, and we would like to create, calculate the Curation APR, and we would like to make a tool for that. So to make this tool, I would like to show you how I want to proceed, and first of all, I will now reduce the window slightly so that you have a better view. In Cloud, I don't start with Cloud code first. I go to here to a normal communication, and I try to use the microphone, I hope this all works together. Hello, I have a project. We would like to create an app that is within a HTML page without database, without fancy JSON frameworks, simply HTML page and everything within so that I could upload this page to any type of server. The idea of the page is that the user can enter his Hive username, and the tool would then calculate the curation returns of this user for the last seven days, and divided by his hive power, and it would show him the curation APR that he has on a yearly basis. My question to you is, how would you build this? So this is the prompt that I give to Claude, and then I see what he proposes. So... Now I'm not building anything, I'm brainstorming, and this can take some time. I'm using Sonet 5.5. No, it's not necessary for such a thing to use the latest version, and I want to see what he proposes. So while he is thinking, I... close a bit the window. There is one thing that I don't really know is how much time has passed because it will, it's limited in time, I think, so. Okay, and yeah. So let's see what he proposes. I go a bit bigger, so I build a working single version. 5, since statistically used way to self-contained HTML, Hive Curation. It has no database and no libraries or frameworks, so you upload it to any web post. How it works. The browser calls the public API nodes with three fallback nodes. Those nodes allow cross-origines request, so no backend is needed. It calls condenser. Hive power converts best to HB, using... Perfect. Okay. Now, for me, I like to brainstorm it, and often the result is quite good, but I want to go a bit further, and I tell him now, the next step is, that sounds good. Could you create a... PRD that I could enter into the cloud code. Don't build anything at the moment. So the idea is that when... I ask him to create a PRD, he generates a document, and this document defines the objectives, the way of building, and this is then the kind of the building block for the real building process. So here is the PRD, okay, and you see everything is very clearly formulated. and what I will do now is I will simply, Control C, copy it, and now I will go to Cloud code. And I have here created a folder, and so it's an open folder, created a folder, and now I now I paste what I had before. And important, I go here to plan, because I don't want them to build anything yet. And now, this is the APR, this is, sorry, the PRD of a project that I have on the Hive blockchain. I would like you to go through this and come up with a clear building plan that respects this PRD. Could you do that, please? So this is something that may take some time because now he thinks it true, and he doesn't build anything. Now he's still planning. So the brainstorming was the first part. Now the planning is the second. He checks out everything. He uses small little bots to check out the plan. And now he is already building the plan here of what... could be how it could be built. Okay, so, of course, this takes some time, and it's normal. So obviously it's a bit boring to wait, but this is the important part. This is where he thinks things through, checks everything, and here it's the part where you shouldn't jump steps, because he will provide now a building plan, and sometimes there are mistakes in these building plans. It's not a mistake in terms of programmatic knowledge, but it can be a mistake of what I want. So it's possible that it creates something totally different from what I want. So this is where I can still correct it. Okay. Why create a PRD? So first of all, this PRD is a kind of architecture building steps for an app, okay? And this is something that I always save, because this is something that is important to, it's something that I can use for another AI, I can use everywhere, and I still remember what I started with. So let's go back there is now a question. So, Okay, the PRD computes effective as own, plus delegated in, minus delegated doubt, Hive also subtract the pending weekly power down from voting weight, so for an account that is powering down the PRD formula can show a slightly lower that is really earns. Okay, which formula should use? Follow, keep the formula exactly as written the note under the result mentions that power downs are not deducted. But as you can see, he thought three steps ahead, I didn't say anything about delegations in delegations out, and he managed to go that. I will go as PRD. In our context, normally we don't power down this account, so of course, if it's a tool that should be available to other people, that would be interesting, but I will go as he recommends. So this is an important step that, okay, now that he can, now he tests the APIs to see whether he gets the data that he wants, so that he doesn't build something that afterwards doesn't work. So this is also a very important step, I believe. writing the building plan, and that's exactly what I expected. And once the building plan is generated, it will be up to me to accept it or to make modifications. So, here is the building plan, and I hope you can see it. Maybe I can, I can't zoom in. Okay, so the plan, I will need to go over here. asks for a one self-contained index HTML that takes a Hive username and shows curation APR on Hive power for the last seven days. The project folder, okay, is empty, so this is a new build. The only file created is index HTML. Okay, he is what he checked. And now, the... He says, requires time out. Shape Check, Privacy Details. One card with title, form, a hidden result, APR headline. So the CSS, I don't really care. This is something that can still be changed afterwards. The functions. Okay, to be honest, I'm no developer, so not everything makes a lot of sense to me. What is important to test scripts? Okay, mocked. So I don't understand also what I'm going to, here I have to write. Will it be possible to enter the Hive username to check the APR? Now this is sometimes a bit tricky because he writes it somewhere and yes, you type any Hive username without, and press calculate to see the accounts curation APR and breakdown. We know login needed. I'm adding this to the top plan, so it's explicit. So, yeah, to be honest, in this case, I don't really know what he's doing that while reading the plan. I don't really get it, so. I trust it now since it's a small project, this is something that I can still modify later on. And since I have the PRD, I can restart from scratch. I can use this PRD and just feed it to it again and start another instance of it. And so now, if I want to continue, I could go on, revise, or I could say accept and use auto mode. It's building, and which is interesting because if I go into the folder, let me just open the folder that is visible for you. So this is the folder, and so at the moment it's empty. and I gave him the access to only this folder, and now he started to create the index. So this is the document that he is generating, and he wrote it. You can see here what he is done in, now he runs the mock logic tests, and then... Basically, while building, he is checking whether everything is working, okay? So this is important and making actually the tool useful or not. So if it doesn't work, well, then it doesn't bring anything at all. And while it's doing all this, Often when you have the tool ready, you can actually say, okay, it's fine, but I would like to change something. And you can always come back and say that this version, this is not okay, change this, change that, and the code will simply be adapted. And the great thing is that cloud is actually... changing the files by itself, so this is what is amazing. So the tool seems to be ready to use, but he is just still checking things. And I will simply open it, and since it's a HTML page, it should work in any browser. I honestly... love to work with such simple pages. I create all my apps as browser apps because I don't want to work with deployments, with virtual servers and so on. A HTML page, you can load it to any type of server via FTP, or you can use it locally in your own browser without having to put it on the internet, and this makes things so much easier. Most of the things are actually possible. If I need a backend, I often use PHP, because this is also very easy to upload to a server. It's a bit old-fashioned and so on, but anyways. Okay, now we have the document that he says is ready. Okay, here is the document. Now let's just enter my account and calculate. This is the APR. delegated in, delegated out, effective life power, curation rewards the last seven days, number of rewards, average per day, 21.22 new API, if compounded weekly, that's pretty amazing. So let's check our Lyotas Voter, that how much is the 8.94. So, This shows you the average curation APR that you have at the moment. And now I could tell Claude to change the colors or so on, but I just need a tool that works. And obviously, it seems to be working. And I think this was an interesting thing to check. Okay. Hope this was helpful. Thanks a lot for watching. See you soon in another stream or video. Bye-bye.

Comments

@tojpiendo: It seems like 3speak is blocking IP addresses coming from data centers? In other words, is it partially excluding VPNs? said at 13:03 during the live stream

More videos on 3Speak