<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guess-market/api/src/main, branch master</title>
<subtitle>definitely not polymarket
</subtitle>
<id>https://git.sartin.in/guess-market/atom?h=master</id>
<link rel='self' href='https://git.sartin.in/guess-market/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/'/>
<updated>2026-10-15T08:40:30Z</updated>
<entry>
<title>server: add a chat shared by everyone logged in</title>
<updated>2026-10-15T08:40:30Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-15T08:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=4563c9d6d6c1576b6fb45899c2b6d6073966d8b8'/>
<id>urn:sha1:4563c9d6d6c1576b6fb45899c2b6d6073966d8b8</id>
<content type='text'>

Ex3 bonus. POST /api/chat says a line as the logged-in user and
GET /api/chat?since=N returns the lines after id N, so a polling client
only ever downloads what it has not seen. The last 500 lines are kept
in memory.

A chat line does not change the market, so the lock filter does not
bump the market version for it; otherwise every line would make every
client refetch all events.

Also read form fields as UTF-8 in the filter rather than relying on
Tomcat's default, since names and chat text may not be ASCII.


</content>
</entry>
<entry>
<title>api: share the user directory row with clients</title>
<updated>2026-10-12T08:51:00Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-12T08:50:31Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=da1683eccff72b5d4745fe7f5eaac42d700e7989'/>
<id>urn:sha1:da1683eccff72b5d4745fe7f5eaac42d700e7989</id>
<content type='text'>

The row GET /api/users and /api/sync send for each user was a record
private to UsersServlet, so a client had nothing to deserialize it
into. Move it to the api module as UserSummaryDTO.

Make TestServer public as well, so client modules can test against a
real embedded server.


</content>
</entry>
<entry>
<title>account: let users deposit cash into their account</title>
<updated>2026-10-09T07:19:12Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-09T07:18:41Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=246c1ab5ffce1a1bb3c0534868b29f6e4c862a62'/>
<id>urn:sha1:246c1ab5ffce1a1bb3c0534868b29f6e4c862a62</id>
<content type='text'>

Exercise 3 replaces the fixed initial cash of Exercise 2 with accounts
that users top up themselves. Add AccountContext.deposit, which credits
a DEPOSIT entry through LedgerContext so it carries a timestamp and a
running balance like every other ledger movement, and return the
updated account.

The amount crosses the api boundary as a string, like all money values.
Reject anything that is not a positive number with at most two decimal
places instead of rounding it, so a user is never credited a different
amount than they asked for. A deposit can bring a negative account back
above zero, which lifts the block.


</content>
</entry>
<entry>
<title>api: extend contexts and DTOs for order books and event creation</title>
<updated>2026-09-06T09:22:58Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-09-06T09:22:58Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=5bc7c4ed9d052668af66d3116a6b7afbe62c6eec'/>
<id>urn:sha1:5bc7c4ed9d052668af66d3116a6b7afbe62c6eec</id>
<content type='text'>
The desktop UI needs to create events, trade on both sides of an order
book, and show who is participating in an event, none of which the api
module could express so far.

Add AccountContext for looking up ledger accounts by owner, and give
CatalogContext an openEvent operation plus createEvent, taking either a
CreateEventRequest or its fields spelled out. createEvent defaults to
a "Not implemented" error so existing implementations keep compiling
until they support it.

Let GuessMarketContext.placeOrder take an explicit side, keeping the
old signature as a default method that places a BUY so current callers
are unaffected.

Add OrderBookDTO and BookOrderDTO to describe per-option books with
best bid, best ask and spread, and ParticipantDTO for a user's
position, fees and P&amp;L in an event. Carry the order books and
participants on EventDetailDTO and the market maker's name on
EventSummaryDTO.
</content>
</entry>
<entry>
<title>model: relocate market DTOs out of the flat api package</title>
<updated>2026-08-23T14:05:29Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-08-23T14:05:29Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=843820ea9f357220d69f3795f3289ee41eed355c'/>
<id>urn:sha1:843820ea9f357220d69f3795f3289ee41eed355c</id>
<content type='text'>
Move AccountDTO/MarketDTO/MarketStateDTO/PurchaseReceiptDTO/TradeRowDTO
out of the catch-all api package into model.market (and LedgerDTO into
model.ledger), matching the existing model.event convention so DTOs
live next to the domain they describe rather than in the interface
package. Relocate LedgerMapper from mapper.v2 to infrastructure.adapter
to match the module's established package layout, and update all call
sites and imports accordingly.

