Commit Graph
3 Commits
Author SHA1 Message Date
direkturcryptoandClaude Opus 4.6 9a89efb071 fix: remove cut-loss from maker strategy — hold to resolution
No cut-loss needed: worst case is losing buy cost (2c/share) which
resolves on-chain. If on winning side, payout is $1/share.
Removed marketSell, cutLossSells, and makerCutLossTime config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:59:58 +07:00
direkturcryptoandClaude Opus 4.6 23bb74127c fix: rewrite makerWs to handle CLOB WebSocket message formats correctly
- Handle initial book snapshot (arrives as array without event_type)
- Handle price_change deltas (incremental updates to bid/ask levels)
- Use Maps for O(1) price level updates instead of full array replace
- Use proper WebSocket ping frames instead of string "ping"
- Subscribe all assets in single message
- Add getBestBid/getBestAsk methods using cached values from events
- Improve TUI orderbook display with depth bars and spread indicator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:53:04 +07:00
direkturcryptoandClaude Opus 4.6 991fd6caa4 feat: implement buy-low-sell-high market maker (no splitPosition)
New market maker strategy that places limit BUY on UP+DOWN at low price
(default 2c), then sells at target price (default 3c) when filled.

Key features:
- Concurrent limit BUY on both sides (multi-thread style via Promise.all)
- Immediate partial sell placement on partial fill detection
- Cancel opposite side when one fills completely
- WebSocket orderbook client for real-time simulation visualization
- Both TUI (maker.js) and bot (maker-bot.js) entry points

Files:
- services/makerDetector.js: market detection (reuses slug pattern)
- services/makerExecutor.js: core buy-low-sell-high strategy
- services/makerWs.js: WebSocket orderbook for live data
- maker.js: TUI version with blessed dashboard
- maker-bot.js: PM2/VPS plain-text version

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:47:26 +07:00