Skip to content

Fix: precision loss and add quote/solver endpoints - #155

Open
Macnelson9 wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
Macnelson9:fix/all-four-issues
Open

Fix: precision loss and add quote/solver endpoints#155
Macnelson9 wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
Macnelson9:fix/all-four-issues

Conversation

@Macnelson9

Copy link
Copy Markdown

Summary

Solves all 4 remaining issues in the quote and solver registration flow:

  • Fix precision loss in quote() by using BigInt instead of Number()
  • Persist quotedDstAmount when a quote is requested for an intent
  • Add GET endpoint to retrieve an intent's last quote
  • Add POST endpoint for solver registration with validation

Issues Closed

closes #67
closes #68
closes #69
closes #70

Testing

✅ All lint checks pass
✅ Type checking passes
✅ Unit tests pass (18/18)
✅ E2E tests pass (29/29 - includes new tests for large amounts, quote persistence, and solver registration)

Changes

- Rework quote() math to use BigInt instead of Number() for srcAmount
- Apply variance as scaled integer multiplier (992-1000/1000) instead of decimal
- Add precision test for 18-decimal token amounts (1e24)

feat: persist quotedDstAmount when a quote is requested for an intent

- Add optional intentId to QuoteRequestDto
- Update quote() to persist best quote to intent record when intentId provided
- Add test verifying quotedDstAmount persists and is queryable

feat: add endpoint to retrieve an intent's last quote

- Add GET /api/v1/intents/:id/quote endpoint
- Returns 404 if no quote has been persisted for the intent
- Add tests for quote retrieval and not-found case

feat: add POST endpoint for solver registration

- Create RegisterSolverDto with validation (address, name, bondAmount, avgFillTime, supportedChains, supportedTokens)
- Add POST /api/v1/solvers handler in SolversController
- Initialize new solvers as active with zero fills and volume
- Add tests for successful registration and validation failures

closes stellar-vortex-protocol#67
closes stellar-vortex-protocol#68
closes stellar-vortex-protocol#69
closes stellar-vortex-protocol#70
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Macnelson9 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant