You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EVM deprecated /api/v1/trades in favor of the paginated /api/v2/trades. The Solana trades route mirrored the deprecated shape: unpaginated, every fill of a busy owner in one response. Nobody has integrated it yet, so it moves straight to the v2 contract, /api/v2/trades with offset and limit, matching the EVM path and semantics.
Changes
The trades route moves to GET /api/v2/trades and accepts offset and limit with the EVM defaults and bounds (0 and 10, limit 1 to 1000), rejecting a bad limit with InvalidLimit
The trades query pages in SQL and returns newest first, like EVM v2
The openapi spec documents the new path and parameters
Compared against the EVM v2 trades implementation (get_trades_v2.rs / EVM openapi)
Reviewed the trades route, DB query, openapi, and tests
Posted inline findings
Verdict: Clean, well-scoped change that faithfully mirrors the EVM /api/v2/trades contract. Defaults/bounds (0, 10, 1..=1000), the InvalidLimit error message, validation ordering (short-circuit before DB access), the safe u64→i64 offset clamping, and SQL OFFSET/LIMIT on a deterministic ORDER BY all look correct. Tests cover both the paging behavior and the invalid-limit rejection. Since the v1 route was never integrated, moving straight to v2 is a reasonable non-breaking choice.
One minor, optional note posted inline:
openapi.yml documents the limit bounds only in prose; the EVM v2 spec also encodes minimum: 1 / maximum: 1000 in the schema. Adding them keeps the machine-readable contract in parity.
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
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
EVM deprecated
/api/v1/tradesin favor of the paginated/api/v2/trades. The Solana trades route mirrored the deprecated shape: unpaginated, every fill of a busy owner in one response. Nobody has integrated it yet, so it moves straight to the v2 contract,/api/v2/tradeswithoffsetandlimit, matching the EVM path and semantics.Changes
GET /api/v2/tradesand acceptsoffsetandlimitwith the EVM defaults and bounds (0 and 10, limit 1 to 1000), rejecting a bad limit withInvalidLimitHow to test
Updated unit and database tests.