Skip to content

[simplex]: an operator page for limit orders - #1291

Merged
Wizdave97 merged 1 commit into
mainfrom
dami/simplex-limit-order-ui
Sep 21, 2026
Merged

Wizdave97 merged 1 commit into
mainfrom
dami/simplex-limit-order-ui

Conversation

@dharjeezy

Copy link
Copy Markdown
Contributor

Stacked on #1275.

The dashboard lost its curve editors when prices moved onto limit orders, and nothing replaced them. /api/limit-orders has been there from the start, but the only way to reach it was curl, so an operator could see which markets simplex watches and not what it was offering on any of them.

This adds a Limit orders page at /limit-orders, between Overview and Orders.

What it shows

One row per order, live ones first and closed ones under their own heading. Each row reads as the offer it is: 1,500,000 CNGN left at 1,500 CNGN per USDC, the token taken in, the chain it fills on, and how long is left on the clock.

Amounts are whole tokens throughout, never the orderbook's 1e18. The operator states 1000 and reads 1,000 back. fromScaled is the only place the scale is handled.

The badge answers "is this actually working", which the status column alone does not:

  • open with a commitment is On the book.
  • open with no commitment is Posting, because the row is live before the orderbook has answered.
  • open carrying a lastError stays On the book but turns amber and shows the refusal, since the row stays open and the next cycle tries again.
  • resizing is Resizing, a fill being settled.
  • cancelled, expired, filled and rejected say so plainly.

What it does

Posting an order asks for the two amounts, in whole tokens, and shows the rate they imply before anything is sent. The operator chooses amounts, not a rate. It also asks which chain the order fills on and which sources it accepts, defaulting to every chain the filler watches, since an order that accepts none is one the orderbook refuses outright.

Opening an order shows what is left of it, what live bids are holding against it, and the fills that took the difference. That is what makes a shrunken remaining explicable rather than a number that quietly moved. It can be cancelled from there while it is still live.

The list reloads every ten seconds and after every mutation. A posting lands, expires or is filled without the operator doing anything, so the page cannot be a snapshot of the moment it opened.

Validation

ui:check, ui:build and pnpm build are clean. The package suite is 851 passing, with the same 19 failures every branch in this stack has: they need RPC endpoints, a loopback alias this machine lacks, or live testnets.

Ten unit tests cover the display logic that carries the reasoning: scaling, which leg is paid out, the rate string, available flooring at zero, each badge case, and the expiry clock.

Left out on purpose

The Markets page stays. A [[pairs]] entry no longer gates matching, but it still decides which strategies boot, so removing it is a separate decision.

The page polls rather than subscribing. The server already emits limit-order:posted and limit-order:rejected on the socket feed, so moving the list onto it is a straightforward follow-up.

@dharjeezy
dharjeezy force-pushed the dami/simplex-limit-order-ui branch 2 times, most recently from 281ab18 to 31f0f53 Compare September 18, 2026 16:10
@dharjeezy
dharjeezy force-pushed the dami/simplex-orderbook-lifecycle branch from cb78b49 to f9b82d6 Compare September 18, 2026 16:30
@dharjeezy
dharjeezy force-pushed the dami/simplex-limit-order-ui branch from 31f0f53 to 535857f Compare September 18, 2026 16:30
@dharjeezy
dharjeezy force-pushed the dami/simplex-orderbook-lifecycle branch from f9b82d6 to 48a4b3e Compare September 18, 2026 16:51
@dharjeezy
dharjeezy force-pushed the dami/simplex-limit-order-ui branch from 535857f to 6cf90af Compare September 18, 2026 16:51
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from 48a4b3e to 8d44f6f Compare September 19, 2026 20:48
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from 6cf90af to 6783810 Compare September 19, 2026 20:48
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from 8d44f6f to fa88c70 Compare September 20, 2026 17:36
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from 6783810 to 045b9f0 Compare September 20, 2026 17:36
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from fa88c70 to 7b59179 Compare September 21, 2026 10:02
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from 045b9f0 to 8fd4f8a Compare September 21, 2026 10:02
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from 7b59179 to 056875e Compare September 21, 2026 11:09
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from 8fd4f8a to d60f81d Compare September 21, 2026 11:10
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from 056875e to 372f6ec Compare September 21, 2026 11:23
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from d60f81d to cebe9da Compare September 21, 2026 11:23
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from 372f6ec to ce72d78 Compare September 21, 2026 11:46
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from cebe9da to ddd66c9 Compare September 21, 2026 11:46
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from ce72d78 to 1b0189c Compare September 21, 2026 12:48
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from ddd66c9 to 0362d52 Compare September 21, 2026 12:48
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch from 1b0189c to 1ce37b6 Compare September 21, 2026 13:14
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from 0362d52 to 7087881 Compare September 21, 2026 13:14
@Wizdave97
Wizdave97 force-pushed the dami/simplex-orderbook-lifecycle branch 2 times, most recently from 354634c to 7089552 Compare September 21, 2026 13:28
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from 7087881 to 1a1b6e6 Compare September 21, 2026 13:28
Base automatically changed from dami/simplex-orderbook-lifecycle to main September 21, 2026 13:29
@Wizdave97
Wizdave97 force-pushed the dami/simplex-limit-order-ui branch from 1a1b6e6 to faf2a20 Compare September 21, 2026 13:29
@Wizdave97
Wizdave97 merged commit b6ec37c into main Sep 21, 2026
6 of 7 checks passed
@Wizdave97
Wizdave97 deleted the dami/simplex-limit-order-ui branch September 21, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants