dexbot 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/analysis/ama_fitting/package.json +1 -1
- package/analysis/resolve_source.ts +3 -0
- package/analysis/results/ama_sweep_results_lp_pool_133_1h.json +2455 -0
- package/analysis/results/bot_fitting_results_lp_pool_133_1h.json +218 -0
- package/analysis/tradingview/README.md +5 -1
- package/analysis/tradingview/analyze_tradingview.ts +27 -1
- package/analysis/tradingview/h-bts_tradingview.html +1570 -0
- package/analysis/tradingview/t-bts_tradingview.html +1570 -0
- package/analysis/tradingview/tradingview_uplot_chart_generator.ts +351 -22
- package/analysis/trend_detection/package.json +1 -1
- package/claw/package.json +1 -1
- package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
- package/claw/runtimes/openclaw-plugin/package.json +1 -1
- package/claw/tests/test_claw_mcp_transport.ts +2 -2
- package/dist/analysis/resolve_source.d.ts.map +1 -1
- package/dist/analysis/resolve_source.js +3 -0
- package/dist/analysis/resolve_source.js.map +1 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +3 -0
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +1 -1
- package/dist/analysis/tradingview/analyze_tradingview.js +27 -2
- package/dist/analysis/tradingview/analyze_tradingview.js.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +348 -22
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.d.ts +33 -1
- package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.js +38 -1
- package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +2 -18
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +37 -37
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.js +655 -556
- package/dist/modules/dexbot_cow_runtime.js.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +31 -51
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/order/grid.d.ts.map +1 -1
- package/dist/modules/order/grid.js +28 -37
- package/dist/modules/order/grid.js.map +1 -1
- package/dist/modules/order/manager.d.ts +2 -1
- package/dist/modules/order/manager.d.ts.map +1 -1
- package/dist/modules/order/manager.js +10 -1
- package/dist/modules/order/manager.js.map +1 -1
- package/dist/modules/order/sync_engine.d.ts.map +1 -1
- package/dist/modules/order/sync_engine.js +74 -0
- package/dist/modules/order/sync_engine.js.map +1 -1
- package/dist/modules/order/utils/math.d.ts +9 -11
- package/dist/modules/order/utils/math.d.ts.map +1 -1
- package/dist/modules/order/utils/math.js +9 -11
- package/dist/modules/order/utils/math.js.map +1 -1
- package/dist/modules/order/utils/order.d.ts +51 -16
- package/dist/modules/order/utils/order.d.ts.map +1 -1
- package/dist/modules/order/utils/order.js +203 -29
- package/dist/modules/order/utils/order.js.map +1 -1
- package/dist/modules/order/utils/system.d.ts +1 -30
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +31 -98
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/order/utils/validate.d.ts +3 -2
- package/dist/modules/order/utils/validate.d.ts.map +1 -1
- package/dist/modules/order/utils/validate.js +5 -1
- package/dist/modules/order/utils/validate.js.map +1 -1
- package/docs/DEXBOT_COMPARISON.md +3 -3
- package/docs/EVOLUTION.md +6 -5
- package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
- package/docs/README.md +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.5.3] - 2026-09-09 - Boundary Ownership Hardening, COW Dedup, TradingView Range Highlight, Sync Materialize Fix
|
|
6
|
+
|
|
7
|
+
### 2026-09-07
|
|
8
|
+
|
|
9
|
+
- **Docs(curve)**: dynamic rho, StableSwap context, and clarity fixes in the power-law curve comparison — new "variable price p" section (`p = (y/x)^(1-rho)` sliding along the invariant as reserves shift and what that means for liquidity placement); deviation/regime-driven dynamic-rho table plus keeper pseudocode reusing the AMA signal stack (ATR, Kalman velocity, Hurst/PE) with branches aligned to table rows; new "Relation to the StableSwap protocol" section (upstream design link, A/rho interpolation-axis comparison, CES-vs-StableSwap contrast table, flexibility split: StableSwap the more general/operationally complete protocol, CES the more flexible curve shape); stablecoin recommendation justified via tail behavior (StableSwap degrades toward constant product on depeg while high-rho CES thins exponentially below it); rho_buy/rho_sell renamed to tail-oriented rho_high/rho_low with naming note (`docs/DEXBOT2_VS_POWER_LAW_CURVE.md`; docs-only, no code paths affected).
|
|
10
|
+
|
|
11
|
+
### 2026-09-08
|
|
12
|
+
|
|
13
|
+
- **Refactor(cow)**: deduplicate COW runtime broadcast/reconcile paths — `modules/dexbot_cow_runtime.ts` (~4700 lines) shared sequences extracted into single spellings: `recoverRefusedCommit` (3 identical commit-refused recovery sequences, named options object, original log wordings preserved), `runPreBroadcastGuards` (create-slot validation, recovery-exhausted block, pending/unmatched guards, crossed-book gate), `matchPendingToChain`/`adoptMatchedEntries`/`restoreDiscardedCreates`/`resyncIfUnreconciled` (4-phase split of `reconcileAfterUncertainBroadcastImpl`, persist ownership stays with caller), `runLastFillGuardCheck` (all 3 guard sites), `createOpFingerprintForSlot`/`findChainOrderForPendingEntry`, `rawOnChainFromInts`/`applyOptimisticFeeBalance`, `isAuthoritativeChainRead`, `getPendingBroadcasts`/`countPendingBroadcasts`; pure helpers (`chainOrderUnchangedFromCache`, `detectCrossedBookPlan`, `collectKnownOnChainOrderIds`) moved to `modules/order/utils/order.ts`; getAssetFeesSafe require hack removed (direct ESM import); per-kind op builders and broadcast commit/catch blocks deliberately kept inline (threading ~15 shared locals through broadcast-critical code judged riskier than the duplication); full suite 266 passed, 0 failed.
|
|
14
|
+
|
|
15
|
+
### 2026-09-09
|
|
16
|
+
|
|
17
|
+
- **Feat(tradingview)**: bot-grid range highlight with AMA-slope scaling — Range / Scale controls, grid-span slider (1.25-2x, default from bot grid ratio), legend readout (+up% / -down%), range-band draw plugin behind candles/AMA with axis-fit to band when Scale is on; band math embeds canonical sources verbatim via `embedFunctionSources` (`computeAverageAmaSlopePct`, `resolveBaseBounds`, `computeAsymmetricBoundsMetrics`, `applyAsymmetricBounds`, `applyNarrowingSideGuard`, `parseRelativeMultiplier`, same runtime values: lookback 9, maxSlope 0.09, clamp 0.5, maxAsym 0.35, minSlots 10, plus per-bot overrides); CLI `--no-range`/`--range-scale`/`--range-span`, grid bounds resolved from bot meta (`analysis/tradingview/*`, `analysis/resolve_source.ts`, `analysis/tradingview/analyze_tradingview.ts`); canonical `applyNarrowingSideGuard` exported from `market_adapter/core/asymmetric_bounds.ts` with `modules/order/grid.ts` routing its narrowing-side slot logic through it (behavior-identical); restored `.time-btn` click listeners, removed y-axis maxSpan zoom-out cap (floor/ceiling anti-slip guards remain).
|
|
18
|
+
- **Fix(boundary)**: remove fund-driven boundary sync, fills move the boundary — the periodic fund-ratio check moved rails without guaranteed same-batch refills, so guard-vetoed refill rotations left the commit keeping the boundary move with empty slots stranded past it (no repair path: sell-side spread pass could not touch buy-rail holes, promotion quota exhausted, budget spent on far orphans); `syncBoundaryToFunds` deleted (`modules/order/utils/system.ts` divergence pins the boundary to the committed value, `boundaryChanged` dropped from the return contract), `calculateFundDrivenBoundary` deleted (`modules/order/utils/order.ts`), failed-commit immediate retry and boundary-shift spread-skip removed (`modules/dexbot_maintenance_runtime.ts`); remaining writers are fills (`deriveTargetBoundary` with same-cycle rotations) and spread promotion (shifts only onto same-batch placements); fund changes still drive sizing via budget allocation, never rails; tests pinning the deleted writer removed (unanchored-spread, boundary-sync, fallback retry/crosser, skip-gate cases; abort-reason propagation and master-unpatched contracts kept).
|
|
19
|
+
- **Fix(boundary)**: hold committed boundary when guard-skipped refills strand rail holes — a fill-driven replan could shift the boundary on hole-CREATE refills, then have those refills guard-skipped at broadcast: working grid restores empties, the commit gate skips empties, and the overrun self-legalizes via gap-band re-derivation next cycle; `plan.refillSlotIds` threaded through `buildCowResultFromPlan` (string ids only) with skipped CREATE ids tracked at all five guard-skip sites, new `resolveRefillBoundaryHold`/`toRefillSlotIdSet` intersect skips (UPDATE + post-fill-clamped + CREATE) with the refill set, frozen `effectiveBoundary` routed to both `_commitWorkingGrid` calls and all three `recoverRefusedCommit` sites (`modules/dexbot_cow_runtime.ts`, `modules/order/manager.ts`, `modules/order/utils/validate.ts`, `modules/order/utils/system.ts`; `tests/test_cow_boundary_hold.ts` HOLD-001..008); hold keeps the committed boundary on refill intersect only, grid still commits, unrelated vetoes advance, absent wire never pins; interior skips can delay a justified shift by one cycle (fail-closed, self-healing).
|
|
20
|
+
- **Fix(sync)**: materialize-or-error on unknown grid id in createOrder sync path — a broadcast landing after a grid reset replaced master left the live chain order untracked: `synchronizeWithChain(createOrder)` missed the master lookup and dropped the linkage silently, so the next cycle re-placed the level, duplicating live orders and locking funds; chain id already tracked elsewhere warns + skips (idempotent), caller-supplied placement descriptor materializes the slot (ACTIVE/PARTIAL, orderId set, deferredFee restored), no descriptor logs an error naming both ids with the next readOpenOrders sync adopting the order as an orphan; `restoreDiscardedCreates` materializes creation-uncertain slots from the broadcast-time descriptor (VIRTUAL, planned size, no orderId so orphan adoption can reconcile) with error logs for unusable descriptors, all three createOrder call sites now pass the descriptor, plus a warn for the cancelOrder post-lock re-fetch miss (`modules/order/sync_engine.ts`, `modules/dexbot_cow_runtime.ts`, `tests/test_sync_create_unknown_id.ts` 5 regression tests).
|
|
21
|
+
|
|
5
22
|
## [1.5.2] - 2026-09-07 - Sync Rejection & Adoption Hardening, Crossing-Guard Coverage, Credit Display Fixes
|
|
6
23
|
|
|
7
24
|
### 2026-09-06
|
|
@@ -79,6 +79,9 @@ function resolveSource(config: SourceConfig, options: { quiet?: boolean } = {}):
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
const source = createSource('json', { filePath: filePath! });
|
|
82
|
+
if (config.botKey) {
|
|
83
|
+
return { source, botKey: config.botKey, amaConfig: resolveAmaConfig(config.botKey), amaKey: resolveAmaKey(config.botKey) };
|
|
84
|
+
}
|
|
82
85
|
return { source, amaConfig: resolveAmaConfig(''), amaKey: 'AMA3' };
|
|
83
86
|
}
|
|
84
87
|
|