W7-C3: Price input has no current price reference, no % deviation indicator, no USD equivalent, accepts invalid limit prices, and no limit order tooltip #154

Closed
opened 2026-05-11 13:02:05 +00:00 by totdking · 17 comments
totdking commented 2026-05-11 13:02:05 +00:00 (Migrated from gitlab.com)
No description provided.
totdking commented 2026-05-11 13:05:59 +00:00 (Migrated from gitlab.com)

Issue Summary

The Price input in the Place Limit panel is missing five features required for safe and informed limit order entry:

  1. No current market price displayed — the trader cannot see the live price next to the field they are entering
  2. No % deviation indicator — no feedback on how far the entered price is from the current market price
  3. No USD equivalent — the price is shown in token units only, with no USD value alongside it
  4. No limit price validation — the field accepts prices that violate limit order logic: bid (buy) orders should not be placed above the current price; ask (sell) orders should not be placed below the current price. Entering 7 on a pair trading at ~0.887 is accepted without any warning
  5. No tooltip explaining limit orders — new users have no contextual explanation of what a limit order is or what the price field represents

Reproduction Steps

  1. Navigate to /trade and select EMBER / CORAL (last price ~0.888)
  2. Select Bid (CORAL) side
  3. In the Price field, type 7 (far above the current price of ~0.888)
  4. Observe: no warning, no current price reference, no % deviation, no USD equivalent shown
  5. Hover over the "PLACE LIMIT" heading or the price field — observe no tooltip explaining limit order logic
  6. Switch to Ask (EMBER) and enter 0.1 (far below the current price)
  7. Observe: same — no validation, no warning

Expected Behavior

The Price field should include:

  • Current price reference — display the live market price near the input (e.g. "Current: 1.087 CORAL/EMBER") so the trader has an anchor
  • % deviation indicator — show how far the entered price deviates from the current price (e.g. "+544%" or "−90%") and highlight it red when the deviation is extreme or the direction violates limit order logic
  • USD equivalent — show the USD value of the entered price alongside the token price
  • Limit price validation — block or warn when:
    • A bid price is entered above the current market price (a buy limit above market would execute immediately as a market order or be rejected — it is not a valid limit)
    • An ask price is entered below the current market price (same issue for sell side)
  • Limit order tooltip — an info icon or hover tooltip on the "PLACE LIMIT" label explaining: "A limit order lets you set the price you're willing to buy or sell at. Buy limits should be set below the current price; sell limits above."

Actual Behavior

  • No current price shown anywhere near the Price input
  • No % deviation calculated or displayed
  • No USD equivalent shown — price is in token units only
  • Entering 7 on a pair at ~1.087 (Bid side, 544% above market) is accepted with no warning or validation
  • No tooltip or contextual explanation of limit order logic anywhere on the form

Environment Details

Field Value
OS macOS (Apple M1 Pro, 14-inch)
Browser Google Chrome (desktop)
Viewport ~375px mobile (screenshot) and ~1440px desktop
Network localterra (local Docker)
Frontend VITE_NETWORK=local npm run dev at localhost:3000
Indexer Running (make indexer-dev)
Contracts Deployed via make deploy-local

Wallet / Device Details

  • Wallet: Station browser extension
  • Wallet state: Connected — terra1...sl7cvv
  • Pair tested: EMBER / CORAL (terra146...c9mjav)
  • Last price at time of test: ~0.888

Screenshots

See attached screenshot showing price 7 entered on a pair trading at ~0.888 with no current price reference, no deviation indicator, no USD value, and no validation warning.

image.png{width="900" height="493"}


Severity / Impact

Medium. A trader can submit a limit bid at 544% above market with no friction or warning. On a real network with real funds, this would either execute immediately as a market order (unexpected for the user) or be rejected on-chain — both outcomes are harmful. The missing current price and % deviation are the most critical gaps: without them the trader has no reference point to evaluate their own entry. The USD display and tooltip are polish items but together these five gaps make the price field actively unsafe for inexperienced CEX migrants. Found under W7-C3 (Price input — Display, Interactivity, and Trader use dimensions).

cc: @PlasticDigits


