Changeset ef1c1c7 for docs/P3-UseCaseModel/UseCase0004.md
- Timestamp:
- 09/24/26 17:43:19 (5 days ago)
- Branches:
- main
- Children:
- 0cee8ec
- Parents:
- a531b45
- File:
-
- 1 edited
-
docs/P3-UseCaseModel/UseCase0004.md (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/P3-UseCaseModel/UseCase0004.md
ra531b45 ref1c1c7 10 10 11 11 1. Trader chooses "Place market BUY order". 12 2. System lists the a vailable marketswith their latest price:12 2. System lists the active markets, numbered, with their latest price: 13 13 14 14 ```sql 15 SELECT m.id, c.symbol, m.quote_currency, COALESCE(lp.price, 0) 15 SELECT m.id, c.id, c.symbol, m.quote_currency, 16 COALESCE(lp.price, 0) AS price 16 17 FROM project.markets m 17 18 JOIN project.crypto c ON c.id = m.crypto_id … … 20 21 ORDER BY c.symbol; 21 22 ``` 22 3. Trader enters a market symbol, e.g. `ETH`. 23 4. System resolves the market and looks up the latest price: 23 3. Trader picks the market by its number in the listed markets, e.g. `2` (BTC). 24 4. System takes the chosen row's market id and crypto id from the list (no lookup by 25 symbol) and looks up the latest price: 24 26 25 27 ```sql 26 SELECT m.id, c.id AS crypto_id, c.symbol, m.quote_currency 27 FROM project.markets m 28 JOIN project.crypto c ON c.id = m.crypto_id 29 WHERE upper(c.symbol) = upper($1) AND m.is_active = true; 30 31 SELECT price FROM project.v_latest_prices WHERE market_id = $2; 28 SELECT price FROM project.v_latest_prices WHERE market_id = $1; 32 29 ``` 33 30 5. Trader enters a quantity. … … 91 88 If `available_balance < notional`, the entire transaction rolls back and system shows "Insufficient funds: need X, have Y." 92 89 93 ### Alternate flow 4a — market not found90 ### Alternate flow 3a — number not in the list 94 91 95 If the entered symbol does not match any active market, system shows "market X not found" and returns to the authenticated menu without opening a transaction.92 If the entered number is not one of the listed market numbers, system shows "Invalid choice, enter a number from 1 to N." and returns to the authenticated menu without opening a transaction.
Note:
See TracChangeset
for help on using the changeset viewer.
