Today we participated in @matchbox_dao 0xMonaco Battle of Titans! We as part of the @0xPolygon team took 2nd place against 12 opponents. In the end we lost to @Uniswap by a close margin. Let's dig into our strategy! (find our source code at the end)

How does the game work? 1. first car to reach 1000m wins 2. every car starts with 17500 coins 3. buy acceleration to get faster 4. buy shells and super shells to reset the speed of cars ahead

5. buy shields to protect against shells 6. buy bananas to protect against shells and slow down cars behind 7. the price of items increases for everyone when they are bought and decreases when not

Last week during tryouts we qualified for the Battle of Titans. We were doing well, but not as well as UniSwap, in fact no one even came close. Their car was an absolute beast. The following week there were countless matches in the training area. Uniswap didn't lose once

We analysed hundreds of matches and started improving our strategy, but UniSwap was still undefeated. Then it finally happened, yesterday UniSwap lost their first game ever. We analysed the race, looking for weaknesses and continued improving our car.

We worked on new strategies all night. At 7am in the morning we still haven't beaten UniSwap. Defeated, I uploaded the latest version and went to sleep. Next morning I woke up and there it was. We beat UniSwap 3 times (they defeated us in 6 other matches, but still a success)

While the semi-finals were still going on we were working on new strategies and finally, after over 40 failed versions, our last one finally beat UniSwap in the test area consistently. We had a chance

We uploaded this strategy for the finals, but unfortunately UniSwap updated their strategy one more time for the finals (what they haven't done for the past week) and we lost all 6 matches in the finals within 30m from the goal.

Let's have a look at our strategy. The first 900m are meaningless for the outcome. Everything comes down to the final 100m. Your economy is the most important part. You need most of your money until the very end. Here is our step by step guide to almost win a 0xMonaco tournament

1. Buy acceleration (duh) To get to the late game cheaply buy lots of acceleration when your opponents are not buying and vice versa. In early game (<900m) every round we bought speed for 60 coins, in late game for 500 coins.

2. Keep momentum Every round we would get rid of all bananas in our way as they halve your speed. Also when we didn't have a shield we bought one to protect against unexpected bananas and shells

3. Buy the free stuff! Whenever you can buy something for free, go for it, whether its useful or not. Buying free items will increase the price for your opponents

4. Win if possible sounds obvious, but we saw many instances where teams could've won if they had written the code for it. If you can afford enough speed to win the race, floor it.

5. Don't waste your money We had a lot of safe guards in place to not spend money unnecessarily. Don't buy a super shell if you already bought one. Don't buy multiple bananas per round. If the average price exceeds a predefined threshold, don't buy it.

6. The late game The late game is all about not letting your opponents win. Shell them if they are ahead of you. We noticed that buying bananas in this stage was useless, because when you were in the lead, a super shell was already on its way to get you.

7. The late late game When the first car enters 985m, the late late game started. Here we just spent everything we could on shells and acceleration to make sure we got the win. Seems crazy that most games were decided in their last 1.5%.

So finally, here is the source code of our car. Special thanks to @qedk_ for working on the strategies with me and @matchbox_dao for organising such a cool event. Our contratulations go out to @Uniswap! https://gist.github.com/gretzke/f7f3151693113cab9fe7e86b340477a9