feat: 勾选后价格实时刷新(WebSocket 推送 + 轮询兜底) - #2
Draft
patrick-eu wants to merge 3 commits into
Draft
patrick-eu wants to merge 3 commits into
patrick-eu wants to merge 3 commits into
Conversation
勾选 bin 后价格不再冻结:recompute/bookFor 增加 fresh 参数, 每 10 秒强制拉新订单簿重算(下单中暂停轮询),无需刷新整页。 submitLeg 填限价时也强制取最新 book,避免用 30s 缓存价挂偏。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
订阅 CLOB market 频道(勾选 bin × 当前方向的 token): book 快照直接入缓存,price_change 等事件标脏后 REST 重取, 250ms 防抖合并连发推送。订阅集变化即重连,掉线由兜底轮询自愈。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
问题
勾选 bin 后价格被锁定:
recompute()只在勾选/切方向/改份额时触发,且 book 有 30s 缓存。真实订单簿变动后面板不知道,要刷新整页才能跟上。修法
syncWS()自动重连submitLeg填限价时强制取最新 book,避免用缓存价挂偏验证
node --check content.js通过clob.test.js/cost.test.js全部 PASS🤖 Generated with Claude Code