Skip to content

feat(spreads): expose spreadPct alongside spreadBps for easier display - #178

Merged
Miracle656 merged 1 commit into
Miracle656:mainfrom
sadiquhammedabubakar-art:feat-spreads-pct-field
Sep 30, 2026
Merged

Miracle656 merged 1 commit into
Miracle656:mainfrom
sadiquhammedabubakar-art:feat-spreads-pct-field

Conversation

@sadiquhammedabubakar-art

@sadiquhammedabubakar-art sadiquhammedabubakar-art commented Sep 25, 2026 •

Copy link
Copy Markdown

Overview

Adds a spreadPct field to each venue in the /spreads/:asset response, alongside the existing spreadBps, so clients can render a percentage without converting.

Closes #93

Changes

  • src/routes/spreads.ts: add spreadPct: number to the VenueSpread interface and compute it as ((ask - bid) / mid) * 100 — the same mid-referenced formula as spreadBps, just scaled to percent.
  • src/__tests__/spreads.test.ts: asserts spreadPct === spreadBps / 100 and that bid 99 / ask 101 yields 2%.

Verification

(Note: the original description on this PR was pasted from an unrelated project and has been replaced.)

@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@sadiquhammedabubakar-art 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

@Miracle656
Miracle656 merged commit 86ad3f1 into Miracle656:main Sep 30, 2026
1 check passed
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.

/spreads endpoint

2 participants