feat(buy-sol) PR 1: route native SOL buys to solvers as wSOL - #4985
Merged
Merged
Conversation
squadgazzz
marked this pull request as ready for review
September 28, 2026 15:04
Contributor
|
Claude finished @squadgazzz's task in 3m 8s —— View job Review
I traced the full path and this change is clean and well-scoped. No blocking issues found — I'm not posting inline comments because I didn't find anything that should lead to a change. What I verified
Non-blocking notes (already covered by the PR / BE-330, no action needed)
Overall: LGTM. Good comments and test coverage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Program v0.4.1 lets an order buy native SOL. The intent puts the System Program ID where the buy mint goes. Solvers only swap into token accounts, so a native SOL buy passed through as-is gives them a buy token they can't route.
So the driver hands solvers a wSOL buy instead, with the taker's wSOL ATA as the destination. The output can't go to the wSOL buffer PDA, because
FinalizeSettlepays a native buy out of the state PDA and the program can't unwrap the buffer into it. Unwrapping the wSOL and funding the state PDA at settle time is BE-330.Native SOL buys still can't reach
/solve, since the orderbook rejects them at creation and the autopilot cut drops orders whose payout account isn't a token account. So only quotes change for now.Changes
buyMintand the taker's wSOL ATA asbuyDestination/quoterejects selling wSOL for native SOL withQuoteSameTokens, the same rule EVM applies to WETH and ETH inis_same_buy_and_sell_tokenHow to test
New unit and API tests.
Related issues
BE-329