Skip to content

Commit 4f496ed

Browse files
committed
feat: two-step candle gap repair (auto-fill ≤24h, then Kibana) + v1.0.3 bump
Complete the v1.0.3 version bump and implement the two-step candle gap repair in the market adapter. ## Two-Step Candle Gap Repair File: market_adapter/core/market_adapter_service.ts - Problem: Every missing candle queried Kibana, even when the native incremental fetch already confirmed no trades for short gaps. Empty Kibana responses also left writes suppressed indefinitely. - Impact: Unnecessary Kibana load; unresolved gap state could stall trigger/dynamic-grid writes permanently. - Solution: Step 1 auto-fills gaps ≤24 candles (trusted no-trade threshold) directly by synthesizing zero-volume candles — Kibana is redundant here since native fetch already verified no trades. Step 2 queries Kibana only for gaps beyond 24 candles. If Kibana returns empty, that IS verification of no trades, so all gaps in the queried window are synthesized. ## Version Bump 1.0.2 → 1.0.3 - Bumped version across all manifests: package.json, package-lock.json, claw/package.json, analysis/ama_fitting/package.json, claw/runtimes/openclaw-plugin/package.json, claw/runtimes/openclaw-plugin/openclaw.plugin.json, claw/tests/test_claw_mcp_transport.ts ## Test Updates File: tests/test_market_adapter_service.ts - Refactored testInternalNoTradeGapsAreSynthesizedWhenKibanaReturnsNoPatchData → testInternalNoTradeGapsAreAutoFilledWithinTrustedThreshold - Refactored testEmptyKibanaRepairOnlySynthesizesGapsInsideCappedRepairWindow → testEmptyKibanaResponseResolvesAllGapsInWindow - Adjusted testNativeIncrementalMergesKibanaActivityInsteadOfSilence and testKibanaGapRepairPatchesMissingCandles for new two-step flow - Added maxNativeGapFillCandles: 0 to config objects in gap-repair tests ## Documentation - market_adapter/README.md: documented STALE_TAIL_THRESHOLD_CANDLES constant and full two-step gap repair flow with auto-fill and Kibana-verified synthesis - docs/README.md, docs/EVOLUTION.md, docs/DEXBOT_COMPARISON.md, docs/FUND_MOVEMENT_AND_ACCOUNTING.md: version reference bumps ## Testing Notes - npm test should pass with refactored gap repair assertions - Key scenarios: within-threshold auto-fill, beyond-threshold Kibana query, empty Kibana → verified no-trade synthesis
1 parent 48599b2 commit 4f496ed

15 files changed

Lines changed: 130 additions & 92 deletions

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.0.3] - 2026-07-01 - Two-Step Candle Gap Repair
6+
7+
### 2026-07-01
8+
9+
- **Fix**: stop market adapter logs from duplicating into dexbot.log — watchdog spawned the adapter with stdout piped to dexbot.log, but the adapter already writes its own log file. Changed stdio to `'ignore'` and removed dead `outLog` parameter (`modules/launcher/market_adapter_watchdog.ts`, `unlock.ts`).
10+
- **Feat**: two-step candle gap repair in market adapter — auto-fill gaps ≤24 candles (trusted no-trade threshold) directly without Kibana, then query Kibana only for larger gaps. Empty Kibana response is now treated as verified no-trade instead of leaving gaps "unresolved" (`market_adapter/core/market_adapter_service.ts`).
11+
- **Chore**: version bumped to 1.0.3 across all manifests (`package.json`, `package-lock.json`, `claw/package.json`, `analysis/ama_fitting/package.json`, `claw/runtimes/openclaw-plugin/package.json`, `claw/runtimes/openclaw-plugin/openclaw.plugin.json`).
12+
- **Test**: refactored gap repair tests for two-step auto-fill flow (`tests/test_market_adapter_service.ts`).
13+
- **Docs**: corrected `disallowedDealIds` behavior (blocks reborrow only, not repay) in `docs/MPA_CREDIT_USAGE.md` and `docs/developer_guide.md`; documented `STALE_TAIL_THRESHOLD_CANDLES` constant and two-step gap repair in `market_adapter/README.md`; bumped version/commit references in `docs/README.md`, `docs/EVOLUTION.md`, `docs/DEXBOT_COMPARISON.md`, `docs/FUND_MOVEMENT_AND_ACCOUNTING.md`.
14+
515
## [1.0.2] - 2026-06-25 - Auto-Update Default & Update Script Hardening
616

717
### 2026-06-25

analysis/ama_fitting/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ama_fitting",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Tools for fitting AMA parameters to market data",
55
"main": "../../dist/analysis/ama_fitting/optimizer_high_resolution.js",
66
"scripts": {

claw/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dexbot2-claw",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"private": true,
55
"description": "Claw bridge and runtime integration layer for BitShares and DEXBot2.",
66
"type": "commonjs",

claw/runtimes/openclaw-plugin/openclaw.plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "bitshares-claw",
33
"name": "BitShares Claw",
44
"description": "Native BitShares and DEXBot2 tools from the DEXBot2 claw integration",
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"skills": [
77
"skills"
88
],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bitshares-claw-openclaw-plugin",
33
"private": true,
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"type": "commonjs",
66
"main": "index.js"
77
}

