v1.2.1
Breaking Down The Stalk Market
Written By: /u/Edricus - Discord: Kelauron#2495
Publication Date: April 1st, 2020
Special Thanks: Ninji
Version: 1.2.1
Before we begin, I’d like to thank Ninji who was the first person to publish the datamined code. Up until then, many channels had been analyzing weeks worth of data to try and find some patterns but more importantly to see if they had changed since the previous game.
With the data mined code for how turnips are calculated, we can now reverse engineer the process and get a peek into how things work to help us better predict our Stalk Market trends.
Additionally, I would like to thank several people who gave this paper an initial read and helped with general editing. Without them I likely wouldn’t have caught several of the small errors that were made and resolved.
A reminder that all this is solely based on the data mined code that was provided. If you have observed anything different than what is stated here, I encourage you to submit your information along with some proof. Preferably a screenshot or data set if possible.
The goal of this paper is to take a deep dive into the code and really explore all of the numbers and algorithms at play. With that said, let's get to it! Enjoy!
During the analyzing process many people had written off the idea that the price that Daisy sells at played any sort of factor in determining how your weekly turnip prices are calculated. What we know now is that it does play a role! But what we also know now is what range those prices are locked in at.
This is very simple. Daisy’s price is calculated based on a random integer between 90 and 110. So in other words, Daisy will never sell you turnips for less than 90 or more than 110. From this moment forward, let’s refer to this number as the base price.
A very important note is that the base price is the sell price on your respective island and not anyone else's that you may have purchased from. Even if you purchased Turnips at 90 Bells from your friend but your island’s Daisy was selling at 100, that would be the base price for your weekly pricing.
Upon investigation of the code, one of the first things that happens after randomizing Daisy’s sale price is determining what your pattern for this week will be. Interestingly, the pattern you received last week plays a pivotal role in determining what pattern you will get next week. Let’s start by defining what pattern types are present in this game.
The patterns are defined by a simple integer value between 0 and 3 inclusive.
Pattern Identifier | Pattern Name |
0 | Random |
1 | Large Spike |
2 | Decreasing |
3 | Small Spike |
You may be wondering how the game determines what pattern you should receive the very first time you buy Turnips from Daisy. Since at this point you never had a previous pattern what happens? There is a special chunk of logic to deal with just that. If a previous pattern is not detected and it's the first time you’ve ever bought Turnips then your pattern is immediately set to Pattern 3 - Small Spike.
Each type of pattern listed above has a percentage table assigned to it. This percentage represents the chance of you receiving a particular pattern as your next one.
Percentage Matrix | ||||
Random | Large Spike | Decreasing | Small Spike | |
Random | 20% | 30% | 15% | 35% |
Large Spike | 50% | 5% | 20% | 25% |
Decreasing | 25% | 45% | 5% | 25% |
Small Spike | 45% | 25% | 15% | 15% |
The left column is last week’s pattern and the top row is your next possible pattern for the current week. For example when receiving a Small Spike pattern on Week 1, you have a 45% chance of receiving the Random pattern on Week 2. A 25% chance for a Large Spike, a 15% chance for a Decreasing pattern and a 15% chance for another Small Spike pattern. A reminder that just because you may receive the same pattern again, does not mean the values within the pattern will be exactly the same. It just means that if you had plotted out the data on a chart, the overall trend would be the same.
Okay, so now we understand how different patterns are chosen each week but you are likely wondering how each pattern got its name. Well the answer to that lays in another concept uncovered in the data mine which we will call Phases.
Different patterns have different types and amounts of phases. They also have varying lengths. I will do my best to break down each one below by pattern. For the sake of easy explanation let us assume that our base price is 100 Bells unless otherwise stated in an example.
It is also worth noting the following important points
Probably one of the most nerve wracking patterns to be in. This is broken down into 2 major phases. They are listed below.
The interesting thing here is that each of those phases happen an exact amount of times each week. There will always be 2 Decreasing Phases and 3 Increasing Phases. The chart below describes the phase and the order they happen in.
Phase | How Length Is Determined |
Increasing Phase 1 May Not Occur | A random amount between 0 and 6 half days |
Decreasing Phase 1 | 50% chance of being 2 half days 50% chance of being 3 half days |
Increasing Phase 2 | This one is interesting as it breaks down into two calculations. First we determine a temporary length with the following formula. Temp Length 7 half days - Increasing Phase 1 Length Example Increasing Phase 1 Length set to 4 half days Temp Length 7 - 4 = 3 half days Then we determine Increasing Phase 3s length below. Please read that section before proceeding in this cell. Once that is determined we use the following formula. Temp Length - Increasing Phase 3 Length Our range was between 0 & 2 Half Days Let’s say we randomized 2 Half days. 3 - 2 = 1 Half Day |
Decreasing Phase 2 | 5 half days - Decreasing Phase 1 Length Example Decreasing Phase 1 Length 3 half days Decreasing Phase 2 Length 5 - 3 = 2 half days |
Increasing Phase 3 May Not Occur | A random amount between 0 and Increase Phase 2 Temp Length - 1 Example Increasing Phase 2 Temp Length set to 3 half days 3 - 1 = 2 half days Our range is now between 0 and 2 Half Days inclusive. |
Below is the order in which these phases happen
Additionally, each phase above acts on our base price (which remember is 100 for now) in a different way. Note that Bells are always rounded UP to the closest integer. See the chart below.
Phase | Algorithm | Description |
Increasing Phase 1 | Random between 90% and 140% of your base price | This does mean that in this phase Nook’s buying price may be 10% lower than what you bought for but up to 40% higher as well. In our example our min and max would be 0.9 * 100 = 90 Bells 1.4 * 100 = 140 Bells |
Decreasing Phase 1 | Initial starting base rate is random between 60% and 80% of your base price Every half day this base rate drops by 4% to 10% for the length of this phase | In our description above, the length of the decreasing phase was either 2 or 3 half days. Let’s assume we got 2 half days as our length. At worst this would mean the following would occur. Initial Base Rate: 60% Monday AM: 60% of 100 = 60 Bells Monday PM: 50% of 100 = 50 Bells |
Increasing Phase 2 | Same as Increasing Phase 1 | At this point you can start to see why this is labelled Random Pattern. Now we just get similar sporadic numbers to Increasing Phase 1. |
Decreasing Phase 2 | Same as Decreasing Phase 1 | Basically at this point the pattern has repeated with one more Increasing Phase to go and that’s it. |
Increasing Phase 3 | Same as Increasing Phase 1 | We’ve now come full circle. The ride is over. |
In a Random Pattern your maximum profit will only ever be 140% of whatever your base price was. So in our example, 140 Bells would be the most we’d ever see in this pattern. The interesting part of this pattern is its variable phase length.
Your best bet here if you don’t have any friends whose island you can visit is to sell the moment it is higher than your buying price. Unless of course RNG is not in your favor and during the Increasing Phase you always get 90% of your base price. But that likelihood is low. You are much more likely to either break even or make a semi-decent profit.
Likely the most exciting pattern to be in. When the second phase of this pattern kicks in players can expect massive profit. This pattern contains four main phases.
Phase | How Length Is Determined |
Steady Decreasing Phase | A starting peak date is calculated first by randomizing an integer between 2 and 8 half days inclusive. This will dictate how long it will take before the Increasing Spike Phase begins. Minimum Length: 1 Half Day Maximum Length: 7 Half Days |
Sharp Increasing Phase | Always set to 3 half days |
Sharp Decreasing Phase | Always set to 2 half days |
Random Decreasing Phase May not occur | 12 - Decreasing Phase Length - 5 It is worth noting that with the formula above this phase may not even occur if the result is 0. Peak Start = 8 Half Days Decreasing Phase Length = Peak Start - 1 = 7 Half Days Sharp Increasing Phase Length = 3 Half Days Sharp Decreasing Phase Length = 2 Half Days Random Decreasing Phase Length = 12 - 7 - 3 - 2 = 0 Half Days Minimum Length: 0 Half Day Maximum Length: 6 Half Days |
Below is the order in which these phases happen.
Additionally, each phase above acts on our base price (which remember is 100 for now) in a different way. Note that Bells are always rounded UP to the closest integer. See the chart below.
Phase | Algorithm | Description |
Steady Decreasing Phase | Base Rate initially set to be between 85% and 90% Every half day in this phase the base rate decreases by 3% to 5% | At first this pattern does not seem friendly. Prices will start lower than what you bought at. In the worst case this phase will last 8 Half Days and decrease from 85% to 45%. That is a 40% decrease over 8 half days before a massive spike occurs. |
Sharp Increasing Phase | Half Day 1 Base Rate set to be between 90% and 140% Half Day 2 Base Rate set to be between 140% and 200% Half Day 3 Base Rate set to be between 200% and 600% | This is quite literally where the money is at. Half Day 3 will be the absolute best day to sell. You are guaranteed a minimum 2X return on this day with a maximum 6X return. |
Sharp Decreasing Phase | Half Day 1 Base Rate set to be between 140% and 200% Half Day 2 Base Rate set to be between 90% and 140% | While these numbers look attractive, compared to what we just saw in the previous phase this could be a sharp decline and is definitely a decline in general. |
Random Decreasing Phase | Base Rate set to be between 40% and 90% | At this point, if you missed out on selling, then you lost major money. It’s not going to get better from here on out. It will just be a ride similar to Random but with worse rates. |
This pattern allows us to see what the ceiling is on the Nook Shop’s buying price. At a base price of 110 and a maximum possible spike of 600% we can calculate the ceiling to be 660 Bells per turnip.
At first this may look like a decreasing pattern. But keep an eye out! Remember that a decreasing pattern will keep decreasing every day. If at any point your decreasing pattern increases you may be looking at a large spike pattern. More importantly, if the 3rd half day after your first increase is greater than or equal to 2X your base price then you are definitely in a large spike. Keep a careful eye out for massive increases and remember that your third one is going to be the best one!
This one is fairly self explanatory. The only phase here is the sounds of bells disappearing. Essentially what will happen here is that your prices will continue to decrease every single day.
Let’s take a deeper dive and see how it works.
This pattern helps us figure out what the lowest possible rate that the Nook shop will buy from us is.
We defined our base price as 100 Bells. Now we follow the steps. When following, keep the formula below in mind. Note that percentages are defined as a decimal between 0.0 and 1.0. So 85% would be 0.85.
sell price = base rate * base price
This is the worst pattern of the four and if you find you are caught in this your best bet is to either sell immediately or find a friend and sell on their island. Every day you wait, you will lose more and more profit.
The final pattern! We made it! Now this isn’t going to be as exciting as the Large Spike pattern but you will be happy to be in this one as they share similarities. When the second phase of this pattern kicks in players can expect profit. This pattern contains three main phases.
Phase | How Length Is Determined |
Decreasing Phase 1 May Not Occur | A starting peak date is calculated first by randomizing an integer between 0 and 7 half days inclusive. This will dictate how long it will take before the Increasing Phase begins. It is worth noting that with the randomization above, this phase may not even occur if the result is 0. Minimum Length: 0 Half Days Maximum Length: 7 Half Days |
Increasing Phase | Always set to 5 half days |
Decreasing Phase 2 May not occur | 12 - Decreasing Phase - Increasing Phase It is worth noting that with the randomization in the first decreasing phase, this phase may not occur if the result above is 7. Example Decreasing Phase 1 Length 7 Half Days Increasing Phase Length 5 Half Days Decreasing Phase 2 Length 12 - 7 - 5 = 0 Half Days Minimum Length: 0 Half Day Maximum Length: 7 Half Days |
Below is the order in which these phases happen.
Additionally, each phase above acts on our base price (which remember is 100 for now) in a different way. Note that Bells are always rounded UP to the closest integer. See the chart below.
Phase | Algorithm | Description |
Decreasing Phase 1 | Base Rate initially set to be between 40% and 90% Every half day in this phase the base rate decreases by 3% to 5% | At first this pattern does not seem friendly at all. Prices will start lower than what you bought at. In the worst case this phase will last 7 Half Days and decrease from 40% to 5%. That is a 35% decrease over 7 half days before a spike occurs. |
Increasing Phase | Half Day 1 & 2 Base Rate set to be between 90% and 140% A Max Rate is set between 140% and 200% Half Day 3 The Base Rate is set to be between 140% and Max Rate - 1 Half Day 4 The Base Rate is set to be the Max Rate Half Day 5 The same as Half Day 3 The Base Rate is set to be between 140% and Max Rate - 1 | This phase is likely one of the most interesting phases of the bunch. The first two half days see decent potential spikes. The second half day may not always go up from the first. Sometimes it goes down producing a “double spike” pattern. After this a max rate is locked in between 140% and 200%. This is important as we proceed as it highlights why Half Day 4 will be the highest earnings day. Half Day 4 has its price calculated using the max rate that was determined before Half Day 3. Since Half Day 3 and Half Day 5 subtract 1 from the final output, Half Day 4 is guaranteed to be the highest possible earnings. |
Decreasing Phase 2 | Same as Decreasing Phase 1 | Similar to the beginning, the pattern begins to decrease and at this point there is no recovery. |
This pattern would be the average one in opinion. The returns are pretty good with ability to cap out at double profit. Likely a pattern that most people will be seeing.
At first this may look like a decreasing pattern. But keep an eye out! Remember that a decreasing pattern will keep decreasing every day. If at any point your decreasing pattern increases you may not only be looking at a Small Spike but potentially a Large Spike as well.
With a Small Spike the highest potential return on investment is 200%.
Remember to sell on the fourth consecutive increase as this will always be the highest it goes! See Increasing Phase in the Algorithm table above to understand why.
Given the patterns above we know the following
This is discovered by looking at the Small Spike Pattern. We know our lowest buying price from Daisy is 90 Bells. Let’s make that our new base price. The final phase of the Small Spike Pattern is a Decreasing Phase. The lowest possible starting point is 40% of your base price. The Decreasing Phase can last as long as 6 days. Now we follow the steps. When following, keep the formula below in mind. Note that percentages are defined as a decimal between 0.0 and 1.0. So 40% would be 0.4.
sell price = base rate * base price
The highest possible price is an easier calculation. We know that the highest percentage spike observed in any pattern is 600% in the Large Spike Pattern. So we simply take the highest sell price from Daisy at 110 Bells and multiply it by 6 to give us the highest possible range of buying to be 660 Bells.
Currently, time travelling forward will not spoil your turnips but time travelling backwards any amount will spoil turnips. Additionally as of patch 1.2.0a, it has been found that time travelling backwards any amount of time results in a new price being generated immediately. For example, if you had a high price of 600+ the previous method for holding that price indefinitely was to continuously time travel back within the time frame that it appeared. Now, travelling backwards even 1 minute will generate a new price and likely also generate a new pattern as a deterrent for time travelling.
The effects on the pattern itself have not been researched in depth but if anyone would like to participate in research please feel free to contact me either on Reddit or Discord.
Date & Version (dd/mm/yyyy) | Description |
03 - 05 - 2020 v1.2.1 |
|
23 - 04 - 2020 v1.2.0 |
|
11 - 04 - 2020 v1.1.2 |
|
06 - 04 - 2020 v1.1.1 |
|
02 - 04 - 2020 v1.1.0 |
|
02 - 04 - 2020 v1.0.2 |
|
01 - 04 - 2020 v1.0.1 |
|