feat(solana-solvers): PR 1 crate skeleton, config, /solve scaffold#4632
Conversation
|
Claude finished @squadgazzz's task in 3m 28s —— View job PR Review: solana-solvers skeletonI reviewed the new Overall this is a clean, well-documented skeleton — CLI/logging/shutdown mirror A few minor items posted as inline comments — none blocking:
Findings (all low severity):
|
a061fa2 to
6dccbfb
Compare
tilacog
left a comment
There was a problem hiding this comment.
LGTM. Just left a few notes and questions.
| # Buy orders quote via Jupiter ExactOut, which is route-limited. Off by default. | ||
| enable-buy-orders = false |
There was a problem hiding this comment.
This option being set to false means the Solver won't solve any buy order?
(I'm not familiar w/ that "ExactOut" thing, I'll do my research later)
There was a problem hiding this comment.
Yes, the buy orders routing is marked as limited in the API. Also, it is a part of the deprecated Jupiter V1 API. We have the same option for other EVM DEX solvers.
| pub async fn load(path: &Path) -> Config { | ||
| let text = tokio::fs::read_to_string(path) | ||
| .await | ||
| .unwrap_or_else(|err| panic!("read config {}: {err}", path.display())); | ||
| toml::from_str(&text).unwrap_or_else(|err| panic!("parse config {}: {err}", path.display())) | ||
| } | ||
|
|
There was a problem hiding this comment.
I'm wondering if this needs to be async.
I think not, but I don't have a strong opinion.
There was a problem hiding this comment.
It reads from a file, so it is an I/O operation. Also, it mirrors the EVM solvers implementation:
services/crates/solvers/src/infra/config/dex/file.rs
Lines 137 to 140 in cfbec98
| #[cfg(windows)] | ||
| async fn shutdown_signal() { | ||
| // Signal handling is not supported on Windows. | ||
| std::future::pending().await | ||
| } |
There was a problem hiding this comment.
I'm surprised we care for windows builds.
Nice.
There was a problem hiding this comment.
Yeah, it was some third-party contribution to this, IIRC.
Description
First PR of the Jupiter solver: a new
solana-solverscrate that hosts the/solveAPI. It mirrors thecrates/solversshape over Solana-native types without reusing the EVM code, which is typed end to end on EVM primitives (U256, 20-byteAddress, single-call calldata) with no chain abstraction. This PR is the skeleton. The Jupiter adapter, solution assembly, and solve loop land in the following PRs.Changes
crates/solana-solversbinary crate (main/lib/run/cli), an axum HTTP server with/healthzand/solve.solana-solvers jupiter --config ...), so a Solana baseline engine can slot in later.observe-based logging (JSON option, panic hook) and graceful shutdown on SIGTERM/SIGINT./solveis a scaffold: it accepts any auction and returns{"solutions": []}, so the driver wiring can be exercised before real quoting lands.[dex]table for the Jupiter backend (endpoint, api-key, slippage) withdeny_unknown_fields, plusconfig/example.jupiter.toml.How to test
New unit tests (config parse plus unknown-key rejection).
Notes