One surface per crypto pair, with fuller pricing - #16
Merged
Merged
Conversation
The reported symptom was that /?pair=SOL-USD lacks pricing. It does have pricing — bid, ask, mid, spread, day high/low, previous close, all populated. What that URL lacks is the analysis, because it is the old in-app modal, not the page. Two views of the same pair had drifted apart: modal: Market, Technical, Order book (no analysis) page: Market, Technical, Analysis (no order book) So this collapses them instead of patching the modal. /?pair=X now permanently redirects to /crypto/X, the crypto modal is deleted, and the page gains the one section it was missing. The page also gains what neither had, which is the part that most deserves the name "pricing info" on a 24/7 asset — what it has been doing, not just what it costs right now: - change over 24h / 7d / 30d / 90d / 1y, each against a dated close - 52-week high and low, with the dates they occurred - session volume in the quote currency Computed from the daily bars already fetched for the indicators, so no extra upstream call and no second vendor. A period with less history than it needs reports "—" and says why: measuring 1y from the oldest of four months of bars would be a claim about time we cannot see. Market capitalisation, circulating supply and all-time high are absent for the same reason — Alpaca does not carry them, and deriving them means inventing a supply figure. The page names those gaps rather than leaving them silent. The deep-link redirect lives in src/crypto/routes.ts rather than inline in the server so it is testable and the pair grammar stays in one place; it accepts every spelling the other routes do, and falls through rather than 301-ing an unknown pair into a 404. 453 tests pass (12 new), tsc clean, verified live: the redirect, the new sections, and every period figure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan55 finding(s) HIGH/CRITICAL: 5 | MEDIUM: 50
…and 5 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
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 free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The URL you sent —
/?pair=SOL-USD#crypto— is the old in-app modal, not the page. I rendered it against prod to check: it does have pricing (bid $72.44, ask $72.64, mid, 22.1 bps spread, day high/low, previous close, venue volume — no empty fields). What it lacks is the Analysis.Two views of the same pair had drifted apart:
/?pair=)/crypto/:pair)Rather than patch the modal — the thing you already told me to stop using — this collapses them into one surface.
Changes
/?pair=X→ 301 →/crypto/X. The crypto modal is deleted (~5.9k of JS gone).Live for SOL/USD:
plus the 52-week high/low with the dates they occurred, and session volume in the quote currency ($22,059.29). All computed from the daily bars already fetched for the indicators — no extra upstream call, no second vendor.
Where it refuses to answer
—and says why. Measuring 1y from the oldest of four months of bars would be a claim about time we cannot see.Verification
tsc --noEmitclean/?pair=SOL-USD→ 301), an unknown pair falling through to the app rather than 301-ing into a 404, and every new section rendering with real figuresThe redirect lives in
src/crypto/routes.tsrather than inline inserver.tsso it is testable and the pair grammar stays in one place.🤖 Generated with Claude Code