Also register the ui-desktop module in the build tooling: add it to
MODULES, add openjfx to the shipped runtime libs, and generalize
package.sh so each executable module (ui-console, ui-desktop) gets its
own Main-Class/Class-Path manifest and run script instead of
special-casing ui-console. Fold long Class-Path manifest lines at 72
bytes per the JAR spec, since adding ui-desktop's dependencies pushed
the line past the limit.
</content>
</entry>
<entry>
<title>Move CommissionTiming and MechanismType into model.event package</title>
<updated>2026-08-20T09:09:20Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-08-20T09:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=0fc488c3f9e29f5e9f1092f8081714c9e820f178'/>
<id>urn:sha1:0fc488c3f9e29f5e9f1092f8081714c9e820f178</id>
<content type='text'>
Groups them with the other event-domain enums instead of the general
api package, and updates all call sites accordingly.
</content>
</entry>
<entry>
<title>Break down purchase receipts by cost/commission, harden XML validation and state I/O</title>
<updated>2026-08-18T15:19:50Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-08-18T15:19:50Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=755d2265054e5140e82d322681566c3034583c95'/>
<id>urn:sha1:755d2265054e5140e82d322681566c3034583c95</id>
<content type='text'>
Adds a full pre-load validation pass for GM XML seeds (ids, names,
options, commission, LMSR liquidity), replaces IO.print with
System.out, and surfaces detailed error messages across load/save
commands instead of generic failures.
</content>
</entry>
<entry>
<title>Wire event ledger movements, show winning market by name, seed LMSR subsidy</title>
<updated>2026-08-18T09:07:57Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-08-18T09:07:57Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=9dab2b3d624ecae08439532157fb8b9805fe9274'/>
<id>urn:sha1:9dab2b3d624ecae08439532157fb8b9805fe9274</id>
<content type='text'>
- Event ledger now grows on purchase and shrinks on payout, mirroring
  the exact amounts moved on the buyer's ledger (it previously had a
  Ledger object that nothing ever wrote to).
- Settlement and event-detail views now show the winning market's
  display name instead of its raw key; event details are viewable for
  settled events too (the picker previously excluded anything not
  ACTIVE).
- LMSR events seed their ledger with a SUBSIDY entry for the market
  maker's worst-case loss (b * ln(outcomes)), reusing the existing
  cost() function rather than recomputing the formula.
</content>
</entry>
<entry>
<title>Replace order matching with risk/matching/fulfillment/settlement pipeline</title>
<updated>2026-08-17T11:15:59Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-08-17T11:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=13a221ffaefc169d028c7eab6f21ac88052d1d40'/>
<id>urn:sha1:13a221ffaefc169d028c7eab6f21ac88052d1d40</id>
<content type='text'>
Move XML loading infrastructure and models under service/catalog, and
split order execution into a real pipeline: RiskEngine checks the order,
MatchingEngine matches it, FulfillmentContext books the resulting trades,
and SettlementContext resolves winning markets. GuessMarketContext.buyShares
becomes placeOrder(price, quantity), and TradingMechanism.buy now returns
matched trades directly instead of a single TradeExecution.
</content>
</entry>
<entry>
<title>Split DTOs into api/model, extract order matching into service/matching</title>
<updated>2026-08-16T18:50:15Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-08-16T18:50:15Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=eed9265be711432f40247f149c07f9e33511192a'/>
<id>urn:sha1:eed9265be711432f40247f149c07f9e33511192a</id>
<content type='text'>
Moves Event/Ledger DTOs out of the flat api package into
api/model/{event,ledger}, and moves LocalCatalogContext and order
matching logic into dedicated service/catalog and service/matching
packages, replacing TradingOperation/TradingOperationImpl.
</content>
</entry>
</feed>
