Beating Jane Street at their own game
What I learned building a Figgie bot that beat Jane Street’s Hard bots.

Introduction #
Figgie is a trading game by Jane Street. Four players each put $50 in the pot and are dealt ten cards from a 40-card deck. One suit has 12 cards, two have 10 and one has 8, and nobody knows which is which, you have to guess what is the 12-card suit. The suit of the same colour as the 12-card suit is the goal suit. So if there are 12 clubs, there are either 10 or 8 spades, and that’s the goal suit.
For four minutes, anyone can bid for or offer any suit, and anyone can take a bid or an offer. When the round ends, each goal-suit card pays $10 from the pot, and whoever holds the most goal cards takes the rest: $100, or $120 when the goal suit has eight cards.
Read more on figgie.com/how-to-play.
Illustration made with Claude
At its core, it’s really just a game of imperfect information, just like the stock market. Your hand may hint at which suit has 12 cards; if you have 1 spade, 5 clubs, 2 hearts and 2 diamonds, based on those cards, it’s more likely that the goal suit is spades.
You can’t know that for certain, though. It could be that the other players have 5 clubs combined, and the goal suit is actually hearts, for example. That is where the trading comes in; every bid, offer, and trade gives some information away. A good player counts cards, reads the market, and trades on their own conviction faster than others.
Two weeks ago, I started playing the game, and quickly was able to beat the hard bots for a modest average profit (~$20-30 per round). I had done some coding before, so I figured I could vibe-code a bot that could beat them more efficiently. The strategy is about 4,400 lines of Python, plus a 2,900-line JavaScript version that runs in the browser. It took 15 versions of the bot, where I kept looking for leaks in the bots’ strategies and my own strategy.
Next I’ll go over the history of developing a winning trading bot and what I learned along the way.
v1: great at statistics, horrible at trading #
v1 started by doing the maths right. It updated its probabilities for all 12 decks on every trade, valued each card from them, and made markets around those values, bidding a little below and offering a little above.
Calculating those percentages is only one half of the story, though. It still sucked at trading. When v1’s bid was hit, it was usually because the seller knew the suit was dead. Similarly, when the other bots bought from it, the buyer usually knew it was the goal.
→ This is what’s known as adverse selection, which is one of the central risks of being a market maker even if you can come up with very accurate bids and asks with the data available to you. The trades you get are the ones the other side wanted. v1 ignored the information that the trades conveyed, so it actually lost money to adverse selection and inventory risk. It lost $261 over nine rounds.
The fix: Listening to the market #
Realizing this fundamental flaw, I redesigned it to analyze the other players better. v2 treats the highest price anyone bids or pays for a suit as a vote that it’s the goal, and a low offer as a vote against. It also stopped being eager. Its bids start low and climb a dollar every three seconds, and it takes someone else’s quote only with a 20% edge. v2 made $25 a round.
However, it sold its cards too early, before the market had revealed the goal. v3 was more patient with its trading, realizing that there is time value in holding a card. A spade may seem worthless in the beginning if hearts bid for high amounts, but may in fact be the goal suit. It’s kind of like theta in options. v3 only sold when a bid beat the value of keeping the card, including the option value of waiting for the market to reveal the goal. It was the first version with a statistically clear profit: $42 a round, with eight of ten rounds in profit.
I kept iterating, learning from the bots’ past mistakes. By v6, I had run enough sample rounds to fit the signal instead of guessing it. Jane Street’s bots bid $10 to $15 for dead suits all the time, so only bids above about $17 really single out the goal. v7 scores bids that way. It also counts a bid only once it has stood on the book in two different seconds, so a bid flashed and cancelled can’t move it. That’s kind of like spoofing in real markets, where some players trick the algorithms by placing large orders they plan to cancel before they fill (highly illegal market manipulation btw), and I wanted to be protected against it (it’s not illegal in a trading game with fictional money :D)
v8 found the strongest signal. Every Hard bot bids the goal suit up at some point in a round, while a dead suit usually draws a big bid from only one of them. So the lowest of the three bots’ top bids for each suit is a near-perfect tell: in ten rounds it was $7 to $10 for the goal and $3 to $6 for every dead suit. One bluffer can’t fake that.
The probabilities vary vastly in every round, and are constantly updated with every new bid, offer, and trade.
From v8 on, the bot was at least 90% sure of the right suit by the bell in most rounds.
Then came the surprise. v8 finished every round with the right suit as its favourite, at 97% on average against v7’s 74%, and its profit didn’t move: $33.50 a round, inside the noise of every version since v3. Knowing the answer at the bell is worth very little. The money is made in the first two or three minutes, while the answer is still uncertain. v9 attacked that window from the other side: early in a round, whoever buys from the bot probably knows more than it does, so its offers are priced as if the buyer does.
Chasing the sixth card #
With a 10-card goal suit, five cards can only tie for the majority, and six win it. The bot kept stopping at five, and the other bots kept collecting the strays: in seven rounds of v3 and v4 the bonus was split 5-5, leaving $350 on the table. So v5 valued the bonus as if a rival would end up with every goal card the bot lacked, which made the sixth card worth chasing. Think about it: if the goal suit has 10 cards, five cards and a 5-5 split get you $100, while six get you $160. Of course, the goal suit may also have 8 cards, so 5 cards would already be the majority. The bot has to take the probability that the goal suit is 8 cards into consideration, too.
v5 got the sixth card twice, but the same assumption made small holdings look worthless, so it sold the goal cards it was dealt, cheaply: $16 a round, my worst version since v1. v6 kept the idea only for when the bot already holds half the goal suit, and took the whole bonus in 5 of 10 rounds.
An exploit hiding in the logs #
From v9 on, the bot logged every quote and trade. Reading the logs turned up a habit of Jane Street’s bots. When a bot offered or sold a card for $1 or $2, another bot usually bid the same suit back up to $4 or more, typically 11 to 12 seconds later. It made no sense to me, so I added a feature that is quite literally “buy low, sell high.” For whatever reason, the bots sell some ‘dead’ cards for super cheap, but end up buying them back. They should have 0 value, assuming that all the bots have the same opinion of the goal suit (definitely not a given!)
v10 buys those cards and resells them. Being wrong about a pattern like that is the real risk, but in my test runs, the inventory risk of ending up owning worthless suits when the bell rings was far outweighed by the profits of reselling those for a higher price. The bot holds only a few unsold cards at a time, counts its own resales double when it judges the pattern, and shuts the exploit off for the round after two net failures or $6 lost.
Live, it worked from the first round. Resale made $73 over v10’s ten rounds, $153 over v11’s, $203 over v12’s and $163 over v13’s, across more than 300 resales, none of them sold at a loss. That is just pure profit made from the bots’ irrationality.
I wanted the bot to find the pattern itself. v12 replaces the hand-written rule with a learner. Every offer another player shows at $5 or less is a question the tape answers within seconds: had the bot bought that card, would someone have bid $2 more for the suit within 45 seconds? So every offer at the table is a labelled example, not only the bot’s own trades. An online Bayesian logistic regression learns the answer from generic features such as the price, the time left, recent bids and the seller’s recent offers. Starting from nothing, it rediscovered “$2 or less resells” within its first live round, and that became its strongest feature. At figgie.com that only matches the rule I’d found by hand. The point is the next table, where the rule is wrong: the learner adjusts and the rule doesn’t.
Fighting against overfitting #
To make sure I’m not just overfitting against these specific bots, I wrote my own bots that tried various patterns to try to exploit my bot. Up to v12 the simulator’s opponents were mostly benchmarks the bot was built to beat. For v13 I wrote opponents built to beat it: a spoofer that flashes big bids on dead suits, rings that fake the resale pattern, a “pump” ring that trades a dead suit among itself at $18 so the tape shows everyone paying up, a sniper, a front-runner, a buyer that never shows a bid, and one that learns what the bot will pay. A test bench, the arena, plays every change in paired sessions at 21 tables, with separate seeds for tuning, choosing and reporting. It scores a change by half its average gain and half its gain over the worst quarter of tables, so a change has to help broadly.
The pump ring took $63 a round: the bot was 98% sure of the decoy after 30 seconds. So v13 learns at every bell, from the revealed goal, how far to trust each of its market readings at this table, and a signal that lies there fades within a round or two. That fixed the belief but not the money. Three colluders who know the goal still take about $60 a round, because they sell the bot dead cards and buy its goal cards whatever it believes. With its market reading switched off entirely, it loses about as much. Some opponents can’t be beaten, and it helps to know which.
In developing the bot, I ran a grand total of 142 live rounds against Jane Street’s bots: +$6,958 in play money, $49 a round on average. Every live test since v3 has been profitable. Over the last 41 rounds (v11 to v13.3) it averaged $81 a round, ±$18 at 95% confidence, with 34 of 41 rounds in profit.
How it works now #
There are 12 possible decks, so the bot constantly uses Bayes’ rule (how likely its own hand is under each deck, times how likely everything the market has shown is). Adding up the decks by goal suit gives its probability that each suit is the goal.
Then it values every card: $10 times the chance its suit is the goal, plus what the card does to its share of the majority bonus, given everyone’s likely holdings. And it trades on those values: it takes a bid or offer only when the gain beats $1 plus 20% of the card’s value, and it never sells a card for less than the value of waiting for the market to reveal the goal.
Three parts of the bot are Bayesian: the deck probabilities above, and two learners that update as it plays.
- The reading learner decides which market signals to trust. After every round it checks each signal, such as “the suit every bot bids up is the goal”, against the goal that was revealed, and updates its trust in it by Bayes’ rule. Signals that mislead count for less.
- The resale learner decides which cheap cards to buy. It’s a Bayesian logistic regression: every cheap offer on the table is a yes-or-no example (did someone bid the suit back up within 45 seconds?), and it updates after each one. The bot buys only when even a cautious estimate says the resale pays. That’s how it found the “$2 or less resells” rule by itself, in its first round.
One real moment from a live round, 3:17 in: what the bot saw, what it concluded and what it did in the next three seconds. The parts marked Bayes are the Bayesian ones.
What I learned #
-
Adverse selection. Always in trading, there is the risk that your counterparty knows something you don’t. Perfect arithmetic on your own information loses to people trading on theirs, if that information is better. Before asking what a card is worth, ask why someone is willing to trade it with you.
-
Bids, offers, and trades are information. The biggest gains came from reading other players’ bids, and the cleanest signal came from looking at the bids player by player instead of pooled. There are different players in the market with their own information, which may be vastly different from your information. Use their trades as information.
-
“Everybody has a plan until they get punched in the mouth” - Mike Tyson. Just running those calculations isn’t the key to making profits; you need to be able to trade on it and adapt quickly if your forecast is wrong.
-
Separating noise from actual results. Ten live rounds can’t tell a $10 improvement from luck. Paired simulations, replays of logged rounds and keeping separate data for tuning and for testing paint a better picture.
-
Trading games are fun! I still really enjoy playing it and even watching my bot play.
How I built it #
I have made some smaller programs when I was younger, but with this project I knew that I don’t have the programming skills yet to do anything of this scale.
I vibe-coded this with Claude Code. It wrote most of the code and ran the simulations and live tests. My involvement was looking at what mistakes the bots were making, how my bot responded to those, and thinking of ways to exploit them. Reselling dead suits and becoming more unexploitable were my ideas, which turned out to be great. Working this way made it fast. Of course, it’d be great to be able to program these things myself, but I think that the whole paradigm of software development is coming closer to a model like this where the human just provides ideas and reasoning to the AI, and the AI implements them.
Developing it, going back-and-forth, took around one week. The most time-consuming part was coming up with ideas on how to extract more and more value (alpha?) from the bots. Some time went to making sure that the trade execution worked and that the bot could run autonomously.
See it for yourself! #
The code, every live round and the analysis tools are on GitHub at github.com/RasmusCodes/figgie-bot, under the MIT licence. If you run the userscript, keep it to private tables against figgie.com’s bots, and check the site’s terms first.
I am not affiliated with Jane Street (yet 😒) in any way. I do have a Jane Street T-shirt from one of their info sessions I attended, and I solved their monthly puzzle :D