Back in 2012 I got into daily fantasy baseball, and like a lot of people with an Operations Research degree and a little too much free time, I couldn’t just play. I had to model it. That turned into an Excel spreadsheet that picked my lineups for me, which a few years later turned into a small side business selling those spreadsheets on Fiverr, which then sat untouched in a folder for the better part of a decade. This summer I finally dragged it back out and rebuilt it as a free lineup optimizer that runs in your browser at mlb-lineup-optimizer.kindoflost.com. This is the story of how it got here, and the first post in a short series about the rebuild.

2012: I couldn’t just play, I had to model it
Daily fantasy is, underneath the jerseys and the trash talk, a math problem. You get a salary cap and a set of roster slots, every player has a price and a projected number of points, and you have to pick the lineup that scores the most without going over budget. The first time I saw that, my brain didn’t see baseball. It saw a knapsack problem — the classic “fit the most value into a fixed-size bag” puzzle I’d spent years on in school and at work. I’d actually written about that exact problem here before, when I modeled the electoral college as a knapsack problem. A fantasy lineup is the same shape, just with bats instead of electoral votes.
So I did what came naturally: I built it in Excel. Player pool on one sheet, the salary cap and roster rules as constraints, and Excel’s Solver grinding out the highest-scoring legal lineup. It worked. It was also slow, fragile, and held together with the kind of macros only the person who wrote them could love. But it picked better lineups than I did by hand, and that was the whole point.
2016: people wanted the spreadsheet, so I sold it on Fiverr
At some point I mentioned the spreadsheet to other people who played, and the reaction was always the same: “can I have that?” So I cleaned it up, added a few options, and started selling it as a gig on Fiverr. People would tell me their sport and their site — baseball on one site, football on another — and I’d hand back a customized Excel workbook with the salary caps, the roster slots, and the scoring baked in.
The most useful thing I learned in that period had nothing to do with optimization. It was that almost nobody actually wants the math. They want the lineups. They don’t care whether there’s a knapsack solver or a wizard behind the curtain — they care that they paste in their numbers and get back something they can use in thirty seconds. That lesson stuck, and it’s the reason the new version hides every bit of the machinery unless you go looking for it.
Selling those gigs taught me more about people than about baseball. Every buyer wanted something a little different — a different sport, a different site, a different scoring quirk — and the requests that came back were almost never about the optimization. They were “how do I paste my players in,” “can it do two pitchers,” “why won’t the macro run.” I spent more time on the wrapper around the model than on the model itself, which in hindsight was the whole lesson: the math is maybe ten percent of a usable tool, and the other ninety percent is making it painless for someone who doesn’t care how it works. I didn’t fully appreciate that at the time. I do now, and it shaped every decision in the rebuild.
Why I put it down
A few things lined up. The legal landscape around daily fantasy got messy for a while, life got busier, and — this is the unglamorous part — the tool simply rotted. It leaned on old Excel automation and an Internet-Explorer trick to mass-enter lineups, and when that didn’t always work it all became too time-consuming, so did a chunk of the workflow. To be honest, I also found it very hard to justify the investment of real money to compete with the “sharks” that have better resources, models, and knowledge of the sport than I did… So I stopped maintaining it and moved on to other models. The folder it lived in followed me from computer to computer for years without being opened.
2026: the rebuild, and why it’s free now
For the last while I’ve been doing something I should have started years ago: taking twenty years of Operations Research models out of dusty Excel files and putting them on the open web, one at a time. The free vehicle routing optimizer was one. The fantasy tool was the obvious next one to revive, partly because the season was on and I could test it against real games the same day.
The rebuild is a real web app now — Python doing the optimization instead of Excel’s Solver, running in your browser, no signup, no install, completely free. You upload the salary file you already download from your contest site, optionally paste in your own projections, set your rules, and it builds a set of lineups you can download and upload straight back. It does MLB for both major sites today, and the engine doesn’t actually care what sport it is, so the others are just a matter of time.
Here’s the part I find most interesting, and the reason this turned into a series rather than a single post. A single best lineup is the easy, solved part — every free tool can do it. The genuinely hard problem, and where all the real strategy lives, is building a set of lineups that are different from each other in smart ways: stacking correlated players together, controlling how often any one player shows up, keeping the group diverse. That’s the part the commercial tools treat as a black box, and it’s the part I want to actually explain.
What’s coming in this series
Over the next few posts I’ll walk through the whole thing in plain language: why a lineup is just a knapsack problem, an old trick I used in Excel to handle players who qualify at several positions (and why I retired it), how you go from one optimal lineup to a smart portfolio of them, what it took to port two-decade-old spreadsheets to Python, and a debugging war story from getting it live that cost me an entire day. None of it requires a math background — if you’ve ever set a lineup, you’ll follow it.
If you just want the tool and not the backstory, it’s right here: mlb-lineup-optimizer.kindoflost.com. It’s free, and it’ll stay free.
Things that I use, like, and am affiliated with:
Mint Mobile offers great cell phone service for $15 flat, get $15 off using the link. Get discounted phones with service activation and no contract.
I never spend money before I check Mr Rebates or Rakuten to get cashbacks, rebates, discounts, coupons or cheaper gift cards.
