Skip to content

feat(chart): show the core's manual entry price correction (MoonBot 7.73 N2) - #1489

Merged
guyverino merged 2 commits into
mainfrom
feat/chart-entry-range
Nov 26, 2026
Merged

guyverino merged 2 commits into
mainfrom
feat/chart-entry-range

Conversation

@guyverino

Copy link
Copy Markdown
Collaborator

What & why

MoonBot 7.73 N2 corrects a manual entry price that falls outside the exchange's limits, and reports it as Event::EntryPriceCorrection (requested price, min and max; at most one per 2 s). The terminal shows it on the chart of that core and market, as MoonBot does: the allowed range as a band, the requested price as a line with its caption, faded out over 3 s.

  • feed: FeedMsg::EntryPriceCorrections; the per-core store keeps the latest notice per market and prunes stale ones.
  • moon_chart::entry_range decides the look once (band, line, caption, 12 fade steps over 3 s) and every backend draws it through the existing order zone/line buffers, so DX11, Metal and wgpu share one copy.
  • A one-shot panel timer drives the fade and the expiry; after it the chart needs no further wake.
  • MOON_SYNTH_ENTRY_CORRECTION_EVERY_SEC injects corrections on the synthetic core (documented in tools/README.md).

Notable decisions

  • No band when the core sends no bound on either side (0 = no bound); only the line.
  • The caption is hidden when the requested price is off-screen.

Known limitations

  • At MoonBot's 20 % alpha the band is faint on the dark theme.
  • Render cost, measured with channels.render: idle 1 present / 0 bake per second; during the 3 s fade about 4–5 presents and bakes per second; back to 1 / 0 after it.

Issues

None of the open issues tracks this.

How to verify

cargo build -p moon-ui-gpui --bin moonterminal --target x86_64-pc-windows-msvc --all-targets
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings
cargo test --workspace --target x86_64-pc-windows-msvc

Local, after the rebase on ecffeef09: fmt --check exit 0, build --all-targets exit 0, clippy --workspace --all-targets --locked -D warnings zero warnings, cargo test --workspace 10608 passed / 0 failed, doc-tests green.

….73 N2)

The core sends Event::EntryPriceCorrection when a manual entry price hit an exchange limit. The feed maps it to FeedMsg::EntryPriceCorrections, the per-core store keeps the latest notice per market, and the chart of that core and market draws the allowed range as a band, the requested price as a line with its caption, faded in 12 steps over 3 s. The look is decided once in moon_chart::entry_range and drawn through the existing order zone/line buffers, so DX11, Metal and wgpu share it. A one-shot panel timer drives the fade and the expiry, after which the chart needs no further wake. MOON_SYNTH_ENTRY_CORRECTION_EVERY_SEC injects corrections on the synthetic core.
@guyverino
guyverino merged commit 19127d0 into main Nov 26, 2026
12 checks passed
@guyverino
guyverino deleted the feat/chart-entry-range branch November 26, 2026 11:13
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.

1 participant