GitHub - kachence/polymm · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
kachence
polymm
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>1 Commit<br>1 Commit
analytics
analytics
sql
sql
src
src
tests
tests
.env.example
.env.example
.gitignore
.gitignore
LICENSE
LICENSE
README.md
README.md
pytest.ini
pytest.ini
requirements.txt
requirements.txt
View all files
Repository files navigation
polymm
The retired Python bot behind a public Polymarket wallet. It market-made on Polymarket's sports markets (esports and traditional) for a few months in early 2026 and finished up about $5k net, every trade on-chain at @b00k13. This repo is the actual code, plus the analytics I built to work out why the "guaranteed" strategy still bled money on the parts that were meant to be safe.
Most "I built a Polymarket bot" repos are a README and a dream. This one traded real money and leaves a public wallet you can reconcile it against. At some point it also mostly stopped being profitable, and the write-ups at the bottom are honest about why.
It was built almost entirely with AI, in my spare time. That's not an excuse for the quality. You may find bugs. There are certainly things to improve. But it's still the exact bot that I used and it could be a good basis for you if you want to get into Polymarket market making.
Read, learn, improve - not plug and play
I'm giving this away because the code was never the hard part. The edge was fresh odds and speed , and here both are on you:
This is the retired Python version . The bot I run now is a Rust rewrite and it's not in this repo.
The scrapers aren't included. The bot reads odds from a source you supply. It ships with a the-odds-api path - a public, paid API - and the private scraping pipeline that was half the edge is gone.
It got too slow to defend its edge, which is exactly why it stopped making money.
So treat it as a working foundation, not a money printer. The strategy is sound and the plumbing works. Whether it earns is down to what you bring: faster and fresher odds, sharper execution, tighter risk. Put the work in and it can pay. Run it as-is and you'll donate to quicker bots.
How it works
Cross-venue arbitrage, captured by market-making. In plain terms:
Get a fair price. Pull bookmaker odds (via the-odds-api) and strip the bookmaker's margin to a fair probability for each side. That fair value is the whole game, and it's only ever as good as your odds are fresh.
Quote it. Post limit orders on the matching Polymarket market, a cent above the best bid, only where there's enough edge between your fair value and the price (min_edge, 5% by default).
Hedge to lock the arb. When one side fills, place the opposite outcome so you own both sides of the match for under $1 a share. That's a profit locked in whoever wins.
The residual. You can't always get both legs. When one fills and the hedge doesn't, you're left holding a directional bet. Each of those went on at a 7%+ edge, so a book of them should be profitable. Working out why mine wasn't is the second write-up below.
Architecture
The bot (src/main.py) is a single async orchestrator running roughly ten concurrent loops. The pieces:
Layer<br>What it does
services/<br>Fetch and aggregate odds (odds_service, odds_api_service)
core/<br>De-vig maths, market parsing, team matching (vig_removal, market_parser, match_id)
scanning/<br>Compare fair value to Polymarket prices, find edges (opportunity_scanner)
execution/<br>Place orders, size hedges, track positions (order_executor, hedge_finder, order_watcher)
monitoring/<br>Watch for outbids and edge loss, chase hedges (hedge_seeker, order_monitor)
polymarket/<br>The two live websockets - fills (user_websocket) and order book (book_websocket)
state/<br>Match-level state and the reactive event system (bot_state, reactive_handler)
The reactive system is the interesting bit - when the fair value moves against a resting order, it emits an EDGE_LOST event and...