Transcription
A lot of people have been talking about how we can use AI to create our own trading board. So, in this video, I'm going to be showing you exactly how I'm going to do that. I'm going to do this for the first time. So, just pay attention. This might be a long video.
First thing I'm going to do is on my desktop, I will be creating a new folder and I'm going to call the folder trading bots. That's the very first thing I'm going to do. Now, after creating this folder, as you can see, I'll just simply right click on it and activate my terminal. I've just opened up a terminal. Nothing too special. Just opening up a terminal. This is the terminal. Nothing too special.
I'm going to be using Claude. So, I'm going to call Claude in the folder I just created. All right. So, Claude is going to spring up and ask me if I trust this folder. And I'm going to say yes, I trust the folder. And then that will immediately go ahead and activate Claude. Now, that's the second thing I just did.
The next thing I'll be needing is an account with Poly Market. Okay. So, everything I'm going to be doing is on Poly Market. Um, I heard a lot about poly markets. I'm trying to see how we can actually leverage what we've been hearing about poly markets from the politics, sports, crypto, ion finance, uh, geopoliticals, technical, uh, culture, economy, and all that. So, but I'm going to be focusing on everything.
So, once you have an account with Poly Markets, I think the next thing now is to get Poly Market APIs. All right. So, how do you find the Poly Market API? This is where I'm going to go. When you click on here, you will see where it says API and that will take you straight to this page. Now, when you go to this page, you'll be seeing where it says documentation and API reference. All right, there are two of them up here. Don't forget.
So, first of all, I'm going to go to documentation and I'll take this URL. Copy the URL and then come into my terminal and I'm going to paste it right here. Then I'll put a comma. The next thing I'm going to copy again is um I'll go straight here and copy the poly market website as well. I'm going to copy that. Come back to my terminal. Paste it there. Put a comma. Then the last one I'm going to copy. I'll go back to this API page and I'll click on API reference and then copy this. You'll see why I'm copying all this in a bit. All right. I'm going to explain all that in a bit. Then I come here. I put this in.
Now after doing that I will go straight to now put in my prompt. I want to create a trading bot that I can use on poly markets. This trading bot will study the best traders on the leaderboard with the best and profitable P&L. The trading bot will mimic their trading and place trades same as they have with the available balance that I give to it. Now this is the fancy part. I'm going to now give some further instructions for it. I'll say investigate this idea from the links provided and come up with a plan and how we can achieve this. Follow all best practices. Also, I want the trading bots to monitor these traders every 5 seconds to know when they have placed a trade and proceed to do the same. I will be using Mercury 2 AI as the power AI that will run this. We will also need a control panel that shows me all activities as it unfolds so that I can see what is under the hood. Add a button that activates agent the agent/bot or shuts it down just in case I want to shut down my computer. Do I need to run it locally? That's that's another thing. If I'm going to host it online, so it doesn't need to run locally. I think I will remove this part. Um just remove this part to add a button. I want you to really dig deep and come up with the best possible architecture for this.
I'll go ahead and fire this up. It's fetching documentations from the links I've given to it now. And once it's done with fetching all those things, it's good to now go ahead to include the recent command or the recent prompt that I just cued up for it to read. So when it does that, hopefully we're going to see what the plan is. So let's give it some time. So as you can see, it has added the latest prompt that I've given to it.
So there's something else I just remembered I did not add. I'm well, we're not coding yet. So I'm going to add that. I have some set of rules that I give to claude. I like giving to Claude. So Claude follows those rules when it's building for me. Those rules are simple. It just simply tells Claude to make sure that it goes round and effectively write the codes. Make sure that it does not skip any part. Make sure that it debugs itself looks through the uh the code and gets exactly what I want it to get exactly what I want it to write. It writes it out plans it properly and then builds it. Another thing the prompts that I built uh the instructions that I built tells Claude is as you do this at every time you get to a certain stage save onto memory so that you'll be able to remember where you left off what you've done what is left undone in case you are probably compacting the um the context window or or I shut down and then come back to it again it to be able to just go to memory and say okay look this is where I left off this is what's remaining this is where I'm supposed to continue from so I don't have that headache to always at prompting claude to do one thing or the other. So that instruction is there. Also I asked it to create a certain file. That file it saves all the errors it catches, the bugs it catches and how it fixes the errors and all that and uses that to train itself to avoid those kind of errors next time. So I have that instruction but what I'm going to do is I'm going to leave that instruction um in the comment section. I'm going to leave it in the description of this video so you guys can pick it up if you need it.
So now it's done. It has given us the plan. So let's go through the plan and see what exactly it has come up with. So okay uh a copy trading system that monitors top poly market traders in real time uses make 2 AI for decision validation and mirrors their trades with your capital all surface through a live control panel. All right so it says here layer it has the back end that's the bot engine going to write it in Python. I'm not going to bore you guys with technical um jagons because right now this video is just about teaching you guys for those who don't even know what what to do. You're not technically inclined. You've not written a single code. You don't know how to write it. This is a simple way that you can build your bot. All right. So it says uh here it has the AI engine. Um it has the realtime commerce uh front end control panel database task Q and blockchain. So all that is um the layer and the technology that it's going to use.
Now system architecture five core models they broke them down in five models. So the model one is leaderboard intelligence engine. It's going to source it fetch blah blah blah. Then uh model two is the trade monitor 5-second pooling loop. So it's going to be every 5 seconds is going to be pulling data to find out when we can get to the trade and get out of the trade. Now model three is the mercy 2 AI decision layer. Every detected uh trade is passed to me 2 before execution. Mercy 2 evaluates. There's a fantastic reason I'm using McCree 2 and I think you guys should use it as well. But all this is just for determining purposes. Do your own research. I'm not an trading advisor, not a financial advisor as well. Do your research before you do anything drastic. Now the model 4 says trade execution engine authenticate via polyad blah blah blah. So model 5 is the control panel live dashboard where I'll be seeing exactly what is going to happen or what is happening. So modify is going to be giving me the leaderboard view which will be uh tracked leaders their P&L win rates last trade then live activity feed portfolio view trade log B controls mity AI feed alerts all that has failed trade low balance unusual activity.
Now this is the data flow market poly market data API 5 seconds pool trade detected yes mercury 2 AI execute so it's got all that data flow planned out. He says, "Why McCreat as a middleware layer, not just blind copy? Blind copy trading can be dangerous. A top trader might be hedging a large portfolio in ways that don't apply to your capital size." Mr. adds a risk aware filter.
Now proportional sizing logic. It says if I track trader has 50,000 portfol uh I'm not going to put exactly the amount that the trader is using as well. I could I could actually do a $10, $15, $20 and all that. So, but then I I like the fact that he was able to come up with proportional size logic because if um the portfolio has has 50,000 portfolio, okay, and takes a 5,000 position which is 10%. You have $1,000, the bot will allocate a $100 because I'm doing this video to accommodate those that wouldn't have large amount of money to trade with. So I assume I have a $20 in there because the trader that I'm copying the trade from is taking the 10% of his capital. So my bot will actually take 10% of my $20, which obviously is going to be u $2. All right. So it's going to trade with $2 and then we'll see what what happens. Exit mirroring. When a tracked trader closes reduces a position, the bot dictates the position decrease in the next 5 seconds and then mirrors that exit proportionally, which is fantastic. risk control hard cap it's going to take all that then this is the folder structure for the project so what I need from you before we build make API details your wallet setup starting balance how many top traders risk tolerance dashboard reference once you confirm this we start building model by model so I like this fantastic so I'm going to provide this six things that is asking me to do.
Let's go to poly markets and see how we do the wallet thingy I've not put anything here so I'm going to be asking that we first of all trade on paper which is just fake money nothing too uh fantastic so we're going to do paper money for now so if I come here I'll say I like doing this I do the same way it's asking me the questions the same way I respond I say one mercury API details so let's let me fetch mury API details my API keys so I go here I'm going to generate a new API key so I can give it to uh claude and don't worry I'm going to blank it out I'm going to call this trading bot it's created the API key I copied it and then copied it so I'll go ahead and then paste it right here. Number two says your wallet setup uh EOA wallet that is standard or magic link genus safe. I'm just going to go ahead and say start. So reveal private key. So I copy this and come back here and I paste magic link. We're ready. We set this in. All right. So this is the plan it came up with again. It said before we start building a free critical notes security warning never share your private key again in a chat email or any message now that is being shared here consider generating a fresh dedicated wallet for this bot the key will only leave in a file locally never in code never committed to g okay updated plan with your specifics paper trading mode since polyat has no test net paper trading works like this the bot monitors real trades and detects real trades I think this is good it says ready to start building just say let's build and I'll go face by face showing you exactly does before moving to the next.
All right, so I'm good with this. So the next thing I just do is I say let's build and then it will start.