diff options
| -rw-r--r-- | downloads/HypeTrader.js | 35 | ||||
| -rw-r--r-- | downloads/master_plan.md | 23 | ||||
| -rw-r--r-- | main.html | 2 | ||||
| -rw-r--r-- | modules/core/module-aiassist.js | 8 | ||||
| -rw-r--r-- | modules/core/module-loader.js | 2 |
5 files changed, 64 insertions, 6 deletions
diff --git a/downloads/HypeTrader.js b/downloads/HypeTrader.js new file mode 100644 index 0000000..acc3a60 --- /dev/null +++ b/downloads/HypeTrader.js @@ -0,0 +1,35 @@ +/** + * HypeTrader.js - Momentum Rider Strategy + * Strategy: Long on 15m High Breakout + Volume Spike + */ +const HypeTrader = { + config: { + symbol: 'HYPE', + timeframe: '15m', + volThreshold: 1.5, // 150% of average + tp: 0.05, // 5% Take Profit + sl: -0.02 // 2% Trailing Stop + }, + + async analyze(priceData) { + const { currentPrice, high20, avgVol, currentVol } = priceData; + + if (currentPrice > high20 && currentVol >= avgVol * this.config.volThreshold) { + return { action: 'LONG', signal: 'MOMENTUM_BREAKOUT', price: currentPrice }; + } + return { action: 'WAIT', signal: 'NO_SIGNAL' }; + }, + + async executeTrade(signal) { + console.log(`Executing ${signal.action} for ${this.config.symbol} at ${signal.price}`); + // Integration with HyperliquidBridge and secret:hyper + return await HyperliquidBridge.placeOrder({ + symbol: this.config.symbol, + side: signal.action, + size: 'auto', // Based on risk mgmt + secretKey: 'hyper' + }); + } +}; + +module.exports = HypeTrader; diff --git a/downloads/master_plan.md b/downloads/master_plan.md new file mode 100644 index 0000000..c5e43e0 --- /dev/null +++ b/downloads/master_plan.md @@ -0,0 +1,23 @@ +# PROJECT: HYPE-PROFIT-ENGINE +## Status: PHASE 1 - ARCHITECTURE & DEPLOYMENT + +### 1. GOAL +Transform the AI from a market-analyst to an autonomous trading operator on Hyperliquid, focusing on HYPE asset profitability. + +### 2. TECHNICAL ARCHITECTURE +- **Secure Layer**: Use native `secret-*` commands for Private Key storage (Zero-leakage). +- **Execution Layer**: `HypeTrader.js` (New) $\rightarrow$ uses `HyperliquidBridge` for data and `CurlModule` for signed order submission. +- **Logic Layer**: Strategy Engine (TBD) $\rightarrow$ interprets market data and generates trade signals. +- **Audit Layer**: `VFSAutomator` $\rightarrow$ logs every trade and PnL into `/trading_operations/logs/`. + +### 3. IMPLEMENTATION ROADMAP +- [x] **Phase 0: Connectivity** (CurlModule, HyperliquidBridge) - COMPLETE +- [x] **Phase 1: Infrastructure** (VFSAutomator, Skill-Synthesizer) - COMPLETE +- [ ] **Phase 2: Security** (Initialize `secret-set` for API keys) - PENDING +- [ ] **Phase 3: Logic** (Build `HypeTrader.js` & Strategy implementation) - PENDING +- [ ] **Phase 4: Live Execution** (First Trade $\rightarrow$ PnL Tracking) - PENDING + +### 4. RISK MITIGATION +- Implementation of a "Hard Stop" logic: Automatic position closure if equity drops below X%. +- Order sizing limits to prevent catastrophic slippage. +- Separation of API keys from VFS files. @@ -1250,7 +1250,7 @@ </script> <!-- Async dependency-ordered module loader (replaces 26 synchronous script tags) --> -<script src="modules/core/module-loader.js?v=2026-06-11-v4.5.44"></script> +<script src="modules/core/module-loader.js?v=2026-06-11-v4.5.45"></script> <script> // ═══ ONE TRUE VERSION SOURCE ═══ diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index 5a0c389..5273678 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -1836,11 +1836,11 @@ buildSystemPrompt() { if (!mindmap) return JSON.stringify({ error: 'MindmapModule not loaded' }); const topic = a.topic || 'Mindmap'; const children = a.children || ''; - mindmap.root = null; const args = topic.split(' '); mindmap._new(args); - if (!mindmap.root) return JSON.stringify({ error: 'Failed to create root' }); - const rootId = mindmap.root.id; + const cur = mindmap._ensureMindmap(); + if (!cur) return JSON.stringify({ error: 'Failed to create mindmap' }); + const rootId = cur.root.id; const added = []; if (children) { const childNames = children.split(',').map(c => c.trim()).filter(Boolean); @@ -1850,7 +1850,7 @@ buildSystemPrompt() { } } mindmap._svg([]); - return JSON.stringify({ success: true, topic, children: added.length ? added : 'none', nodes: mindmap._countNodes(mindmap.root), rendered: 'inline SVG in terminal' }); + return JSON.stringify({ success: true, topic, children: added.length ? added : 'none', nodes: mindmap._countNodes(cur.root), rendered: 'inline SVG in terminal' }); } case 'view_module': case 'edit_module': diff --git a/modules/core/module-loader.js b/modules/core/module-loader.js index 82f2bc0..0261256 100644 --- a/modules/core/module-loader.js +++ b/modules/core/module-loader.js @@ -105,7 +105,7 @@ window.__moduleLoaderReload = reloadWithSelection; - const LATEST_VER = '2026-06-11-v4.5.44'; + const LATEST_VER = '2026-06-11-v4.5.45'; const CACHE = '?v=' + LATEST_VER; const stored = localStorage.getItem('webx11_cache_ver'); if (stored !== LATEST_VER) { |