fix: capture position-increase fills and debounce slow multi-fill aggregation

- Gate opening fills on Hyperliquid's dir field (Open Long/Short) instead of
  start_position == 0, so adds to an existing position are no longer dropped
- Replace the fixed 500ms aggregation window with a 3s per-fill debounce
  (generation counter) so late fills of the same oid are not truncated
- Carry real start_pos/end_pos on PositionTradeEvent and distinguish
  Open vs Increase actions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
0xcathiefish
2026-07-05 08:29:18 +00:00
parent bba06206ab
commit 3f7a16aa45
2 changed files with 68 additions and 20 deletions
+5
View File
@@ -4,6 +4,11 @@
格式遵循 Keep a Changelog,版本号遵循 SemVer。
## [Unreleased]
### Fixed
- 修复加仓成交被静默忽略的问题:开仓判断从 `start_position == 0` 改为使用 Hyperliquid 的 `dir` 字段(`Open Long` / `Open Short`),已有持仓时的加仓现在也会写入 Notion。
- 修复同一订单(`oid`)慢速多笔成交被截断的问题:聚合由「首笔成交后固定 500 毫秒窗口」改为「3 秒防抖」,每笔新成交重置计时器,静默 3 秒后才汇总发送,避免写入的数量小于实际成交量。
- `PositionTradeEvent` 现在携带真实的 `start_pos` / `end_pos`,并区分 `Open`(从零开仓)与 `Increase`(加仓)动作。
### Added
- 支持对接 TradeSnap 截图服务,自动抓取新交易对应的 TradingView 图表快照。
- 新增 `ENABLE_SCREENSHOT``TRADESNAP_URL` 配置,控制截图的开关和请求地址。