W9-C3 No order history — filled and cancelled orders disappear with no record in the UI #163

Closed
opened 2026-05-12 15:05:26 +00:00 by totdking · 10 comments
totdking commented 2026-05-12 15:05:26 +00:00 (Migrated from gitlab.com)
No description provided.
totdking commented 2026-05-12 15:26:18 +00:00 (Migrated from gitlab.com)

Issue Summary

There is no order history section in the app. When a resting limit order is filled or cancelled, it is removed from the open orders table and no record is retained anywhere in the UI. There are no timestamps, no tx links, no fees paid, and no way to review past activity from within the app. The only way to reconcile trade activity is to go directly to a block explorer with the contract execution hash, which the UI does not provide.


Reproduction Steps

  1. Start the app (VITE_NETWORK=local npm run dev) with LocalTerra running
  2. Connect Station wallet and navigate to the Limits / Trade tab
  3. Place a resting limit order and allow it to fill, or cancel an existing order
  4. Observe that the order is removed from the BIDS / ASKS open orders table
  5. Look for a history, fills, or activity section anywhere in the UI — none exists

Expected Behavior

A history section should retain completed and cancelled orders with at minimum: timestamp, pair, side, fill price, size, fees paid, and a link to the transaction on the block explorer. This is standard on all CEX and DEX interfaces.


Actual Behavior

Filled and cancelled orders vanish from the UI with no trace. No history tab, no fills log, no fee summary, and no tx links are available anywhere in the app. A trader cannot reconcile their activity or verify fees paid without leaving the app entirely.


Environment Details

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

Wallet / Device Details

  • Wallet: Keplr browser extension
  • Wallet state: Connected — localterra

Severity / Impact

P2 Polish. No funds are at risk and order execution is functionally correct. However the absence of any history view is a meaningful gap for a CEX-migrant trader who expects to review fills, verify fees, and audit past activity. Post-trade trust and reconciliation are not possible from within the app in its current state. Found under W9-C3 (Order history / fills — Display, Updates, and Trader use dimensions).

@PlasticDigits

### Issue Summary There is no order history section in the app. When a resting limit order is filled or cancelled, it is removed from the open orders table and no record is retained anywhere in the UI. There are no timestamps, no tx links, no fees paid, and no way to review past activity from within the app. The only way to reconcile trade activity is to go directly to a block explorer with the contract execution hash, which the UI does not provide. --- ### Reproduction Steps 1. Start the app (`VITE_NETWORK=local npm run dev`) with LocalTerra running 2. Connect Station wallet and navigate to the Limits / Trade tab 3. Place a resting limit order and allow it to fill, or cancel an existing order 4. Observe that the order is removed from the BIDS / ASKS open orders table 5. Look for a history, fills, or activity section anywhere in the UI — none exists --- ### Expected Behavior A history section should retain completed and cancelled orders with at minimum: timestamp, pair, side, fill price, size, fees paid, and a link to the transaction on the block explorer. This is standard on all CEX and DEX interfaces. --- ### Actual Behavior Filled and cancelled orders vanish from the UI with no trace. No history tab, no fills log, no fee summary, and no tx links are available anywhere in the app. A trader cannot reconcile their activity or verify fees paid without leaving the app entirely. --- ### Environment Details | Field | Value | |-------|-------| | OS | macOS (Apple M1 Pro, 14-inch) | | Browser | Google Chrome (desktop) | | Viewport | \~1440px desktop | | Network | `localterra` (local Docker) | | Frontend | `VITE_NETWORK=local npm run dev` | | Indexer | Running (`make indexer-dev`) | | Contracts | Deployed via `make deploy-local` | --- ### Wallet / Device Details - **Wallet:** Keplr browser extension - **Wallet state:** Connected — localterra --- ### Severity / Impact **P2 Polish.** No funds are at risk and order execution is functionally correct. However the absence of any history view is a meaningful gap for a CEX-migrant trader who expects to review fills, verify fees, and audit past activity. Post-trade trust and reconciliation are not possible from within the app in its current state. Found under **W9-C3** (Order history / fills — Display, Updates, and Trader use dimensions). @PlasticDigits
totdking commented 2026-05-12 18:06:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #116

mentioned in issue #116
PlasticDigits commented 2026-05-13 04:43:12 +00:00 (Migrated from gitlab.com)

mentioned in commit e83539ce6e

