Skip to content

feat(solana-solvers): PR 1 crate skeleton, config, /solve scaffold#4632

Merged
squadgazzz merged 6 commits into
mainfrom
solana-solvers/PR1-skeleton
Jul 17, 2026
Merged

feat(solana-solvers): PR 1 crate skeleton, config, /solve scaffold#4632
squadgazzz merged 6 commits into
mainfrom
solana-solvers/PR1-skeleton

Conversation

@squadgazzz

@squadgazzz squadgazzz commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

First PR of the Jupiter solver: a new solana-solvers crate that hosts the /solve API. It mirrors the crates/solvers shape over Solana-native types without reusing the EVM code, which is typed end to end on EVM primitives (U256, 20-byte Address, 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

  • New crates/solana-solvers binary crate (main/lib/run/cli), an axum HTTP server with /healthz and /solve.
  • Subcommand CLI (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.
  • /solve is a scaffold: it accepts any auction and returns {"solutions": []}, so the driver wiring can be exercised before real quoting lands.
  • Config: a [dex] table for the Jupiter backend (endpoint, api-key, slippage) with deny_unknown_fields, plus config/example.jupiter.toml.
  • Lean dependency set (axum, clap, observe, serde, tokio, url). No EVM deps pulled in.

How to test

New unit tests (config parse plus unknown-key rejection).

Notes

@squadgazzz
squadgazzz marked this pull request as ready for review July 16, 2026 15:11
@squadgazzz
squadgazzz requested a review from a team as a code owner July 16, 2026 15:11
@claude

claude Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Claude finished @squadgazzz's task in 3m 28s —— View job


PR Review: solana-solvers skeleton

I reviewed the new solana-solvers crate against the existing crates/solvers conventions.

Overall this is a clean, well-documented skeleton — CLI/logging/shutdown mirror crates/solvers, the /solve scaffold and config parsing are sensible, and the config tests cover the happy path and deny_unknown_fields. The RequestBodyLimit + DefaultBodyLimit::disable() ordering is correct (and actually applied to the routes properly, unlike the reference).

A few minor items posted as inline comments — none blocking:

  • Read all changed files + compared with crates/solvers
  • Verified layer ordering, observe config, deps
  • Posted inline findings

Findings (all low severity):

  1. Cargo.tomlanyhow, thiserror, tower declared but unused; tower-http's trace feature enabled but no TraceLayer wired.
  2. api.rs — no distributed-tracing span middleware or /metrics route (reference has both); OK to defer, but worth a note.
  3. config.rsslippage as String defers validation to quote time.

Comment thread crates/solana-solvers/Cargo.toml Outdated
Comment thread crates/solana-solvers/src/api.rs
Comment thread crates/solana-solvers/src/config.rs Outdated
@squadgazzz
squadgazzz force-pushed the solana-solvers/PR1-skeleton branch from a061fa2 to 6dccbfb Compare July 17, 2026 08:55
@linear-code

linear-code Bot commented Jul 17, 2026

Copy link
Copy Markdown

BE-102

@tilacog tilacog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just left a few notes and questions.

Comment on lines +12 to +13
# Buy orders quote via Jupiter ExactOut, which is route-limited. Off by default.
enable-buy-orders = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +41 to +47
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()))
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this needs to be async.
I think not, but I don't have a strong opinion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It reads from a file, so it is an I/O operation. Also, it mirrors the EVM solvers implementation:

let data = fs::read_to_string(path)
.await
.unwrap_or_else(|e| panic!("I/O error while reading {path:?}: {e:?}"));

Comment on lines +53 to +57
#[cfg(windows)]
async fn shutdown_signal() {
// Signal handling is not supported on Windows.
std::future::pending().await
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised we care for windows builds.
Nice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it was some third-party contribution to this, IIRC.

@squadgazzz
squadgazzz added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit f6b2ffc Jul 17, 2026
22 checks passed
@squadgazzz
squadgazzz deleted the solana-solvers/PR1-skeleton branch July 17, 2026 17:23
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 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