Ignore:
Timestamp:
09/16/26 23:37:15 (13 days ago)
Author:
Stefan <trsunovstefan@…>
Branches:
main
Children:
8b447ef
Parents:
df05838
Message:

add reserved_quantity and modify the phases, add v_03.png and v_03.xml for P1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/P4-Prototype/BuildInstructions.md

    rdf05838 r9577c79  
    106106most recent trade (`v_latest_prices`), never from a stored column.
    107107
     108### 7. Optional — richer data for the P6 reports
     109
     110`data_load.sql` only seeds a few minutes of trade history, which is not enough
     111for the [top traders](../P6-AdvancedReports/AdvancedReports.md#top-traders-by-realized-performance)
     112or [market performance](../P6-AdvancedReports/AdvancedReports.md#market-performance-leaderboard)
     113reports (menu `[10]`/`[11]`) to show more than a single period. To see them do
     114something more interesting, load five quarters of synthetic history on top:
     115
     116```sh
     117psql "postgresql://$DBUSER:$DBPASSWORD@$DBHOST:$DBPORT/$DBNAME" \
     118  -f server/db/reports_demo_data.sql
     119```
     120
     121It is deliberately not part of `-init`/`-load-data` — see the header of
     122[`reports_demo_data.sql`](../../server/db/reports_demo_data.sql) for why — so
     123running it never changes the balances the smoke test below checks.
     124
    108125## Testing instructions
    109126
    … …  
    114131funds**, **Browse markets**, **Place market BUY order**, **Place market SELL
    115132order**, **View portfolio**, **View transaction history**, **Manage watchlist**,
    116 **Logout**.
     133**Logout**, and two [P6](../P6-AdvancedReports/AdvancedReports.md) reports:
     134**Report: top traders** and **Report: market performance**.
    117135
    118136You never have to remember an identifier. Markets are always printed as a
    … …  
    122140### End-to-end smoke test
    123141
    124 Verified on 2026-08-07 against PostgreSQL 16 with freshly loaded sample data.
     142Verified on 2026-09-16 against PostgreSQL 16 with freshly loaded sample data.
    125143Expected values are exact.
    126144
    1271451. `./eduberza -init` — prints `Database initialised.`
    1281462. `./eduberza`, then `[2] Login` → `alice` / `test123` → `Login successful.`
    129 3. `[6] View portfolio` → one row: `ETH 0.5000` at avg 3500.000000, current
    130    3520.000000, value 1760.0000, unrealised P/L `+10.0000`. Cash available
    131    8250.0000, net worth 10010.0000.
     1473. `[6] View portfolio` → one row: `ETH 0.5000` reserved 0.0000, available
     148   0.5000, at avg 3500.000000, current 3520.000000, value 1760.0000,
     149   unrealised P/L `+10.0000`. Cash available 8250.0000, net worth 10010.0000.
    1321504. `[4] Place market BUY order` → `BTC` → `0.01` →
    133151   `Order executed: buy 0.0100 BTC @ 67140.000000 (notional 671.4000 USD)`.
    … …  
    150168  to any table — no order row, no ledger entry, no holding.
    151169- **Insufficient holding:** as `bob` (no positions), try to sell `1` ETH.
    152   Expect `Insufficient holding: trying to sell 1.0000, hold 0.0000`.
     170  Expect `Insufficient holding: trying to sell 1.0000, available 0.0000 (of
     171  0.0000 held, 0.0000 reserved)`.
     172- **Two sell orders racing for the same crypto:** give `alice` a 2 BTC holding
     173  and start two `eduberza` processes at once, each selling `1.5` BTC (together
     174  3 BTC, more than she has). Expect exactly one `Order executed`, and the
     175  other `Insufficient holding` reading the post-commit quantity — see
     176  [UseCase0005Implementation](UseCase0005Implementation.md) for the exact
     177  transcript. This is the concurrency guarantee that
     178  `holdings.reserved_quantity` and the `SELECT ... FOR UPDATE` lock together
     179  provide.
    153180- **Duplicate registration:** register with username `alice`. Expect
    154181  `Username or email already taken.`
Note: See TracChangeset for help on using the changeset viewer.