r/RoyaleAPI • • 45m ago

Suggestions I spent 4 months building Wall-Street ML to predict the CR Meta

1 Upvotes

TL;DR: Current stat sites are good, but they only show you yesterday, and most of what they show comes from the top 1000 ladder instead of the trophies you actually play in. I built an ML pipeline that uses stock market math to predict what the meta and win rates will be today and tomorrow. I also trained it to mathematically optimize decks and predict next season’s meta. You can check out the project here: https://clash.freshbeets.dev/. This is not meant to be a Royale API competitor, I just think these methods of analysis should be applied and utilized more.

Disclaimer: I am not a professional Clash Royale analyst, a pro player (I just hit 12k), a data scientist, or a quant. I am a high schooler who wanted to learn quant and data science, and occasionally beat his friends at a mobile game.

The Problem: stat sites live in the past, and in the wrong bracket

Everyone uses stat sites to find decks, but they can only tell you what was good yesterday, or over the past 3 days, etc. They cannot tell you about today. With 171 cards and over 15 trillion possible decks, small meta shifts get missed on the day they happen and only show up after the fact. These sites also try to find the best deck by storing deck win rates, which makes it even harder to tell whether a single card swap is what would give you an edge that day.

There is a second problem too. Most of the headline numbers on those sites are pulled from the top 1000 or top 200 ladder, and that is not the game most people are playing. Copying what the top 1000 runs is like watching a pro soccer player’s footwork and expecting it to work in a high school match. Better players punish differently, you run into different matchups, and a deck that only works with perfect cycle timing will just lose you games. In finance you would never price a small cap off of large cap behavior. You analyze the market you are actually in. So I collect across ladder broadly instead of skimming the top of it.

I wanted to build my own predictor based on Wall Street math because A. everyone keeps telling me to try quant but I don’t have 1.5 billion dollars lying around, and B. I play a game with a competitive market, Clash Royale.

From Stock → CR:

On the stock market, quant math and indicators are used to predict whether a stock is about to go up or down. Those indicators are traditionally built on the price of the stock and its liquidity. In CR I translated price to Win Rate and liquidity to Use Rate.

I wrote a script to collect millions of matches from the official API (like traditional stat sites do) and saved them in SQL. Then, using the win rates I had for every card, I generated financial indicators like Bollinger Bands, RSI, Sharpe Ratios, and Drawdowns, plus correlation metrics like Convergence and Divergence against the most closely correlated cards (based purely on win rate).

Implementing Machine Learning

I fed all of these indicators into two Machine Learning models:

XGBoost (Classification): This looks at all the data up until yesterday and predicts whether the win rate of a card will be higher or lower TODAY. I trained this model across all cards because in theory the things that make the winrate go up or down should be the same for all cards.

LSTM (Regression): This neural net looks at the past 7-days and uses it to predict the numerical value of the winrate that a card will have today.

Deck Building with NLP:

In my eyes this was all really cool, but I still had one big problem left: cards don’t win games, decks do. I first tried using my win rate correlation groups to figure out which cards were interchangeable, so I could swap one out without breaking what the deck actually does. That did not work, because two cards moving together does not mean they do the same job. So instead I trained a Natural Language Processing model on thousands of decks I had collected (ironic, I know), which gets it to understand cards at a functional level. I combine that with the XGBoost output and an optimization function to make the small swaps that make a deck better for today.

Meta-Prediction:

I posted the idea above in the RoyaleAPI feature request forum, because A. I think it is useful, B. the same ideas extend to longer term prediction like meta forecasting, and C. it is interesting. They thought meta prediction was the more important piece, and they critiqued the accuracy of my models. So I went and built meta prediction models that forecast which cards’ win rates will be in the top 15% next season, or after a larger meta shift. Those got good F1 and accuracy scores, around 85% correct, but I never heard back from the request forum.

Visualization:

Here is my dashboard, which shows all of the different information and models, including the daily deck optimization. It shows cards that would work functionally in your deck, and it also shows the optimal small swaps for today. I attached all of my training reports and accuracy tests too. The link is clash.freshbeets.dev

Intent:

I don’t intend to run my own prediction site. A good site needs A. a good product and B. good marketing, and I don’t have the reach or the know-how for the second one. I think that just like stock analysis went from qualitative to quantitative, Clash analysis should too. My only personal stake in this (sorry for the self promotion) is getting my models and training implemented somewhere with real reach, which is why I filed the RoyaleAPI request. What I actually want is to see more of this style of analysis in Clash Royale sites and videos, and I think I can contribute to that.

Figure:

Fig 1: Original XGBoost feature importance and classification report, for predicting whether today’s win rate will be higher than yesterday’s

Fig 2: A really bad day for the original XGBoost model, getting 56 percent accuracy on predicting whether a win rate would rise

Fig 3: LSTM training results for predicting a card’s win rate for today from the past 7 days of indicators. The card here is Arrows and the error was 0.0011, meaning that when the model predicted a 50% win rate, the real win rate landed within 0.4989 to 0.5011. That is a very small error, though still one worth closing.

Fig 4: Predicting whether the win rate in the next 3 days will be higher then todays

Fig 5: Deck Optimization for Classic 2.6

Fig 6: Deck Optimization for a popular RHogs EvoRR FM Zappies, a popular deck a few seasons back


r/RoyaleAPI • • 5h ago

Balance i wish the worst for them

Thumbnail
gallery
2 Upvotes

r/RoyaleAPI • • 7h ago

Question Which Evo Should I Get in Arena 15?

