feat(solana-solvers): PR 4 solve loop + order handling + engine wiring - #4656
Conversation
…ices, lookup tables)
…tching driver spec
…cu_estimate assertion
297f53b to
fff19ba
Compare
fff19ba to
966cb9c
Compare
966cb9c to
72867ba
Compare
|
@squadgazzz Should we assume that account is implicitly derived as the solver's ATA? |
@tilacog, yes. Jupiter's swap API has no source-account parameter, the route always spends from userPublicKey's ATA for the input mint, and only the destination can be overridden (we use that to deliver into the buy-mint buffer). Since I'll add a doc comment on |
…lve-loop # Conflicts: # Cargo.lock # crates/solana-solvers/Cargo.toml # crates/solana-solvers/src/dto/mod.rs # crates/solana-solvers/src/dto/order.rs # crates/solana-solvers/src/lib.rs
Description
PR 4 of the Jupiter solver plan (after #4632, #4635, #4637, #4652): make
/solvereturn real solutions. Until now the handler took an auction and answered with an empty list. This wires the existing pieces (the/solveendpoint from PR1, the Jupiter adapter from PR2, solution assembly from PR3) into a working solve loop.For each order the solver asks Jupiter for a swap and turns it into a single-order solution, quoting all orders at once. Buys (when disabled) and orders Jupiter cannot route drop out with no candidate, and the rest of the auction still returns solutions. A full Jupiter outage yields an empty solution set, not a crash.
Stacked on PR3 (#4652).
Changes
domain::solver: the solve loop, plus aQuoteseam overDexso the loop is testable without the network. It quotes every order concurrently and maps each routable swap into aSolution, leaving out buys and orders Jupiter cannot route.domain::auction: the inbound/solveauction DTO (id, taker, orders). Proposed shape, since the driver spec pins the response and not the request./solvenow runs the loop and returns the solutions.run.rsbuilds the JupiterDexfrom config and hands it to the API.OrderUidgainsFromStr(hex) so it parses inbound, andSidegainsDeserialize.How to test
New unit tests.