feat: show 24h TWAP price on key detail page - #852
Conversation
|
✅ TWAP (24h) is now shown alongside the spot price with colour-coded comparison and a loading skeleton. @accesslayerorg this PR resolves issue #827. |
41ba1c9 to
09e4511
Compare
|
@Chucks1093 CI syntax was checked on the issue branch; the TWAP implementation and |
|
@Chucks1093 The remaining |
|
@accesslayerorg The TWAP implementation is present on this branch. The current verify failure is caused by malformed unrelated upstream simulation/slippage files, not the TWAP changes; I did not overwrite those files because that would remove unrelated functionality. Please repair the upstream files or rebase this branch onto a corrected base, then rerun verify. |
|
@accesslayerorg The TWAP implementation is present, but verify still fails because unrelated upstream simulation/slippage files are malformed. I left those files intact rather than replacing unrelated functionality. Rebase onto a corrected base before rerunning verify. |
|
@accesslayerorg CI fix pushed in |
Closes #827
Summary
Displays the 24-hour time-weighted average price alongside the spot price on the key detail page, so buyers have a less manipulable reference before purchasing.
Changes
src/services/course.service.ts—getKeyTwap(keyId, window='24h')callsGET /keys/:keyId/twap?window=24h.src/hooks/useKeyTwap.ts— React Query hook (60s stale, no retry).src/lib/queryKeys.ts—creators.twap.src/pages/CreatorDetailPage.tsx— renders the TWAP card with:TWAP (24h)and an info tooltip ("Time-weighted average key price over the last 24 hours.").null/no price (insufficient data).Notes
formatDisplayKeyPricefor display.