Skip to content

feat(solana-solvers): report uniform clearing prices in engine solutions - #4763

Merged
squadgazzz merged 3 commits into
mainfrom
solana-solvers/engine-clearing-prices
Aug 20, 2026
Merged

feat(solana-solvers): report uniform clearing prices in engine solutions#4763
squadgazzz merged 3 commits into
mainfrom
solana-solvers/engine-clearing-prices

Conversation

@squadgazzz

Copy link
Copy Markdown
Contributor

Description

The engine wire reports one executed amount per trade and nothing else, so the driver cannot know the trade's other leg and currently answers the autopilot with a zero placeholder that the ranking math rejects (discussed on #4759). The EVM engine wire solves this with uniform clearing prices per solution, and the Jupiter engine already holds both numbers: the quote's in and out amounts.

This adds the EVM-shaped prices map to the engine's solution DTO, oriented like the EVM solvers build it: the sell mint maps to the amount bought, the buy mint to the amount sold. The driver ignores unknown fields today, so this lands independently, and the driver-side consumption (deriving the counterpart leg and dropping the zero placeholder) follows in the driver's own PR.

Changes

  • Engine solutions carry prices (mint to amount, decimal strings on the wire), populated from the executed swap's two amounts

How to test

Updated unit tests.

@squadgazzz
squadgazzz marked this pull request as ready for review August 20, 2026 13:43
@squadgazzz
squadgazzz requested a review from a team as a code owner August 20, 2026 13:43
@squadgazzz squadgazzz changed the title feat(solana-solvers) report uniform clearing prices in engine solutions feat(solana-solvers): report uniform clearing prices in engine solutions Aug 20, 2026
@claude

claude Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Claude finished @squadgazzz's task in 1m 44s —— View job


PR Review

  • Read changed file & PR diff
  • Analyze correctness of prices mapping and wire format
  • Check test coverage
  • Post findings

The prices mapping itself looks correct and matches the EVM orientation described (sell mint → amount bought, buy mint → amount sold), and the SameMint/ZeroAmount guards ensure two distinct, non-zero entries.

One issue found — the wire_format_is_stable test will now fail. prices is serialized unconditionally (no skip_serializing_if), but that test's exact assert_eq! on the full JSON wasn't updated to include the new key. Details and a suggested fix are in the inline comment.

I couldn't run cargo nextest/cargo check here (sandbox blocks compilation), so this is from static analysis — please confirm the test result locally.

Comment thread crates/solana-solvers/src/dto/solution.rs
@squadgazzz
squadgazzz added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit 9e79641 Aug 20, 2026
23 checks passed
@squadgazzz
squadgazzz deleted the solana-solvers/engine-clearing-prices branch August 20, 2026 14:22
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants