[{"data":1,"prerenderedAt":435},["ShallowReactive",2],{"project-kmm":3},{"id":4,"title":5,"body":6,"description":13,"draft":421,"extension":422,"meta":423,"navigation":424,"path":425,"seo":426,"sortOrder":427,"stem":428,"tagline":429,"taglineMobile":430,"thumbnails":431,"titleColor":16,"__hash__":434},"work\u002Fwork\u002Fkmm.md","Market Maker",{"type":7,"value":8,"toc":418},"minimark",[9,17,25,35,41,60,65,70,76,93,96,101,111,117,122,128,178,184,189,193,217,232,242,252,262,268,273,276,281,286,300,306,309,331,345,373],[10,11],"hero-image",{"alt":12,"href":13,"src":14,"subtitle":15,"title":12,"title-color":16},"Market Making on Kalshi","","\u002Fimages\u002Fwork\u002Fkmm\u002Fv2_flux_abstract_1920x1080.png","An AI-operated trading experiment","light",[18,19,21],"title-block",{"subtitle":20},"Developed through live experimentation and iteration.",[22,23,24],"p",{},"I built an AI-powered trading system that earns real money on prediction markets.",[26,27,28],"side-note",{},[22,29,30,34],{},[31,32,33],"strong",{},"TLDR",": An AI-operated trading system that earns real money on Kalshi's prediction markets. I planned the architecture, direct operations from a Telegram thread, and approve every market; Claude wrote the code and runs it day to day, quoting markets to earn the platform's liquidity incentives. Seeded with $650, it has returned +$1,081.93 over 16 weeks (+166%, fees included). A solo project in a domain I had no background in, live within two days of the first line of code.",[18,36,38],{"subtitle":37},"Kalshi pays traders to provide liquidity.",[22,39,40],{},"The Opportunity",[42,43,44],"text-block",{},[22,45,46,53,54,59],{},[47,48,52],"a",{"href":49,"rel":50},"https:\u002F\u002Fkalshi.com\u002F",[51],"nofollow","Kalshi",", a popular prediction market platform, runs a ",[47,55,58],{"href":56,"rel":57},"https:\u002F\u002Fhelp.kalshi.com\u002Fen\u002Farticles\u002F13823851-liquidity-incentive-program",[51],"liquidity incentive program"," that pays traders to rest orders on the book, even if those orders are never filled. For a given market, Kalshi establishes a reward pool with a cash value and a time period. It scores each trader over that period, tracking how large their orders are and how close they sit to the best price. When the period ends, traders are ranked by score and paid relative shares of the pool. These payouts, known as \"liquidity rewards\", are a subsidy for resting orders at or near the best price. Traders who place such orders are, generally speaking, \"market makers\".",[61,62],"image-gallery",{":columns":63,":images":64},"1","[{\"src\":\"\u002Fimages\u002Fwork\u002Fkmm\u002Fannotated-orderbook.png\",\"alt\":\"Annotated Order Book\"}]",[26,66,67],{},[22,68,69],{},"Kalshi also runs \"volume rewards\" that are a separate reward pool. This program scores your proportion of actually-executed trades during a time period. The more your orders on the book are actually filled, the more you earn from volume pools. In this project I focus mostly on liquidity rewards, since Kalshi offers them more widely and frequently.",[18,71,73],{"subtitle":72},"How does it work?",[22,74,75],{},"Market Making",[42,77,78],{},[22,79,80,81,86,87,90,92],{},"In its simplest form†, a market-making strategy does not \"take a side\" or try to predict if the price will change, but rather places orders on both sides of the book. By simultaneously buying and selling, market makers attempt to capture the \"spread\" between the best sell price and best buy price. Ultimately, a maker provides liquidity to a market, which ",[47,82,85],{"href":83,"rel":84},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMarket_maker",[51],"\"stabilizes the market, reducing price variation\"",".\n",[88,89],"br",{},[88,91],{},"\nImagine a stock that is worth $50 per share. Traders selling the stock are \"asking\" $51 for it, while buyers are \"bidding\" $49. A market maker would place a sell order for $51, and simultaneously place a buy order for $49. Some trader decides to sell their stock, and hits the maker's buy order. The market maker is now holding a share of the stock and is -$49 cash. However, another trader comes forward and wants to buy the stock at the $51 sell order price††. This is executed, and the maker is left with no stock but +$2. This is spread capture: the basic goal of market making.",[61,94],{":columns":63,":images":95},"[{\"src\":\"\u002Fimages\u002Fwork\u002Fkmm\u002Fspread_capture_three_steps.png\",\"alt\":\"Spread Capture in Three Steps\"}]",[26,97,98],{},[22,99,100],{},"† Complex market-making strategies do in fact estimate a fair price, and use it to \"skew\" or inform their order placement (e.g. loading up more orders to buy than sell if the price is more likely to move up). Sophisticated institutional market makers can be expected to employ a myriad of advanced strategies beyond \"quote buy and sell, capture the spread\", but that is the basic mechanism.",[26,102,103],{},[22,104,105,106,110],{},"†† If a stock is trading around $50, why would the other traders sell the stock for $49 or buy it for $51? Generally, one could say the \"wrong\" price ",[107,108,109],"em",{},"is"," the right price to that trader. They may be less informed about its true price, more informed about it, or simply paying a small premium for immediacy.",[18,112,114],{"subtitle":113},"Full-stack dev... not a quant?",[22,115,116],{},"Motivation",[42,118,119],{},[22,120,121],{},"I had been wanting to work on an automated market-making strategy for a few months, and Kalshi's incentive program caught my attention. First, prediction markets are an emerging financial frontier, and I assumed the barrier to entry would be lower than in well-established financial markets. Second, the existence of the liquidity incentive program gave the project a higher chance of some success (or a higher chance of smaller losses). I have no formal background in financial markets or quantitative analysis, but I have general financial literacy and know my way around some code. LLMs had been supercharging my dev work for months, but I wanted to see if I could use them to develop a project in an area that I knew nothing about.",[18,123,125],{"subtitle":124},"Two days of paper trading changed the goal.",[22,126,127],{},"Initial Research",[42,129,130,144,154],{},[22,131,132,133,135,137,138,143],{},"I ran two days of simulated paper trading. I used a Python script to scan for markets with the largest $\u002Fday pools, track price movement, snapshot the order book, and loosely simulate how a simple strategy (e.g. quote best bid\u002Fask symmetrically no matter what) would perform. At the end of this data collection, I had a script score my orders and track my PnL from trading activity.\n",[88,134],{},[88,136],{},"\nThe results were encouraging. Even with extremely pessimistic adjustments (to account for ",[47,139,142],{"href":140,"rel":141},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAdverse_selection",[51],"adverse selection"," and simulation error), I concluded this project would be well worth my time to develop. Key takeaways:",[145,146,147,151],"ul",{},[148,149,150],"li",{},"Liquidity rewards were a massive target (Kalshi offering ~$30,000\u002Fday across all markets at that time).",[148,152,153],{},"A simple strategy with minuscule capital will not make a meaningful profit from spread capture alone (my simulation showed losses across every market anyway).",[22,155,156,157,160,161,164,165,168,169,171,173,174,177],{},"This honed my profitability thesis. Liquidity rewards were ",[107,158,159],{},"not"," just a safety net and added bonus on top of spread capture: ",[31,162,163],{},"they were the main goal",". I think about it like this: spread capture is a ",[107,166,167],{},"hard"," problem. Multi-billion-dollar firms work to figure out how to do it. In the short term, it is unlikely I would develop an advanced market-making strategy that is able to meaningfully profit with self-funded capital amounts.\n",[88,170],{},[88,172],{},"\nThe problem was no longer market making to capture spread. My goal was to ",[31,175,176],{},"capture liquidity rewards while minimizing losses from trades",".",[18,179,181],{"subtitle":180},"Four layers, built AI-first.",[22,182,183],{},"The System",[42,185,186],{},[22,187,188],{},"Under the hood, it's a Python project with four layers, designed around an \"operator\" who runs analysis, approves markets, and initiates trading. The operator is Claude. The system allows any agent, LLM or human, to act as operator, but I have Claude run it day to day. The architecture:",[61,190],{":columns":191,":images":192},"2","[{\"src\":\"\u002Fimages\u002Fwork\u002Fkmm\u002Ftrading_program_architecture_v2.png\",\"alt\":\"Trading Program Architecture\"},{\"src\":\"\u002Fimages\u002Fwork\u002Fkmm\u002Ftelegram_remote_control_flow_v3.png\",\"alt\":\"Remote Control Flow\"}]",[42,194,195],{},[22,196,197,200,202,203,205,207,208,211,212,214,216],{},[31,198,199],{},"Research \u002F Analysis",[88,201],{},"This suite of tools scans markets and evaluates which are viable for my strategy. It deliberately stops short of a final \"score\" and instead reports comprehensively on numerous variables, highlighting quantitative signals. The operator considers this analysis, and other qualitative factors, to decide the safety and profitability of a market.\n",[88,204],{},[88,206],{},"\nClaude acting as operator is clearly indispensable in this process. It allows efficiency at scale, but specifically enables ",[107,209,210],{},"qualitative"," reasoning at scale. This is extremely important for assessing a market's viability. An example: in my experience, some lesser-known niche events have extreme mispricings due to very low volume. There are not many people trading the event, so the \"true\" market price has not been discovered. Quantitatively, these markets can present as safe and profitable. However, a quick web search would reveal that this market is trading far from reality, and the price is likely to swing.\n",[88,213],{},[88,215],{},"\nConfirming an event's general probability is difficult to do with Python alone, and essentially impossible across thousands of nuanced, unrelated events. However, it is not difficult for an LLM to do research and reason generally as a sanity check.",[26,218,219],{},[22,220,221,222,227,228],{},"I came to this pattern through my own trial and error, and later found ",[47,223,226],{"href":224,"rel":225},"https:\u002F\u002Fkalshi.com\u002Fresearch\u002Fmission",[51],"Kalshi Research"," describing a similar one: they improved a trading strategy with \"an LLM-based semantic stage\" to assess \"whether the proposed direction admits a plausible economic transmission mechanism based on event descriptions\". ",[47,229,230],{"href":230,"rel":231},"https:\u002F\u002Farxiv.org\u002Fabs\u002F2602.07048",[51],[42,233,234],{},[22,235,236,239,241],{},[31,237,238],{},"Strategy",[88,240],{},"The strategy layer is where I set the tuning knobs for each market. Using the results from research, I set variables such as capital limits, safety parameters, and more. This separates financial decisions from bot execution.",[42,243,244],{},[22,245,246,249,251],{},[31,247,248],{},"Orchestration",[88,250],{},"This layer turns a group of independent market bots into a supervised portfolio. It enforces portfolio-level safety, survives restarts, auto-manages the market lifecycle, and exposes controls to the operator during live trading.",[42,253,254],{},[22,255,256,259,261],{},[31,257,258],{},"Execution",[88,260],{},"One asyncio task per market. Each execution instance owns one market end to end: its resting orders, its position, its per-market safety, and its cycle loop. The loop checks safety, fetches new order book information, makes decisions based on strategy, and logs metrics.",[18,263,265],{"subtitle":264},"Claude runs the desk.",[22,266,267],{},"The Operator",[42,269,270],{},[22,271,272],{},"A typical session starts from my phone. Over Telegram, I ask Claude for a status report: which markets we're in, how much capital is deployed where, and how each position is doing. Depending on the answer, I have it adjust a market's parameters, or kick off the analysis pipeline. The pipeline runs quantitative research on candidate markets, then Claude layers on qualitative research: web searches on the actual event behind each market, sanity-checking that the price reflects reality. It reports back with a summary and a suggested strategy per market. I approve or reject every market before capital is deployed.",[61,274],{":columns":63,":images":275},"[{\"src\":\"\u002Fimages\u002Fwork\u002Fkmm\u002Fmarket_approval_funnel.png\",\"alt\":\"Market Approval Funnel\"}]",[42,277,278],{},[22,279,280],{},"This is the remote control flow diagrammed above. Claude operates with full permissions. It can open and close positions manually, start and stop individual market bots, and kill the whole system if needed. It messages me when it needs clarification, when something is beyond its control, or simply to summarize what it has done. By capability, Claude can do nearly everything I can; by convention, new capital always waits for my approval. In practice, I run a live trading operation from a chat thread on my phone.",[42,282,283],{},[22,284,285],{},"That autonomy is bounded by code, not trust. The system enforces hard limits regardless of what the operator asks for: a capital cap per market, a capital cap across the portfolio, a portfolio-level max loss, and automatic halts when API errors accumulate. Claude decides freely inside that box, but the box is not negotiable.",[42,287,288],{},[22,289,290,293,295,296,177],{},[31,291,292],{},"Built with AI, not just run by it",[88,294],{},"The first live trade happened roughly two days after the first line of code was written. I planned the system with Claude and directed the architecture; Claude Code wrote all of it. I did not write the code by hand. More on how I work in ",[47,297,299],{"href":298},"\u002Fwork\u002Fhow-i-use-ai","How I Use AI",[18,301,303],{"subtitle":302},"+166% on seed in 16 weeks.",[22,304,305],{},"Results",[61,307],{":columns":191,":images":308},"[{\"src\":\"\u002Fimages\u002Fwork\u002Fkmm\u002Ftrading_results_summary.png\",\"alt\":\"Trading Results Summary\"},{\"src\":\"\u002Fimages\u002Fwork\u002Fkmm\u002Fresults-summary-16x9.png\",\"alt\":\"Results PnL\"}]",[42,310,311,320],{},[22,312,313,316,317,319],{},[31,314,315],{},"PnL so far: +$1,081.93"," (fees included†)\n",[88,318],{},"\nOver 16 weeks of live trading I have maintained a steady (albeit modest) profit. The system was seeded with $650 of my own capital, and profits have been recycled back in as trading capital ever since. That makes the PnL so far a +166% return on seed. The gains are unimpressive in absolute terms, but the costs of the project are low:",[145,321,322,325,328],{},[148,323,324],{},"Minor risk in actual dollars: $650 of seed, with downside bounded by hard loss caps",[148,326,327],{},"Usage of my Claude subscription (which I would have anyway, even without this project)",[148,329,330],{},"$10\u002Fmonth for a cloud server",[26,332,333],{},[22,334,335,336,341,342,344],{},"† Generally, Kalshi ",[47,337,340],{"href":338,"rel":339},"https:\u002F\u002Fkalshi.com\u002Ffee-schedule",[51],"only charges fees"," to takers (orders that immediately match and execute on the order book) and ",[107,343,159],{}," makers (orders that rest on the book). Since I was mostly placing resting orders, most of my trading was fee-less. However, my bot did incur some fees as a taker when it crossed the spread to buy\u002Fsell for strategic and safety reasons.",[42,346,347,352],{},[22,348,349],{},[31,350,351],{},"Takeaways",[145,353,354,361,364,367],{},[148,355,356,357,360],{},"The thesis held: liquidity rewards were the main source of profit. My gains were liquidity incentives ",[107,358,359],{},"minus"," losses from adverse selection. With a naive spread capture strategy, most round-trip trades lost money; the rewards more than covered them.",[148,362,363],{},"This strategy is neither reliable nor sustainable. The liquidity incentives program exists at Kalshi's discretion and serves their business goals. If they decided to reduce the program, change the requirements, or end it entirely, this bot would not be profitable. Some weeks were less profitable entirely because Kalshi had fewer reward pools active.",[148,365,366],{},"However, assuming the program continues in a similar form, there are many achievable improvements to increase PnL within the current strategy.",[148,368,369,372],{},[31,370,371],{},"AI continues to be useful, productive, and essential to my development work."," This project would not have been possible for me to develop effectively in a short period of time without it.",[42,374,375,383,410],{},[22,376,377,380,382],{},[31,378,379],{},"Next Steps",[88,381],{},"\nI have numerous improvements planned for the bot in its current paradigm:",[145,384,385,388,391,399],{},[148,386,387],{},"enhanced position management",[148,389,390],{},"deep research and modeling of markets for better quoting",[148,392,393,394],{},"implementation of ",[47,395,398],{"href":396,"rel":397},"https:\u002F\u002Fpeople.orie.cornell.edu\u002Fsfs33\u002FLimitOrderBook.pdf",[51],"academically rigorous algorithms",[148,400,401,402,407,408],{},"an extended API layer to access other prediction market platforms such as ",[47,403,406],{"href":404,"rel":405},"https:\u002F\u002Fpolymarket.com\u002F",[51],"Polymarket"," (they have a similar incentives program)\n",[88,409],{},[22,411,412,413,415,417],{},"However, given that the profit model is reliant on subsidy programs, I would like to move towards an actual spread capture strategy for the long term. I am beginning to explore advanced strategies that will lead in this direction. I will take much of what I've developed here and apply it to this new iteration. As long as they exist, liquidity rewards will guide my market selection, even as I move towards a strategy that does not totally rely on them.\n",[88,414],{},[88,416],{},"\nI have no delusions about breaking into mainstream financial markets as an independent market maker. However, I will continue developing strategies in the emergent realm of prediction markets, pursuing experience and small returns along the way.",{"title":13,"searchDepth":419,"depth":419,"links":420},2,[],false,"md",{},true,"\u002Fwork\u002Fkmm",{"title":5,"description":13},3,"work\u002Fkmm","Paid to Rest",null,[14,432,433,432,433,432,433],"\u002Fimages\u002Fwork\u002Fkmm\u002Fkalshi-logo-dark-green-on-primary-green-1.jpg","\u002Fimages\u002Fwork\u002Fkmm\u002Fkalshi-logo-white-on-near-black.jpg","ht3hvKtwtk0lm4agHJHoGdAUnwjuOzSeF8XkzeajB-Q",1786328999022]