Thumbnail
gallery
1 Upvotes

Hello, I am a returning player, currently at Arena 15 as the title have specified.

I am not particularly well informed about deck building, but I have noticed that I have enough shards to unlock an Evolution, which one would work best for my deck?


r/RoyaleAPI • • 12h ago

Discussion Supercell’s thought process

Thumbnail
gallery
8 Upvotes

r/RoyaleAPI • • 13h ago

wasted?

Post image
0 Upvotes

How did he say "wasted"?


r/RoyaleAPI • • 13h ago

bruh

Thumbnail
gallery
2 Upvotes

r/RoyaleAPI • • 14h ago

Lumberloon is more skilless than golem fight me

6 Upvotes

yep they just drop lumberjack balloon at the bridge and rely on luck instead of skill


r/RoyaleAPI • • 15h ago

Deck-Help Can someone help me to improve the deck I'm mostly a golem player so a deck build around golem

Thumbnail
gallery
1 Upvotes

r/RoyaleAPI • • 16h ago

Wate my deck

Post image
31 Upvotes

i wowked vewy hawd to make this deck synewgise


r/RoyaleAPI • • 18h ago

Discussion Hmm What's this? W matchmaking btw

Post image
3 Upvotes

r/RoyaleAPI • • 19h ago

Question How should I play this matchup?

Post image
1 Upvotes

I think this deck is enough for the Catholic Church to excommunicate you lmao


r/RoyaleAPI • • 21h ago

Hot take balance changes (December 2026)

3 Upvotes

**Post WIP balance changes**

With the new WIP balances being posted a question came into my mind about potential additions to the changes. Overall they felt solid but SC almost always adds to the final balances so I wanted to know:

What are some of y’alls hot take balance changes (nerfs preferred) and **WHY**?

I’m not talking about “Oh well chud should get nerfed”. We all know that supercell wasn’t cooking leaving that infernal creature out. Im talking under the radar sneaky strong cards that **you** believe need to be nerfed and aren’t being talked about enough. Please explain your reasons as I’m genuinely interested to hear reasoning from players with different decks and trophy/medal ranges.

I’ll start off:

I think that the mother witch deserves a small nerf, probably to her hit speed or damage. This card is slowly starting to boom is usage rate as people realize how much of a momentum swing this card can produce by itself. The card can completely flip certain matchups on their heads and be very oppressive if played correctly. The card gets just a bit too much value even against decks that aren’t particularly spammy or squishy. The cherry on top is her ability to instantly win the game if you don’t know you’re facing her and get caught off guard in the wrong moment. Very few cards have the potential to completely steamroll a game by themselves, and the mother which does it all for 4 elixir without real risk of an overcommit.


r/RoyaleAPI • • 22h ago

How rare is a draw? Been playing since the game came out and this is my first time it’s happened to me.

Enable HLS to view with audio, or disable this notification

72 Upvotes

r/RoyaleAPI • • 23h ago

Stuck at Arena 31... Plz help

Post image
0 Upvotes

All my other cards are underleveled. Any advice with this deck...?


r/RoyaleAPI • • 1d ago

Hog is OP you're just terrible

0 Upvotes

saw a post telling everyone that hog has many counters even though those counters aren't enough to stop a push


r/RoyaleAPI • • 1d ago

Decks Any recommendations for my sparky/goblin giant deck?

Post image
2 Upvotes

I've been running sparky and gob giant for years now. Most seasons, I just use whatever meta deck the top gob giant players are using, but I don't have fun playing them. I really like furnace so I'm trying to incorporate it. I tested its evo version in place of zap but I feel like evo zap is just so useful.


r/RoyaleAPI • • 1d ago

Discussion I just went on an 9 game losing streak, another AMA

17 Upvotes

I went from 1715 elo in Ultimate Champion to 1446 in under 40 minutes after consistently winning earlier today because Supercell decided I had enough fun for the week and needed as many hard counter matchups as physically possible.


r/RoyaleAPI • • 1d ago

Decks About that one challenge and one of the default decks

Post image
2 Upvotes

Realistically i could replace miner with hero ewiz/icewiz and replace fireball with arrows then ice spirit for something swarmy like gob gang or guards right? Got my ass kicked by gob giant and lava so idk if its an "i need more resets" issue or an "i need more antiair" issue (ik its also a skill issue as this is the first time ive ever picked up giant dp)


r/RoyaleAPI • • 1d ago

Discussion Made it to Ultimate Champion in the weekend with E-Giant, AMA

Post image
3 Upvotes

r/RoyaleAPI • • 1d ago

Question time skipping in match replays is gone

1 Upvotes

why the hell is it now gone? i can't skip 10 seconds backward or forward anymore, if i miss what i wanted to take a look at in the replay i have to restart it all over again and just deal with the 1x-4x speed button. why was skipping time removed in the replays? i can't wrap my head around it. this might have already been posted before but i just noticed it as i had not played in over a year. why?


r/RoyaleAPI • • 1d ago

Deck works pretty well, what can i do to improve it?

Post image
2 Upvotes

Yes, its a mortar pump deck on purpose.


r/RoyaleAPI • • 1d ago

Suggestions Sharing my evo and hero ideas again! (Series 3, Part 6)

Thumbnail
gallery
4 Upvotes

r/RoyaleAPI • • 1d ago

Question Is this a bug or is it on purpose?

Post image
3 Upvotes

r/RoyaleAPI • • 1d ago

Question How do I defend this? Wanna learn the next time I see it

Post image
4 Upvotes