### Issue Summary The Price input in the Place Limit panel is missing five features required for safe and informed limit order entry: 1. **No current market price displayed** — the trader cannot see the live price next to the field they are entering 2. **No % deviation indicator** — no feedback on how far the entered price is from the current market price 3. **No USD equivalent** — the price is shown in token units only, with no USD value alongside it 4. **No limit price validation** — the field accepts prices that violate limit order logic: bid (buy) orders should not be placed above the current price; ask (sell) orders should not be placed below the current price. Entering `7` on a pair trading at \~0.887 is accepted without any warning 5. **No tooltip explaining limit orders** — new users have no contextual explanation of what a limit order is or what the price field represents --- ### Reproduction Steps 1. Navigate to `/trade` and select EMBER / CORAL (last price \~0.888) 2. Select **Bid (CORAL)** side 3. In the Price field, type `7` (far above the current price of \~0.888) 4. Observe: no warning, no current price reference, no % deviation, no USD equivalent shown 5. Hover over the "PLACE LIMIT" heading or the price field — observe no tooltip explaining limit order logic 6. Switch to **Ask (EMBER)** and enter `0.1` (far below the current price) 7. Observe: same — no validation, no warning --- ### Expected Behavior The Price field should include: - **Current price reference** — display the live market price near the input (e.g. "Current: 1.087 CORAL/EMBER") so the trader has an anchor - **% deviation indicator** — show how far the entered price deviates from the current price (e.g. "+544%" or "−90%") and highlight it red when the deviation is extreme or the direction violates limit order logic - **USD equivalent** — show the USD value of the entered price alongside the token price - **Limit price validation** — block or warn when: - A **bid** price is entered **above** the current market price (a buy limit above market would execute immediately as a market order or be rejected — it is not a valid limit) - An **ask** price is entered **below** the current market price (same issue for sell side) - **Limit order tooltip** — an info icon or hover tooltip on the "PLACE LIMIT" label explaining: _"A limit order lets you set the price you're willing to buy or sell at. Buy limits should be set below the current price; sell limits above."_ --- ### Actual Behavior - No current price shown anywhere near the Price input - No % deviation calculated or displayed - No USD equivalent shown — price is in token units only - Entering `7` on a pair at \~1.087 (Bid side, 544% above market) is accepted with no warning or validation - No tooltip or contextual explanation of limit order logic anywhere on the form --- ### Environment Details | Field | Value | |-------|-------| | OS | macOS (Apple M1 Pro, 14-inch) | | Browser | Google Chrome (desktop) | | Viewport | \~375px mobile (screenshot) and \~1440px desktop | | Network | `localterra` (local Docker) | | Frontend | `VITE_NETWORK=local npm run dev` at `localhost:3000` | | Indexer | Running (`make indexer-dev`) | | Contracts | Deployed via `make deploy-local` | --- ### Wallet / Device Details - **Wallet:** Station browser extension - **Wallet state:** Connected — `terra1...sl7cvv` - **Pair tested:** EMBER / CORAL (`terra146...c9mjav`) - **Last price at time of test:** \~0.888 --- ### Screenshots > See attached screenshot showing price `7` entered on a pair trading at \~0.888 with no current price reference, no deviation indicator, no USD value, and no validation warning. ![image.png](/uploads/0532e17631dce325b01feeb494de9c4e/image.png){width="900" height="493"} --- ### Severity / Impact **Medium.** A trader can submit a limit bid at 544% above market with no friction or warning. On a real network with real funds, this would either execute immediately as a market order (unexpected for the user) or be rejected on-chain — both outcomes are harmful. The missing current price and % deviation are the most critical gaps: without them the trader has no reference point to evaluate their own entry. The USD display and tooltip are polish items but together these five gaps make the price field actively unsafe for inexperienced CEX migrants. Found under **W7-C3** (Price input — Display, Interactivity, and Trader use dimensions). cc: @PlasticDigits ---
totdking commented 2026-05-11 13:46:45 +00:00 (Migrated from gitlab.com)

mentioned in issue #155

mentioned in issue #155
totdking commented 2026-05-11 17:31:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #116

mentioned in issue #116
PlasticDigits commented 2026-05-12 07:46:36 +00:00 (Migrated from gitlab.com)