mentioned in commit e83539ce6eca5a7bd993d31eeb3cebb26ffb20e3
PlasticDigits commented 2026-05-13 04:43:28 +00:00 (Migrated from gitlab.com)

Update (merged to main)

Implemented trader-scoped indexer history and CSV export for GitLab #163:

Indexer API

  • GET /api/v1/traders/{addr}/trades — optional pair= (404 if unknown pair), optional format=csv (text/csv attachment). JSON adds optional commission_amount / spread_amount on swaps when indexed.
  • GET /api/v1/traders/{addr}/limit-fills — fills where indexed maker matches; optional pair=, format=csv.
  • GET /api/v1/traders/{addr}/limit-cancellations — cancellations where indexed owner matches; optional pair=, format=csv.
  • Migration: partial index on (owner, block_timestamp) for cancellation-by-owner queries.

dApp

  • /limits: WalletIndexerHistoryPanel — swaps + limit fills + cancellations for the selected pair (with explorer tx links and per-section Download CSV). Query cache wallet-indexer-history invalidated after place/cancel.
  • /trade: same panel with swaps only for the active pair when a wallet is connected.

Docs / agent skills

  • docs/indexer-invariants.md, docs/frontend.md (§ Wallet swap and limit history), docs/limit-orders.md, new skills/AGENTS_FRONTEND_ORDER_HISTORY.md, crosslinks in AGENTS_LOCALNET_TRADING_SWARM.md and AGENTS_FRONTEND_TRADE_PAGE_LAYOUT.md.

Verification checklist (for QA)

  • Run migrations; indexer serves new routes (Swagger /api-docs/openapi.json).
  • With wallet A on pair P: place limit → fill or cancel → history shows row with correct timestamp, tx link, fees (swap: commission/bps when present; fills: commission).
  • CSV for each section opens in a spreadsheet; headers match JSON columns; pair= scope matches UI (selected pair only).
  • /trade: connected wallet sees swaps history for current pair; CSV downloads.
  • Unknown pair= on trader routes returns 404; bad format= returns 400.
  • cargo test --test api_traders --test security with Postgres (CI or local TEST_DATABASE_URL).

@totdking — please verify on LocalTerra + deployed indexer when you have a moment. Leaving the issue open as requested.

## Update (merged to `main`) Implemented **trader-scoped** indexer history and **CSV export** for [GitLab #163](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/163): ### Indexer API - `GET /api/v1/traders/{addr}/trades` — optional `pair=` (404 if unknown pair), optional `format=csv` (`text/csv` attachment). JSON adds optional `commission_amount` / `spread_amount` on swaps when indexed. - `GET /api/v1/traders/{addr}/limit-fills` — fills where indexed `maker` matches; optional `pair=`, `format=csv`. - `GET /api/v1/traders/{addr}/limit-cancellations` — cancellations where indexed `owner` matches; optional `pair=`, `format=csv`. - Migration: partial index on `(owner, block_timestamp)` for cancellation-by-owner queries. ### dApp - **`/limits`**: `WalletIndexerHistoryPanel` — swaps + limit fills + cancellations for the **selected pair** (with explorer tx links and per-section **Download CSV**). Query cache `wallet-indexer-history` invalidated after place/cancel. - **`/trade`**: same panel with **swaps only** for the active pair when a wallet is connected. ### Docs / agent skills - `docs/indexer-invariants.md`, `docs/frontend.md` (§ Wallet swap and limit history), `docs/limit-orders.md`, new `skills/AGENTS_FRONTEND_ORDER_HISTORY.md`, crosslinks in `AGENTS_LOCALNET_TRADING_SWARM.md` and `AGENTS_FRONTEND_TRADE_PAGE_LAYOUT.md`. ### Verification checklist (for QA) - [ ] Run migrations; indexer serves new routes (Swagger `/api-docs/openapi.json`). - [ ] With wallet **A** on pair **P**: place limit → fill or cancel → **history** shows row with correct **timestamp**, **tx link**, **fees** (swap: commission/bps when present; fills: commission). - [ ] **CSV** for each section opens in a spreadsheet; headers match JSON columns; `pair=` scope matches UI (selected pair only). - [ ] **`/trade`**: connected wallet sees **swaps** history for current pair; CSV downloads. - [ ] Unknown `pair=` on trader routes returns **404**; bad `format=` returns **400**. - [ ] `cargo test --test api_traders --test security` with Postgres (CI or local `TEST_DATABASE_URL`). @totdking — please verify on LocalTerra + deployed indexer when you have a moment. Leaving the issue **open** as requested.
PlasticDigits commented 2026-05-27 05:56:53 +00:00 (Migrated from gitlab.com)

