post-merge !398: Coolify frontend deploy + hybrid book metrics (#596) #598

Closed
opened 2026-08-22 13:52:57 +00:00 by PlasticDigits · 4 comments
PlasticDigits commented 2026-08-22 13:52:57 +00:00 (Migrated from gitlab.com)

Why

!1116 merged and closed #596. Retail Swap and Trade Market now always consider the limit book (GET /route/solve); users cannot opt in or opt out. GitLab CI for the MR failed with ci_quota_exceeded (jobs never ran). Local make verify-issue-596 passed 11/11.

This ticket is production bake + leftover QA. It is not a second product-rule ticket.

Do

  • Coolify frontend rebuild so !1116 ships (npm ci / image rebuild). No indexer schema change.
  • Production smoke: Swap Settings → Advanced has no hybrid checkbox; empty book still quotes via indexer GET. Trade Market → Advanced has no Best execution toggle; typed book still POST.
  • Optional LocalTerra: VERIFY_ISSUE_596_CHAIN=1 make verify-issue-596 (Playwright hybrid-swap.spec.ts) when chain + frontend-dapp/.env.local are up.
  • Observational (issue #596 notes): after deploy, compare indexer book_leg_volume vs pool_leg_volume on venue swaps. Higher book share is the product outcome, not a unit test.
  • Hygiene (not #596 AC): drop stale “Hybrid off → pool-only” JSDoc on TradeMarketOrderPanel.tsx. Consider Swap network-fee cw20Hybrid when GET allocates interior book_input without a typed Advanced override (Trade already assumes hybrid per H596-8).

Out of scope

  • Restoring a retail useHybridBook / pool-only toggle
  • Indexer GET /route/solve?pool_only=true for integrators (stays)
  • Waiting on GitLab CI quota

Verify

make verify-issue-596

Playbook: skills/AGENTS_FRONTEND_HYBRID_ALWAYS_ON.md (H596-1–H596-8).

## Why [!1116](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/398) merged and closed [#596](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/596). Retail Swap and Trade Market now always consider the limit book (`GET /route/solve`); users cannot opt in or opt out. GitLab CI for the MR failed with `ci_quota_exceeded` (jobs never ran). Local `make verify-issue-596` passed 11/11. This ticket is production bake + leftover QA. It is **not** a second product-rule ticket. ## Do - [ ] Coolify frontend rebuild so !1116 ships (`npm ci` / image rebuild). No indexer schema change. - [ ] Production smoke: Swap Settings → Advanced has **no** hybrid checkbox; empty book still quotes via indexer GET. Trade Market → Advanced has **no** Best execution toggle; typed book still POST. - [ ] Optional LocalTerra: `VERIFY_ISSUE_596_CHAIN=1 make verify-issue-596` (Playwright `hybrid-swap.spec.ts`) when chain + `frontend-dapp/.env.local` are up. - [ ] Observational (issue #596 notes): after deploy, compare indexer `book_leg_volume` vs `pool_leg_volume` on venue swaps. Higher book share is the product outcome, not a unit test. - [ ] Hygiene (not #596 AC): drop stale “Hybrid off → pool-only” JSDoc on `TradeMarketOrderPanel.tsx`. Consider Swap network-fee `cw20Hybrid` when GET allocates interior `book_input` without a typed Advanced override (Trade already assumes hybrid per **H596-8**). ## Out of scope - Restoring a retail `useHybridBook` / pool-only toggle - Indexer `GET /route/solve?pool_only=true` for integrators (stays) - Waiting on GitLab CI quota ## Verify ```bash make verify-issue-596 ``` Playbook: [`skills/AGENTS_FRONTEND_HYBRID_ALWAYS_ON.md`](skills/AGENTS_FRONTEND_HYBRID_ALWAYS_ON.md) (**H596-1–H596-8**).
PlasticDigits commented 2026-08-22 13:52:58 +00:00 (Migrated from gitlab.com)

marked as related to #596

marked as related to #596
PlasticDigits commented 2026-08-22 13:53:05 +00:00 (Migrated from gitlab.com)

mentioned in issue #596

mentioned in issue #596
PlasticDigits commented 2026-08-22 14:04:45 +00:00 (Migrated from gitlab.com)

Redeploy check (2026-08-22 ~13:55 UTC Coolify bake)

Production https://dex.cl8y.com/ HTML + JS Last-Modified: Sat, 22 Aug 2026 13:55:14 GMT (/assets/index-DaEafJXE.js, SwapPage-LHH9OYwc.js, TradePage-BcBYUL4Z.js). Indexer https://indexer.dex.cl8y.com/health = ok. No indexer schema change required.

Checklist

  • Coolify frontend rebuild ships !1116
  • Production smoke — Swap Settings → Advanced: no hybrid checkbox; empty book GET /route/solve (no pool_only); typed book POST hybrid_by_hop
  • Production smoke — Trade Market → Advanced: no Best execution toggle; copy is solver-always / book override only; empty book GET; typed book POST
  • Optional LocalTerra VERIFY_ISSUE_596_CHAIN=1 Playwright (ran, FAIL — see below)
  • Observational book_leg_volume vs pool_leg_volume after this bake (no post-deploy venue swaps yet)
  • Hygiene (JSDoc + Swap gas)

Production evidence (UST1 → USTR)

  • Swap Advanced shows “Resting limit orders are always considered. Type a book amount only to override the solver split.” Only checkbox is Expert Mode. Wrap path (cLUNC→LUNC) correctly hides the book override (H596-7).
  • Empty book: GET https://indexer.dex.cl8y.com/api/v1/route/solve?token_in=…UST1…&token_out=…USTR…&amount_in=1000000&max_maker_fills=8 — no pool_only. Quote UI: Execution Limit book + pool.
  • Typed book 0.1: POST /api/v1/route/solve body includes hybrid_by_hop.
  • Trade Market: “Best pool/book split by default”; Advanced “Quotes always use the indexer solver… Type a book leg only to override.” Same GET/POST split. Bundle has no useHybridBook / trade-market-hybrid-toggle / old checkbox copy.

Local verify

make verify-issue-596 (unit + docs): 11 PASS / 0 FAIL (61 Vitest).

VERIFY_ISSUE_596_CHAIN=1 make verify-issue-596: unit/docs still pass; chain Playwright FAIL (e2e-tx / hybrid-swap.spec.ts “shows hybrid book disclosure…”). Assertion getByRole('alert') /limit book/i saw "Quote may change before submit. Docs" (SwapPage hybrid LCD warning, link text Docs). Execution summary still says Limit book + pool. This is stale e2e vs #489/#596 copy, not a retail opt-out regression. Follow-up: point the spec at swap-execution-summary / Docs href, not the first role=alert.

Observational metrics (GET /cg/tickers)

UST1_USTR 24h cl8y_extensions: hybrid_trade_count_24h=2, pool_only_trade_count_24h=3, book_leg_volume_quote_24h=890713970484280865828, pool_leg_volume_quote_24h=886847811504280879361. Other listed pairs: book 0. The two hybrid fills in the trailing window are 2026-08-21 14:31 and 14:09 UTC (3385F07E…, 0442C5EA…) — before !1116 merge and this Coolify bake. Latest UST1/USTR tapes on 22 Aug (5A7C9EA7… 09:58, FEE81836… 08:18) are pool-leg only and also pre-bake. Re-check after live taker flow.

Leave #598 open for: e2e copy update, post-bake book-share observation, JSDoc (TradeMarketOrderPanel still documents “Hybrid off → pool-only”), optional Swap gas when GET allocates interior book.

## Redeploy check (2026-08-22 ~13:55 UTC Coolify bake) Production `https://dex.cl8y.com/` HTML + JS `Last-Modified: Sat, 22 Aug 2026 13:55:14 GMT` (`/assets/index-DaEafJXE.js`, `SwapPage-LHH9OYwc.js`, `TradePage-BcBYUL4Z.js`). Indexer `https://indexer.dex.cl8y.com/health` = ok. No indexer schema change required. ### Checklist - [x] Coolify frontend rebuild ships !1116 - [x] Production smoke — Swap Settings → Advanced: no hybrid checkbox; empty book `GET /route/solve` (no `pool_only`); typed book `POST` `hybrid_by_hop` - [x] Production smoke — Trade Market → Advanced: no Best execution toggle; copy is solver-always / book override only; empty book GET; typed book POST - [ ] Optional LocalTerra `VERIFY_ISSUE_596_CHAIN=1` Playwright (ran, **FAIL** — see below) - [ ] Observational `book_leg_volume` vs `pool_leg_volume` **after this bake** (no post-deploy venue swaps yet) - [ ] Hygiene (JSDoc + Swap gas) ### Production evidence (UST1 → USTR) - Swap Advanced shows **“Resting limit orders are always considered. Type a book amount only to override the solver split.”** Only checkbox is Expert Mode. Wrap path (cLUNC→LUNC) correctly hides the book override (**H596-7**). - Empty book: `GET https://indexer.dex.cl8y.com/api/v1/route/solve?token_in=…UST1…&token_out=…USTR…&amount_in=1000000&max_maker_fills=8` — **no `pool_only`**. Quote UI: Execution **Limit book + pool**. - Typed book `0.1`: `POST /api/v1/route/solve` body includes `hybrid_by_hop`. - Trade Market: “Best pool/book split by default”; Advanced “Quotes always use the indexer solver… Type a book leg only to override.” Same GET/POST split. Bundle has no `useHybridBook` / `trade-market-hybrid-toggle` / old checkbox copy. ### Local verify `make verify-issue-596` (unit + docs): **11 PASS / 0 FAIL** (61 Vitest). `VERIFY_ISSUE_596_CHAIN=1 make verify-issue-596`: unit/docs still pass; **chain Playwright FAIL** (`e2e-tx` / `hybrid-swap.spec.ts` “shows hybrid book disclosure…”). Assertion `getByRole('alert')` `/limit book/i` saw `"Quote may change before submit. Docs"` (SwapPage hybrid LCD warning, link text **Docs**). Execution summary still says Limit book + pool. This is stale e2e vs #489/#596 copy, not a retail opt-out regression. Follow-up: point the spec at `swap-execution-summary` / Docs href, not the first `role=alert`. ### Observational metrics (`GET /cg/tickers`) UST1_USTR 24h `cl8y_extensions`: `hybrid_trade_count_24h=2`, `pool_only_trade_count_24h=3`, `book_leg_volume_quote_24h=890713970484280865828`, `pool_leg_volume_quote_24h=886847811504280879361`. Other listed pairs: book 0. The two hybrid fills in the trailing window are **2026-08-21 14:31 and 14:09 UTC** (`3385F07E…`, `0442C5EA…`) — before !1116 merge and this Coolify bake. Latest UST1/USTR tapes on 22 Aug (`5A7C9EA7…` 09:58, `FEE81836…` 08:18) are pool-leg only and also pre-bake. Re-check after live taker flow. Leave #598 open for: e2e copy update, post-bake book-share observation, JSDoc (`TradeMarketOrderPanel` still documents “Hybrid off → pool-only”), optional Swap gas when GET allocates interior book.
leonardocolucci commented 2026-08-22 14:41:05 +00:00 (Migrated from gitlab.com)

On-chain verification of #596 (best-execution routing)

Tested with live swaps on UST1/USTR after the !1116 deploy. The router picks the genuinely best leg in both directions:

1. Book beats pool → routed to book ✅
A 100 USTR → UST1 swap went through the router hybrid op (hybrid{ pool_input:0, book_input:100e18, max_maker_fills:8 }) and filled 100% from the resting book — book_return_amount ≈ 1.0774 UST1, pool_return_amount = 0. On-chain result matched the global_v4 solver quote (predicted 1.0757, actual 1.0774). Executed from a wallet that doesn't own the resting orders, so it's a genuine third-party book fill.

2. Pool beats book → routed to pool ✅
A 5 UST1 → USTR swap correctly routed pool-only (book_return_amount = 0) because the pool genuinely beat the book quote at that size. Tier-9 discount applied (effective_fee_bps = 9), confirming the #535 registry too.

Frontend
Production dex.cl8y.com (rebuilt 2026-08-22) calls GET /api/v1/route/solve?…&max_maker_fills=8 by default from the Market/Swap ticket — no opt-in toggle; the only checkbox left is the risk disclaimer. Matches #596 / !1116. No worse-than-best routes observed across tested sizes (1–1000 UST1, both directions).

## On-chain verification of #596 (best-execution routing) Tested with live swaps on UST1/USTR after the !1116 deploy. The router picks the genuinely best leg in both directions: **1. Book beats pool → routed to book ✅** A 100 USTR → UST1 swap went through the router hybrid op (`hybrid{ pool_input:0, book_input:100e18, max_maker_fills:8 }`) and filled **100% from the resting book** — `book_return_amount` ≈ 1.0774 UST1, `pool_return_amount` = 0. On-chain result matched the `global_v4` solver quote (predicted 1.0757, actual 1.0774). Executed from a wallet that doesn't own the resting orders, so it's a genuine third-party book fill. **2. Pool beats book → routed to pool ✅** A 5 UST1 → USTR swap correctly routed pool-only (`book_return_amount` = 0) because the pool genuinely beat the book quote at that size. Tier-9 discount applied (`effective_fee_bps` = 9), confirming the #535 registry too. **Frontend** Production `dex.cl8y.com` (rebuilt 2026-08-22) calls `GET /api/v1/route/solve?…&max_maker_fills=8` by default from the Market/Swap ticket — no opt-in toggle; the only checkbox left is the risk disclaimer. Matches #596 / !1116. No worse-than-best routes observed across tested sizes (1–1000 UST1, both directions).
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-08-23 02:44:03 +00:00
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#598
No description provided.