Improve order endpoint trade lookup#109
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR refactors the order trades endpoint to fetch trades by order hashes through the ChangesOrder Trades Query Refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
How to use the Graphite Merge QueueAdd the label add-to-gt-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
db8d0c8 to
0875f73
Compare
6ef2cb1 to
b4fac6d
Compare
b4fac6d to
f4de41e
Compare

Dependent PR
Stacked on #108,
feature/rai-581-preview-api-infrastructure.Motivation
GET /v1/order/{order_hash}was the biggest confirmed endpoint latency issue in the benchmark pass. The production path was observed around 30-40s for a real order hash, which made the endpoint unsuitable for normal interactive use.Solution
order.get_trades_list(...)toclient.get_trades_by_order_hashes(...).Benchmark Notes
Order hash used:
0x55c8f34ab380147ee98450e145f32c5dda080a4c6c9ad45206267048a3b475bfObserved before this change:
order.get_trades_list(...)path against a ready local DB: roughly 10-11s.Observed with this change against the current production registry bootstrap DB:
Follow-up investigation showed direct SQLite trade SQL itself is fast, so remaining latency is likely SDK enrichment work rather than missing indexes:
order.get_quotes(...)Checks
nix develop -c cargo fmtnix develop -c rainix-rs-staticNeed help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit