aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/main/java/market/guess/model
Commit message (Collapse)AuthorAgeFilesLines
* api: extend contexts and DTOs for order books and event creationKostya2026-09-066-2/+51
| | | | | | | | | | | | | | | | | | | | | | 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&L in an event. Carry the order books and participants on EventDetailDTO and the market maker's name on EventSummaryDTO.
* model: relocate market DTOs out of the flat api packageKostya2026-08-236-2/+36
| | | | | | | | | | | | | | | | | | 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.
* Move CommissionTiming and MechanismType into model.event packageKostya2026-08-203-2/+12
| | | | | Groups them with the other event-domain enums instead of the general api package, and updates all call sites accordingly.
* Wire event ledger movements, show winning market by name, seed LMSR subsidyKostya2026-08-181-1/+1
| | | | | | | | | | | | | - 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.
* Split DTOs into api/model, extract order matching into service/matchingKostya2026-08-165-0/+49
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.