101: EMC Perps - show Phoenix TWAP progress and time until next suborder

This commit is contained in:
2026-10-24 19:11:50 +02:00
parent 28640f3203
commit dab55e19ed
21 changed files with 712 additions and 32 deletions
@@ -0,0 +1,61 @@
# Verification — issue #101
Verified locally on 2026-10-24. No Hub restart, deployment, signing, trading,
commit or push was performed. Existing unrelated staged/deleted OpenSpec files
were preserved.
## Build
`JAVA_HOME=/usr/local/software/java/jfx-25 ./gradlew build` succeeded.
All 42 existing tests passed, with zero failures/errors. No permanent tests were
added; focused harnesses and screenshots are temporary files under `/tmp`.
## Focused integration checks
`Issue101Check` passed 48 checks covering:
- Explicit, legacy, absent and invalid dust metadata; exact total/next/fill quantities.
- Positive fills required even on existing positions; no order-only synthetic rows.
- Same-symbol Cross/isolated matching, authority/PDA/asset mismatch and duplicate rejection.
- Invalid counters, completed observations, already-due timing, expiry before completion and overflow.
- Missing marks preserving token amounts and propagating unknown price-dependent totals.
- One TWAP and one mark request for two same-market positions; no extra reads for empty wallets.
- HTTP/TWAP failures retaining the complete prior venue observation, original timestamp and independent Jupiter refresh.
- Snapshot reads without I/O, recovery clearing absent/unfilled TWAPs, and shared 429 cooldown without immediate retry.
- Decoding captured real Phoenix data, including the BTC order with 236 smaller children out of 237 total executions.
## JavaFX and visual inspection
`Issue101Preview` passed 33 checks. Inspected the actual rendered table and tooltip:
nine columns; visible progress and overlaid `≈ 28:32:10` / `≈ 128:32:10`; blank
groups/Jupiter/non-TWAP cells; missing USD values; due/retained labels; tooltip fields;
clearing recycled cell graphics/tooltips; preserved selection/expansion; horizontal
scrolling at small widths. Temporary captures are under `/tmp/issue101-check/`.
## Read-only live check
At 2026-10-24 17:07:27–17:08:03 UTC, the real adapter returned 32 positions and 32
active filled TWAPs for the checked PROD wallet and no positions for TEST. Only GET
requests were used, with existing pacing/timeouts. Observed SOL order: 890/1779,
17.79 SOL total and 0.01 SOL next. Observed BTC order: 119/237, 0.0238 BTC total and
0.0001 BTC next. Marks were taken directly from Phoenix, with no Ticker dependency.
## Specifications and documentation
- All three deltas synced into existing main specs.
- Strict validation passed for `101-phoenix-twap-progress`, `phoenix-perps-service`,
`evelyn-perps-service` and `evelyn-perps-overview`.
- Project/shared documentation links and `git diff --check` passed.
- Checking the entire existing index still reports three trailing-blank-line warnings
in the unrelated, pre-existing staged issue #97 specs. The index check passes when
restricted to this change; those older files were not edited.
## Limits
The current nominal slot duration is 200 ms according to the Solana Foundation's
October 2026 update, superseding the old 400 ms assumption. Response receipt is only
an approximate time anchor. API lag, varying slot times and execution delays can
shift estimates, especially long completion estimates. Cell duration is explicitly
as of Updated and does not tick between snapshots. Progress counts child executions,
not guaranteed filled quantity. USD sizes are current approximate notionals before
fees. The existing polling cycle and live Hub were left unchanged.