claw/tests/test_claw_mcp_transport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function testParserAcceptsJsonlAcrossChunksAndSingleBuffer() {
3030
capabilities: {},
3131
clientInfo: {
3232
name: 'claw-mcp-transport-test',
33-
version: '1.0.2'
33+
version: '1.0.3'
3434
},
3535
protocolVersion: '2024-11-05'
3636
}
@@ -181,7 +181,7 @@ async function testMainEntrypointHandlesRealProcessInitialize() {
181181
capabilities: {},
182182
clientInfo: {
183183
name: 'claw-mcp-transport-test',
184-
version: '1.0.2'
184+
version: '1.0.3'
185185
},
186186
protocolVersion: '2024-11-05'
187187
}

docs/DEXBOT_COMPARISON.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DEXBot vs DEXBot2 — Detailed Comparison Report
22

33
> **Date:** 2026-06-16 *(metrics refreshed against local source trees)*
4-
> **Scope:** Full architectural, functional, and operational comparison between the original [DEXBot](https://github.com/Codaone/DEXBot) (Python, v1.0.0) and DEXBot2 (TypeScript, v1.0.2).
4+
> **Scope:** Full architectural, functional, and operational comparison between the original [DEXBot](https://github.com/Codaone/DEXBot) (Python, v1.0.0) and DEXBot2 (TypeScript, v1.0.3).
55
> **Audience:** Developers, contributors, and operators evaluating or migrating between the two projects.
66
77
---
@@ -36,7 +36,7 @@
3636

3737
| Attribute | DEXBot (original) | DEXBot2 |
3838
|---|---|---|
39-
| **Release Track** | 1.0.0 | v1.0.2 |
39+
| **Release Track** | 1.0.0 | v1.0.3 |
4040
| **Language** | Python 3.6+ | TypeScript 5.x |
4141
| **Status** | Released 1.0.0, unmaintained | Active development |
4242
| **Last Repo Activity** | May 23, 2020 | 2026-06-25 |
@@ -774,7 +774,7 @@ Where:
774774

775775
| Metric | DEXBot | DEXBot2 |
776776
|---|---|---|
777-
| **Release Track** | 1.0.0 | v1.0.2 |
777+
| **Release Track** | 1.0.0 | v1.0.3 |
778778
| **Active Since** | ~2018 | December 2025 |
779779
| **Last Commit** | May 23, 2020 | 2026-06-25 |
780780
| **Total Commits** | 2281 | 1659 at current HEAD |

docs/EVOLUTION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Executive Summary
44

5-
DEXBot2 is a sophisticated decentralized exchange trading bot for the BitShares blockchain. This report documents the complete evolution of the project from its inception in December 2025 through the current 1.0.2 stable release.
5+
DEXBot2 is a sophisticated decentralized exchange trading bot for the BitShares blockchain. This report documents the complete evolution of the project from its inception in December 2025 through the current 1.0.3 stable release.
66

77
### Key Milestones
88
- **Project Inception**: December 2, 2025
99
- **Growth Phase**: 1,600+ commits over ~6 active months
1010
- **Code Maturity**: Evolution from basic utilities to a ~58,000+ LoC intelligent TypeScript system
1111
- **Stability**: Progression from manual testing to a suite of 200+ automated test files
12-
- **Releases**: 37 release entries (v0.1.0 to v1.0.2)
12+
- **Releases**: 38 release entries (v0.1.0 to v1.0.3)
1313

1414
---
1515

@@ -212,7 +212,7 @@ DEXBot2 has matured from a basic grid bot into a signal-intelligent, production-
212212
---
213213

214214
**Report Originally Generated**: February 19, 2026
215-
**Last Updated**: June 25, 2026
216-
**Total Commits**: 1659
217-
**Date Range**: December 2, 2025 - June 25, 2026 (ongoing)
215+
**Last Updated**: July 1, 2026
216+
**Total Commits**: 1660
217+
**Date Range**: December 2, 2025 - July 1, 2026 (ongoing)
218218
**Repository**: DEXBot2 (BitShares DEX Trading Bot)

docs/FUND_MOVEMENT_AND_ACCOUNTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,4 +825,4 @@ To prevent "Time-of-Check to Time-of-Use" errors:
825825
3. **Bootstrapping:** Fills arriving during startup (`isBootstrapping=true`) are queued until the grid is fully reconciled.
826826

827827
---
828-
*Technical Reference for DEXBot2 v1.0.2 release*
828+
*Technical Reference for DEXBot2 v1.0.3 release*

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This directory contains the comprehensive technical documentation for the DEXBot2 trading bot. It is designed to guide developers from high-level architecture down to the nuances of fund accounting and state management.
44

5-
**Version context:** v1.0.2 is the current release.
5+
**Version context:** v1.0.3 is the current release.
66

77
---
88

@@ -108,7 +108,7 @@ This directory contains the comprehensive technical documentation for the DEXBot
108108

109109
### 🧭 [Evolution Report](EVOLUTION.md)
110110
*Project timeline and major architecture phases.*
111-
- **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.0.2 stable release, including credit maintenance hardening
111+
- **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.0.3 stable release, including credit maintenance hardening
112112
- **Focus**: Architecture evolution, release history, test growth, and documentation changes
113113

114114
### 🗒️ [Changelog](../CHANGELOG.md)

0 commit comments

Comments
 (0)