mentioned in commit 97d3db5a5b

mentioned in commit 97d3db5a5bae46e9df5e09311fa621cf27faa15a
PlasticDigits commented 2026-05-27 05:56:54 +00:00 (Migrated from gitlab.com)

mentioned in commit 67089d2fc2

mentioned in commit 67089d2fc22b554775c42aa6d2db63d90bbecb4f
PlasticDigits commented 2026-05-27 05:56:59 +00:00 (Migrated from gitlab.com)

Verification complete (LocalTerra QA)

Verified GitLab #163 on the shared local stack (LocalTerra healthy, host Postgres :5432, indexer :3001, frontend :3000, bot swarm 30/30).

Checklist

  • Migrations / indexer routes present in OpenAPI (/api/v1/traders/{addr}/trades, limit-fills, limit-cancellations; format=csv supported).
  • Trader history JSON: swaps return block_timestamp, tx_hash, commission_amount / effective_fee_bps for wallet terra1x46… on pair terra10y4…; cancellations return indexed owner rows; limit-fills API works (no fills indexed yet on this localnet dataset — empty array, not a UI regression).
  • CSV export: trades?format=csv&pair=… returns text/csv with header row matching JSON columns.
  • /limits: WalletIndexerHistoryPanel shows swaps + limit fills + cancellations + per-section Download CSV (Playwright e2e/wallet-history-163.spec.ts).
  • /trade: same panel with swaps-only section (Playwright).
  • Unknown pair= → 404; bad format= → 400 (live API).
  • cargo test --test api_traders --test security -- --test-threads=1 against dex_indexer_test (all passed).

Deliverable

  • Added regression E2E: frontend-dapp/e2e/wallet-history-163.spec.ts (merged to main @ 97d3db5).

Notes

  • Cursor browser MCP was unavailable in this workspace; UI verified via Playwright against the running dev server.
  • Localnet currently has 0 limit_order_fills rows; maker fill history UI/API are wired but will populate once the indexer ingests fill events.

Closing as verified.

## Verification complete (LocalTerra QA) Verified GitLab #163 on the shared local stack (LocalTerra healthy, host Postgres :5432, indexer :3001, frontend :3000, bot swarm 30/30). ### Checklist - [x] Migrations / indexer routes present in OpenAPI (`/api/v1/traders/{addr}/trades`, `limit-fills`, `limit-cancellations`; `format=csv` supported). - [x] Trader history JSON: swaps return `block_timestamp`, `tx_hash`, `commission_amount` / `effective_fee_bps` for wallet `terra1x46…` on pair `terra10y4…`; cancellations return indexed `owner` rows; limit-fills API works (no fills indexed yet on this localnet dataset — empty array, not a UI regression). - [x] CSV export: `trades?format=csv&pair=…` returns `text/csv` with header row matching JSON columns. - [x] `/limits`: `WalletIndexerHistoryPanel` shows swaps + limit fills + cancellations + per-section Download CSV (Playwright `e2e/wallet-history-163.spec.ts`). - [x] `/trade`: same panel with swaps-only section (Playwright). - [x] Unknown `pair=` → **404**; bad `format=` → **400** (live API). - [x] `cargo test --test api_traders --test security -- --test-threads=1` against `dex_indexer_test` (all passed). ### Deliverable - Added regression E2E: `frontend-dapp/e2e/wallet-history-163.spec.ts` (merged to `main` @ 97d3db5). ### Notes - Cursor browser MCP was unavailable in this workspace; UI verified via Playwright against the running dev server. - Localnet currently has **0** `limit_order_fills` rows; maker fill history UI/API are wired but will populate once the indexer ingests fill events. Closing as verified.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-05-27 05:57:01 +00:00
PlasticDigits commented 2026-06-07 12:14:14 +00:00 (Migrated from gitlab.com)

mentioned in issue #337

mentioned in issue #337
PlasticDigits commented 2026-06-26 06:50:32 +00:00 (Migrated from gitlab.com)

mentioned in issue #422

mentioned in issue #422
PlasticDigits commented 2026-07-12 08:10:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #479

mentioned in issue #479
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#163
No description provided.