mentioned in commit 77c31834e8

mentioned in commit 77c31834e8468ece3555b53584c9f5cc65ed43e0
PlasticDigits commented 2026-05-12 07:46:50 +00:00 (Migrated from gitlab.com)

mentioned in commit 4a9fe69706

mentioned in commit 4a9fe697061be8eb75e01f660eb8d88c42c4204c
PlasticDigits commented 2026-05-12 07:48:03 +00:00 (Migrated from gitlab.com)

mentioned in commit b01ad55c29

mentioned in commit b01ad55c293c3286665018d7d6270591765cf7af
PlasticDigits commented 2026-05-12 07:48:32 +00:00 (Migrated from gitlab.com)

Update (GitLab #154)

Implemented limit price UX on /trade and /limit-orders (combined on main with the #153 Bid/Ask button radiogroup):

  • Current (last trade) — human token1 per token0 from the newest indexed swap + pair decimals.
  • % deviation — signed vs reference; red when direction is invalid for the side; amber when |\%| \geq 50 in a valid direction.
  • Headline-scaled USD — linear anchor from the same tape string passed to PriceChart (documented as an estimate, not per-token oracle).
  • Validation — Bid disabled at/above reference; Ask disabled at/below; placeMutation throws if the gate would fail.
  • Tooltip — ⓘ next to Place limit (title + sr-only).

Docs / agents: docs/frontend.md § Trade page — limit order price field, docs/limit-orders.md, skills/AGENTS_FRONTEND_LIMIT_ORDER_PRICE.md (cross-linked with trade layout + side-selector skills).

Verification checklist

  • Open /trade with indexer + tape: Current, vs reference, Headline-scaled USD populate; hover ⓘ shows limit-order copy.
  • Bid: enter a price above last-trade reference → red deviation, Place limit disabled, guard message.
  • Ask: enter a price below reference → same.
  • Valid bid below and valid ask above → submit enabled (subject to escrow/gas as before).
  • With no trades for the pair, reference shows — and submit is not blocked solely by price gate.
  • /limit-orders shows the same price context + gates.
  • npm test in frontend-dapp passes (includes new limitOrderPrice* tests).

@totdking — please verify on your EMBER/CORAL scenario (and mobile width) when you have a moment. Leaving the issue open as requested.

## Update (GitLab #154) Implemented limit **price** UX on `/trade` and `/limit-orders` (combined on main with the #153 Bid/Ask button radiogroup): - **Current (last trade)** — human **token1 per token0** from the newest indexed swap + pair decimals. - **% deviation** — signed vs reference; **red** when direction is invalid for the side; **amber** when \(|\%| \geq 50\) in a valid direction. - **Headline-scaled USD** — linear anchor from the same tape string passed to `PriceChart` (documented as an estimate, not per-token oracle). - **Validation** — **Bid** disabled at/above reference; **Ask** disabled at/below; `placeMutation` throws if the gate would fail. - **Tooltip** — **ⓘ** next to **Place limit** (`title` + `sr-only`). **Docs / agents:** `docs/frontend.md` § [Trade page — limit order price field](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/blob/main/docs/frontend.md#trade-page-limit-order-price), `docs/limit-orders.md`, `skills/AGENTS_FRONTEND_LIMIT_ORDER_PRICE.md` (cross-linked with trade layout + side-selector skills). ### Verification checklist - [ ] Open `/trade` with indexer + tape: **Current**, **vs reference**, **Headline-scaled USD** populate; hover **ⓘ** shows limit-order copy. - [ ] **Bid:** enter a price **above** last-trade reference → red deviation, **Place limit** disabled, guard message. - [ ] **Ask:** enter a price **below** reference → same. - [ ] Valid bid **below** and valid ask **above** → submit enabled (subject to escrow/gas as before). - [ ] With **no** trades for the pair, reference shows **—** and submit is **not** blocked solely by price gate. - [ ] `/limit-orders` shows the same price context + gates. - [ ] `npm test` in `frontend-dapp` passes (includes new `limitOrderPrice*` tests). @totdking — please verify on your EMBER/CORAL scenario (and mobile width) when you have a moment. Leaving the issue **open** as requested.
PlasticDigits commented 2026-05-12 07:49:02 +00:00 (Migrated from gitlab.com)

mentioned in commit 86320d088a

mentioned in commit 86320d088a32cc6ed922ccba79ce95164086b74e
PlasticDigits commented 2026-05-12 07:50:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #153

mentioned in issue #153
PlasticDigits commented 2026-05-12 07:55:39 +00:00 (Migrated from gitlab.com)

mentioned in commit 3ede6ca8de

mentioned in commit 3ede6ca8dedb48293053e75337c138a42fc57119
PlasticDigits commented 2026-05-12 07:56:03 +00:00 (Migrated from gitlab.com)

mentioned in issue #152

mentioned in issue #152
PlasticDigits commented 2026-05-27 05:14:25 +00:00 (Migrated from gitlab.com)

Verification complete (GitLab #154)

Verified on local stack (LocalTerra healthy, Postgres :5432, indexer :3001, frontend :3000, bot swarm active). No code changes required — limit price UX from the prior implementation passes all acceptance criteria.

Checklist

  • /trade (EMBER/CORAL) — Current (last trade), vs reference, Headline-scaled USD populate; ⓘ tooltip shows limit-order copy on hover.
  • Bid above reference — e.g. price 7 at ref ~0.97: red +646.8% (invalid for buy limit), Place limit disabled, guard message shown.
  • Ask below reference — e.g. price 0.1: red −89.7% (invalid for sell limit), Place limit disabled, guard message shown.
  • Valid bid below / valid ask above — bid 0.8 + amount enables Place limit (escrow/gas gates unchanged).
  • /limits — same price context + direction gates after pair selection (EMBER/CORAL).
  • npm test in frontend-dapp — 599/599 passed (includes limitOrderPrice* suites).

Note on checklist item 5 (no tape)

Superseded by #166: when tape is missing, UI falls back to AMM pool spot when available; reference shows pool label instead of —. Submit is only blocked when neither tape nor pool resolves — intentional safety, not a regression.

Closing as verified.

## Verification complete (GitLab #154) Verified on local stack (LocalTerra healthy, Postgres :5432, indexer :3001, frontend :3000, bot swarm active). No code changes required — limit price UX from the prior implementation passes all acceptance criteria. ### Checklist - [x] **`/trade` (EMBER/CORAL)** — Current (last trade), vs reference, Headline-scaled USD populate; **ⓘ** tooltip shows limit-order copy on hover. - [x] **Bid above reference** — e.g. price `7` at ref ~0.97: red **+646.8% (invalid for buy limit)**, Place limit disabled, guard message shown. - [x] **Ask below reference** — e.g. price `0.1`: red **−89.7% (invalid for sell limit)**, Place limit disabled, guard message shown. - [x] **Valid bid below / valid ask above** — bid `0.8` + amount enables Place limit (escrow/gas gates unchanged). - [x] **`/limits`** — same price context + direction gates after pair selection (EMBER/CORAL). - [x] **`npm test`** in `frontend-dapp` — 599/599 passed (includes `limitOrderPrice*` suites). ### Note on checklist item 5 (no tape) Superseded by **#166**: when tape is missing, UI falls back to **AMM pool spot** when available; reference shows pool label instead of **—**. Submit is only blocked when **neither** tape nor pool resolves — intentional safety, not a regression. Closing as verified.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-27 05:14:26 +00:00
PlasticDigits commented 2026-07-15 04:04:51 +00:00 (Migrated from gitlab.com)

mentioned in issue #495

mentioned in issue #495
PlasticDigits commented 2026-07-25 04:34:11 +00:00 (Migrated from gitlab.com)

mentioned in commit a010b1441f

mentioned in commit a010b1441f19a0b0e9b41b652ceb162a095ef2cb
PlasticDigits commented 2026-07-25 04:34:28 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1040

mentioned in merge request !1040
PlasticDigits commented 2026-08-15 12:19:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #524

mentioned in issue #524
PlasticDigits commented 2026-08-15 12:19:52 +00:00 (Migrated from gitlab.com)

marked as related to #524

marked as related to #524
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#154
No description provided.