You write a strategy in Python (or any language) and run it on your own computer. It connects to a live 10-minute market over our API, and every bot — plus two house bots — trades the same order book. Orders match the instant they arrive, just like a real exchange.
Your profit is not the end of it. Everything you make becomes credits on a shared map where you hold a base: claim ground, raise farms and factories, train units, and take territory off your rivals. Best P&L wins the market. Most developed empire wins the world.
Opens a lobby and gives you a join code to share. Works solo — the bots are always on the other side.
Enter the six-character code from whoever set the run up.
Nothing you write runs on our servers — your strategy runs on your machine and only ever sends us orders. That means you can use any language, any library, and any amount of compute you like; the server is just the exchange.
algo_client.py) — plain standard-library Python, no
installs — and paste in your run id and API token.python algo_client.py. It polls the market, calls your on_tick, and
posts the orders you return.on_tick, re-run, iterate. Prefer another language? Hit the same REST endpoints
yourself.Every player who joins gets a base on a shared map, and one line of arithmetic decides what they can do with it:
credits = 2000 starting grant + your trading P&L + what your buildings earn - what you have spent
Trade well and the map opens up. Trade badly and the budget closes: credits floor at zero rather than going negative, so a losing run stalls your expansion but never takes back what you have already built. The map advances once every 5 seconds; production lands and units get their movement back on that beat.
Workers are the constraint that bites first. Food producers are staffed before anything else, so a shortage idles a factory rather than starving the farm feeding it, but a factory you cannot crew earns nothing at all.
| Building | Cost | Terrain | Workers | Produces | HP | What it is for |
|---|---|---|---|---|---|---|
| Farm | 120 cr + 20 mat | Plain | 1 | +5 food | 60 | Feeds workers. Plains only. |
| Lumber camp | 100 cr | Forest | 1 | +3 materials | 60 | Steady materials from forest. |
| Mine | 180 cr + 20 mat | Hills | 2 | +5 materials | 80 | The best materials income. Hills only. |
| Housing | 90 cr + 10 mat | Plain, Forest | 0 | — | 50 | Raises your population cap by four. |
| Market | 250 cr + 30 mat | Plain | 2 | +5 credits | 80 | Credits every tick, and claims the ring around it. |
| Factory | 400 cr + 60 mat | Plain, Hills | 3 | +10 credits -2 materials | 100 | The big earner. Eats materials, pays credits, needs three workers. |
| Barracks | 300 cr + 40 mat | Plain, Hills | 1 | — | 120 | Required before you can train soldiers, cavalry or cannon. |
| Fort | 350 cr + 80 mat | Plain, Forest, Hills | 1 | — | 240 | Hard to crack, and stiffens the tiles around it. |
Your base cannot be built or demolished. It claims the ground around it at the start, and losing it puts you out of the world game.
| Unit | Cost | HP | Attack | Defence | Move | Workers | Needs | What it is for |
|---|---|---|---|---|---|---|---|---|
| Explorer | 60 cr | 20 | 2 | 3 | 3 | 0 | — | Cheap and quick. Claims any unowned tile it stands on. |
| Settler | 200 cr + 20 mat | 30 | 0 | 4 | 1 | 1 | — | Spend it to claim a two-tile radius anywhere you can reach. |
| Soldier | 100 cr + 15 mat | 50 | 12 | 10 | 1 | 1 | Barracks | The line unit. Cheap, tough, slow. |
| Cavalry | 240 cr + 40 mat | 70 | 22 | 12 | 2 | 1 | Barracks | Hits hard and covers ground. Good for raiding. |
| Cannon | 320 cr + 70 mat | 45 | 34 | 6 | 1 | 2 | Barracks | Double damage to buildings, and folds fast if caught in the open. |
| Ground | Move cost | Defence bonus | Notes |
|---|---|---|---|
| Plain | 1 | — | Builds almost anything. The only ground a farm or market will take. |
| Forest | 2 | +25% | Lumber camps and housing. Slow to cross, and defenders get cover. |
| Hills | 2 | +50% | The only ground for a mine, and the best ground to defend. |
| Water | — | — | Impassable. Nothing crosses it and nothing is built on it. |
Development score, and it rewards exactly what it sounds like: 3 points per tile you hold, the value of every building standing, 4 points per worker, and the value of your army. A building is worth roughly a third of its credit cost, so putting money into the map always beats sitting on it.
You can play this half by hand from the Empire tab on the run page, or drive it from your
bot's on_world_tick. Both go through the same rules, so neither is a shortcut.
Every item has a hidden fair value on a random walk. Nobody can see it while the run is live — your bot only sees the book in front of it. Your P&L is marked at fair value, so quoting silly prices to yourself does not manufacture profit.
The client wraps these, but here they are if you want to roll your own. Authenticate with
Authorization: Bearer <token> from the Connect panel.
GET /market-sim-py/run/{id}/market # snapshot: books, your position, pnl, seconds_left
POST /market-sim-py/run/{id}/orders # {"orders": [ ... ]} — matched on arrival
POST /market-sim-py/run/{id}/cancel # {"item": "WIDGET"} — or {} for all
GET /market-sim-py/run/{id}/token # your bearer token
GET /market-sim-py/world/catalogue # costs, yields and unit stats (static)
GET /market-sim-py/run/{id}/world # the whole map, your empire, the standings
POST /market-sim-py/run/{id}/world/actions # {"actions": [ ... ]}
{"type": "build", "building": "farm", "x": 5, "y": 7}
{"type": "train", "unit": "explorer", "count": 2}
{"type": "move", "unit_id": "u3", "x": 6, "y": 7}
{"type": "attack", "unit_id": "u3", "x": 7, "y": 7} # must already be adjacent
{"type": "found", "unit_id": "u9"} # spend a settler on an outpost
{"type": "trade", "side": "buy", "resource": "materials", "qty": 20}
Actions apply in order and are reported on one by one, so a batch of six builds you can only half afford gets you the ones you can pay for plus a reason for the rest.
{"item": "WIDGET", "side": "BUY", "price": 99.95, "qty": 10} # resting limit order
{"item": "WIDGET", "side": "SELL", "qty": 10} # market order, remainder pulled
{"action": "cancel_all"} # pull all your resting orders
{"action": "cancel_all", "item": "WIDGET"} # pull one item's orders
market[item] = {"bid", "ask", "bid_qty", "ask_qty", "mid", "spread", "last"}
# any price may be null if that side of the book is empty
me = {"positions", "open_orders", "cash", "pnl", "fills", "last_reject"}
rate_limited rather than applied — so a fast connection can't turn
the game into a latency race. The client paces itself for you.Every run starts with a market maker and a liquidity taker, but the host can add more from the run page — different archetypes (market maker, conservative, mean-reversion, bull/long, bear/short, liquidity taker, momentum) at four skill levels (noob → normal → good → cracked). A smarter bot tracks the hidden fair value faster and quotes tighter, so it's a tougher opponent. Bots can be scheduled to enter partway through a run, and all of them respect the same 1000 limit you do.