Skip to content

feat(solana-orderbook) PR02: GET order endpoint with fill state - #4764

Open
squadgazzz wants to merge 9 commits into
mainfrom
solana-orderbook/be-223-get-order
Open

feat(solana-orderbook) PR02: GET order endpoint with fill state#4764
squadgazzz wants to merge 9 commits into
mainfrom
solana-orderbook/be-223-get-order

Conversation

@squadgazzz

@squadgazzz squadgazzz commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

GET /api/v1/orders/{uid} serves one order with its fill state, mostly for the explorer. Unknown uid answers 404, a malformed one 400.

The path sits under /api/v1 so the route shapes match the EVM orderbook.

Changes

  • GET /api/v1/orders/{uid}: a read joining solana.orders with solana.order_pda, plus the wire DTO with the status derivation

How to test

New unit tests and a Postgres test for the query.

@linear-code

linear-code Bot commented Aug 20, 2026

Copy link
Copy Markdown

BE-223

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

claude Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

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


PR Review: GET order endpoint with fill state

Reviewed the endpoint, DB read, and status derivation. This is a clean, tightly-scoped PR — the status precedence (fulfilled → cancelled → expired → open) matches the EVM orderbook's derivation in orderbook/src/database/orders.rs, the >= fill check correctly handles the reclaim-after-fill case called out in the comment, and error mapping (400 / 404 / 500) is right. Wire shape (camelCase, base58 pubkeys, 0x-hex uid/appData) mirrors the EVM route.

One minor inline comment posted:

  • status() fill match — the _ arm silently classifies unknown kinds as buy, and the buy-side branch is untested. See inline →

Nothing blocking. Nice work.

  • Read the changed files
  • Analyze DB query and status derivation
  • Post inline findings
  • Post summary

Comment thread crates/solana-orderbook/src/infra/api/routes/order/dto.rs Outdated
@squadgazzz
squadgazzz requested a review from a team as a code owner August 21, 2026 10:50
@github-actions

Copy link
Copy Markdown

Reminder: Please consider backward compatibility when modifying the API specification.
If breaking changes are unavoidable, ensure:

  • You explicitly pointed out breaking changes.
  • You communicate the changes to affected teams (at least Frontend team and SAFE team).
  • You provide proper versioning and migration mechanisms.

Caused by:

Comment thread crates/solana-orderbook/src/infra/api/routes/order/dto.rs Outdated

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.

did you run this through one of those openapi spec validators?
the existing one would be quite a PITA to fix but we could start with this one from the get go to get higher quality specs

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, swagger-cli validate plus spectral lint. Also, added to CI. Later, I'll probably add utopia to finally generate the file.

Comment thread crates/solana-orderbook/src/infra/db.rs
Comment thread crates/solana-orderbook/src/infra/api/routes/order/mod.rs Outdated
Comment thread crates/solana-orderbook/src/infra/api/routes/order/dto.rs Outdated
Comment thread crates/solana-orderbook/src/infra/api/routes/order/dto.rs Outdated
Comment thread crates/solana-orderbook/src/infra/api/routes/order/dto.rs Outdated
@squadgazzz
squadgazzz requested a review from jmg-duarte August 21, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants