Update: bot improvements and documentation#100
Open
yudison23 wants to merge 6 commits into
Open
Conversation
…egram UI overhaul - agent.js: point default OpenAI-compatible client at Featherless (meta-llama/Llama-3.3-70B-Instruct) instead of OpenRouter; simplify per-step retry to status-code based (429/500/502/503/529) and drop the provider-specific system-role/tool_choice/thinking-mode fallbacks - tools/wallet.js: read SOL + SPL/Token-2022 balances directly via RPC_URL (getBalance/getParsedTokenAccountsByOwner) instead of the Helius wallet API; price via Jupiter assets-search - tools/dlmm.js: chunk getMultipleAccountsInfoAndContext calls for RPC plans with a low per-call account cap (RPC_MAX_MULTI_ACCOUNTS) - tools/executor.js: add dryRun as a live-toggleable config key, synced to process.env.DRY_RUN - index.js, telegram.js: HTML-formatted Telegram messages (escapeHtml, candidate/position cards, boxed tool-status table, /start quick-menu) - setup.js, README.md, CLAUDE.md: drop HELIUS_API_KEY requirement, document provider-agnostic RPC balance lookups - package.json: add @solana/spl-token (Token-2022 support) and @anthropic-ai/sdk (unused so far) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Redesigned all Telegram bot features for better visual hierarchy and readability: **Key changes:** - Added emoji section headers (💰 Wallet, 📈 Positions, 📊 Status, etc.) for quick scanning - Converted multi-line stacked format to compact inline format using pipes (|) and arrows (↓↑→) - Simplified notifications: /deploy, /close, /swap, /OOR now single/dual line with emoji prefix - Updated /status, /positions, /pool, /config, /help with new visual structure - Morning briefing: compact 3-line format replacing previous 5-section layout - Removed decorative emoji (☀️📥📤💎📂), kept only functional section markers - All command helpers and menu buttons use consistent formatting **Result:** Cleaner, more professional look. Information scans faster. Still maintains all data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Major improvements: 1. Enhanced state.json recovery (agent.js + state.js) - Add atomic writes (temp file → backup → rename) - Auto-recover from corrupted state via .backup file - Better error logging for diagnostics 2. Beautified Telegram alert formatting (index.js) - Add formatManagementAlert() & formatScreeningAlert() helpers - Use emojis for quick visual scanning (🟢🔴💰🔴⏸️✅) - Clean, simple, informative layout - Separate display alerts from internal logging 3. Fixed double alert issue (index.js) - Remove early sends in pre-check conditions - Use throw/catch pattern instead of early return - Consolidate all alerts to single finally block - Prevent race conditions with proper _busy flag ordering 4. Improved error context (agent.js) - Wrap agentLoop initialization in try-catch - Capture and log specific failures during setup - Add sessionHistory validation Result: Cleaner Telegram UX, single alert per cycle, better error recovery Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Root cause: createLiveMessage() was sending two messages:
1. Initial message during creation ("Scanning candidates...")
2. Final message during finalize (formatted alert)
Solution: Comment out initial flushNow() and only send the complete
formatted alert on finalize(). This ensures single, clean alert per cycle.
Result: Telegram alerts now display only once per screening/management cycle,
with proper emoji formatting and information density.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Update CLAUDE.md to document the fast PnL polling system:
- Added `pnl` section to config system table
- pollIntervalSec: 3 (default) - configurable poll interval
- confirmTicks: 1 or 2 - confirmation window (3-6 seconds)
- Updated PnL poller description to clarify real-time exit detection
- Exits (trailing-TP, stop-loss, OOR, low-yield) trigger directly
when rule is met, no waiting for next management cycle
Note: user-config.json not committed (gitignored) but should contain:
"pnl": {
"pollIntervalSec": 3,
"confirmTicks": 1
}
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1. Swap retries (auto-swap on close/claim) - Jupiter failures now retry 3x with exponential backoff - Prevents stranded tokens when swap temporarily fails - Documented in position lifecycle section 2. Smarter solo deploys - Lone candidates now pass with strong narrative OR high Degen Score (≥50) - Smart wallets demoted from hard gate to confidence boost - PVP conflicts still block unless degen score is strong - More nuanced conviction evaluation for standalone pools 3. Fixed: stuck positions - PnL sanity check was wrongly blocking exit rules on volatile pools - Positions could sit past stop-loss/trailing-TP triggers - Now correctly limited to warning only; exits always execute - Documented in known issues section with fix details All changes are documentation-only, reflecting behavior already in code. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes 5 commits with critical fixes and improvements: