fix(crypto-tail): 周期切换时按周期拉取 tokenIds,修复手动下单 orderbook 不存在
- 后端 initMonitor 支持可选 periodStartUnix,按指定周期取市场与 tokenIds - 前端周期切换时调用 monitorInit 传入 pushPeriod,确保 tokenIds 与当前周期一致 - 修复切换周期无变化及手动下单报 orderbook does not exist Made-with: Cursor
This commit is contained in:
@@ -5,7 +5,9 @@ package com.wrbug.polymarketbot.dto
|
||||
*/
|
||||
data class CryptoTailMonitorInitRequest(
|
||||
/** 策略ID */
|
||||
val strategyId: Long = 0L
|
||||
val strategyId: Long = 0L,
|
||||
/** 指定周期开始时间 (Unix 秒),不传则用服务器当前周期 */
|
||||
val periodStartUnix: Long? = null
|
||||
)
|
||||
|
||||
/**
|
||||
|
||||
+2
-1
@@ -147,7 +147,8 @@ class CryptoTailMonitorService(
|
||||
|
||||
val account = accountRepository.findById(strategy.accountId).orElse(null)
|
||||
val nowSeconds = System.currentTimeMillis() / 1000
|
||||
val periodStartUnix = (nowSeconds / strategy.intervalSeconds) * strategy.intervalSeconds
|
||||
val periodStartUnix = request.periodStartUnix
|
||||
?: ((nowSeconds / strategy.intervalSeconds) * strategy.intervalSeconds)
|
||||
|
||||
// 获取市场信息
|
||||
val slug = "${strategy.marketSlugPrefix}-$periodStartUnix"
|
||||
|
||||
Reference in New Issue
Block a user