Skip to content

feat: carry the fill price on the dashboard trade [RAI-3101] - #1693

Open
JuaniRios wants to merge 1 commit into
rai-2998-board-commandsfrom
rai-2998-trade-price
Open

JuaniRios wants to merge 1 commit into
rai-2998-board-commandsfrom
rai-2998-trade-price

Conversation

@JuaniRios

@JuaniRios JuaniRios commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Part of RAI-3101.

The dashboard trade now carries its fill price. Item 5 of the RAI-2998 stack, part 1 of 3. This is the minimal Trade.price part of #1657.

Live effect: v3 trade payloads (/trades and the WebSocket) gain a price field · Risk: low (older protocols keep their exact shape, and the SPA treats a missing price as null) · Ships: with the next bot release

Why

The liq_trade log line (item 5, a later PR) needs the price of each terminal trade. I took the price from #1657 without its inventory and settings DTO changes.

Decisions

  • price: Option<Usd>. It is the onchain price_usdc, or the broker fill price for a filled counter-trade. A failed or cancelled counter-trade has None, even if it kept a partial fill.
  • Only terminal_outcomes_v3 carries it. Legacy, v1, and v2 responses stay byte for byte the same, so an older dashboard bundle does not break.
  • The SPA parser accepts a missing price as null and rejects a non-positive or non-decimal value.
  • Nothing reads the field yet in this stack. Its reader is the deferred liq_trade line. I kept it here so the later PR stays small. lmk if you'd rather hold this one until then.

Proof

  • Rust tests pin the v3 price, the null for failed and cancelled trades, the older protocols without a price, and a persisted payload from before the field.
  • Dashboard: vitest (402 tests), svelte-check, and eslint pass.
  • cargo nextest run -p st0x-hedge -p st0x-config passes on the top of this stack.
  • Not verified: a live dashboard on staging reading the new field.

Merge conditions

Same as the stack below.

@linear-code

linear-code Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

RAI-2998

RAI-3063

RAI-3101

@JuaniRios
JuaniRios requested a review from agryaznov October 9, 2026 00:31
@JuaniRios JuaniRios self-assigned this Oct 9, 2026
@JuaniRios JuaniRios changed the title feat(dto): carry the fill price on the dashboard trade [RAI-2998] Carry the fill price on the dashboard trade Oct 9, 2026
This was referenced Oct 9, 2026

JuaniRios commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label add-to-gt-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@JuaniRios

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@JuaniRios
JuaniRios force-pushed the rai-2998-trade-price branch from cea7c7e to 7618826 Compare October 9, 2026 23:39
@JuaniRios
JuaniRios force-pushed the rai-2998-board-commands branch from 6f1e4b7 to 74bc9ab Compare October 10, 2026 01:15
@JuaniRios
JuaniRios force-pushed the rai-2998-trade-price branch from 7618826 to 0fa27ba Compare October 10, 2026 01:15
@JuaniRios
JuaniRios force-pushed the rai-2998-board-commands branch from 74bc9ab to 648fe13 Compare October 10, 2026 01:58
@JuaniRios
JuaniRios force-pushed the rai-2998-trade-price branch 2 times, most recently from 0102b1d to cf5a276 Compare October 10, 2026 02:39
@JuaniRios
JuaniRios force-pushed the rai-2998-board-commands branch from 648fe13 to 4e86ddd Compare October 10, 2026 02:39
@JuaniRios
JuaniRios force-pushed the rai-2998-trade-price branch from cf5a276 to a85d528 Compare October 10, 2026 03:14
@JuaniRios
JuaniRios force-pushed the rai-2998-board-commands branch from 4e86ddd to 7261692 Compare October 10, 2026 03:14
@JuaniRios
JuaniRios force-pushed the rai-2998-trade-price branch from a85d528 to 956c7ac Compare October 10, 2026 04:11
@JuaniRios
JuaniRios force-pushed the rai-2998-board-commands branch from 7261692 to 7f37a41 Compare October 10, 2026 04:11
This was referenced Oct 10, 2026

This branch has not been deployed

No deployments
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