IMC Prosperity 2 thumbnail

IMC Prosperity 2

May 3, 2024David Teather

Table of Contents

I recently competed in the IMC Prosperity 2 competition and I wanted to write a blog post about my experience as a first time competitor in a trading competition in addition to writing about some of the strategies I used for each round and how overall it turned out.

What is IMC Prosperity 2?

IMC Prosperity 2 is a competition where you trade virtual assets in a simulated market. There are multiple rounds and each round has a different set of rules and assets to trade. The goal is to make as much money as possible by the end of the competition.

The two main types of trading are algorithmic trading and manual trading. In algorithmic trading, you write a program that automatically trades assets based on certain rules. In manual trading, you manually make trades based on the information you have.

Round 1

Algorithmic Trading

We had two good one was an amethyst which was considered relatively stable at 10K so we just did a strategy to buy below and sell at or above.

We also had starfruit which were more unstable and varied often in prices and we just traded based on observed price change with respect to amethysts.

Manual Trading

The first round of the manual trading was pretty simple. We had to find two values between 900 and 1000 that would maximize our profits. We had an unkown amount of fish that would sell their gear to us at a linear probability from 0% at 900 to 100% at 100 and we were guaranteed to sell the gear at 1000 at the end of the round.

The first value you picked was your first bid which was the price you’d pay for any gear that was offered by fish which that willingness to sell or less and the second value was a higher price to capture more profit.

Our team calculated the value to be 952 and 978 but then we did some simulations and ran 950 and 980 as our final answers which got us tied for fourth with like 20 other teams but the optimal answer was 952 and 978.

At the end of this round we were

Round 2

Algorithmic Trading

This one was annoying we had to obsrve some conditions of an Orchid to determine the prediction time out of that. Honestly I did not have much time to work on this section so I just had a simple strategy implemented and did not bother understanding how to trade Orchids out. So to maintain a good score I just traded Amethysts and Starfruits again.

Manual Trading

This one was about finding the right conversion process to get the optimal outcome like converting through a few items to end up with the most seashells so we just wrote a program to iterate through all the possible combinations and find the best one.

At the end of this round we were

Round 3

Algorithmic Trading

This one was about trading different bundles. So we had a gift basket made up of

  1. Four CHOCOLATE bars
  2. Six STRAWBERRIES
  3. A single ROSES

We could not bundle these items together ourselves or break them apart so we had to just trade the items directly.

We ended up using a strategy on each of the items separately, and traded them based on the price jumps in some window period. For the baskets though we estimated the price of the basket based on a weighted sum of the individual items and bought/sell based on that.

I mentioned the profit we got from just this round in the Discord and I started getting DMs from people on top 250 to compare strategies so I think we did pretty well in this round.

Manual Trading

This section was actually really interesting. We were given a list of tiles below.

Treasure Map

So the base reward on each tile was 7.5K and the multiplier for each tile is different and the goal was to find the optimal reward when the reward is split between the number of hunters on that tile already.

For example the 100x tile’s reward to you would be 7.5K * 100 / (1 + 8). So your reward would be 83.3K since it’s split between you and the hunters.

The reason this is complicated is that for each 1% of the players that pick a given tile the number of hunters on that tile increases by 1. So you have to predict where the other players will go and try to go to a tile that has the least amount of players on it.

Some players tried to make spreadsheets to collect responses from other players to try to predict where they would go but we just wrote a program to simulate the game and pick the best tile based on that.

Finally the last interesting part is that each search you can do costs money. You can do 3 searches here are their costs.

  1. Free
  2. 25K
  3. 75K

There’s definitely no right strategy here but here’s what we were doing. We were hoping not everyone would act rational and we could hedge our bets a little bit here.

We assumed everyone would be playing optimally and then calculated the tiles with the highest EV from that assumption then randomized our picks a little bit. And ended up picking I26 and H29 which were around the 1st optimal and the 6th optimal based on if everyone else played optimally.

We thought that people might not play optimally if they assumed other people played optimally they’d pick different tiles and were hedging our bets that maybe people psych’d themselves out of playing optimally and picked the 1st optimal and also a lower optimal tile incase people were trying to pick the optimal one.

There’s no way to know if this was the right strategy since it relied on other people’s decisions.

At the end of this round we were

Round 4

Algorithmic Trading

This one was about trading coconut coupons which were analogous to options. We had to predict the price of the coconut at the end of the round and trade based on that.

We made a black scholes model to predict the price of the coconut coupons and compared it to the actual prices of the coupons to determine if we should buy or sell.

We did end up making a mistake in our model that actually ended up making a good amount of money but only really when the price was going down of the coconut coupon. We implemented a bug free version that was getting less money on the submission as a result of it.

Acknowledging that this was a mistake, however we essentially decided to gamble on this round because to have a shot at getting a prize we needed to catch up significantly to the top teams by a few 100Ks and we were not going to do that by playing it safe. The algorithm wasn’t losing too much money when it was going up in price because it was being subsidized by our very good result and algorithm from round 3 so we just decided to go for it.

Manual Trading

This time is was the same as the other manual trade where we had to optimize the price we’d pay for gear from fish. However in this one the first bid would be not changed and would work the same however the second bid the fish knew the total average of the bids and would sell if your bid was higher than the average and if your bid was below it would probablistically sell based on the difference between your bid and the average.

We picked 960 and 980. We wanted to get more profit from the first guess because we expected the second guess we’d make less money from because of the average.

Oh yeah during this round I also got recognized in the Discord chat from my GitHub profile picture 😭

Getting Recognized

But anyways, at the end of this round we were

Round 5

I barely participated in this one and it was just giving us access to who had done the trades in the past so you could infer trading side connections and stuff but we didn’t end up doing that.

Overall Results

Conclusion

This was my first time competing and learning about algorithmic trading and I had a lot of fun. I did use a lot of knowledge from the previous year’s code and writeups to help me out, but I’m most proud that the round that we did the best on and seemed competitive with the top teams was one of the rounds where I ended up writing the code from scratch.

I think I learned a lot about how to approach these problems and will likely compete in similar competitions in the future.

Hopefully people found this blog post interesting and if you have any questions about my strategy if you’re competing in the future feel free to reach out to me on LinkedIn

The code is also a mess but if you want to see it you can check it out here

Back to Blog