feat(ton-trading-bot): add 15 algorithmic trading tools (v2.0.0) - #45
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#43
Resolves xlabtg#43. Expands the plugin from 6 to 21 atomic tools covering all requested algorithmic trading categories: P0 — Cross-DEX Arbitrage: - ton_trading_get_arbitrage_opportunities: finds price diffs across StonFi, DeDust, TONCO, swap.coffee; returns sorted net-profit list P0 — Sniper Trading: - ton_trading_get_token_listings: fetches recently-listed tokens via GeckoTerminal, filtered by minimum liquidity - ton_trading_get_token_info: price, market cap, volume, FDV for a token - ton_trading_validate_token: risk-score + warnings (low liquidity, low volume, suspicious wash-trade signals) P0 — Copy Trading: - ton_trading_get_top_traders: scans trending pools for wallets ranked by win rate and minimum trade count - ton_trading_get_trader_performance: analyses a wallet's on-chain swap history via tonapi.io P1 — Liquidity & Farming: - ton_trading_get_active_pools: lists pools sorted by 24h volume - ton_trading_get_farms_with_apy: estimates APY from fee yield × 365 - ton_trading_get_pool_volume: 1h/6h/24h volumes + price changes P1 — Backtesting: - ton_trading_backtest: replays buy_and_hold / mean_reversion / momentum strategies against journal history; returns win rate, PnL, drawdown, Sharpe ratio P2 — Risk Management: - ton_trading_calculate_risk_metrics: VaR, max drawdown, Sharpe, profit factor from closed trades - ton_trading_set_stop_loss: registers SL/TP rules in new DB table - ton_trading_get_optimal_position_size: Kelly criterion + fixed-fraction P2 — Automation: - ton_trading_schedule_trade: stores pending trades for future execution - ton_trading_get_scheduled_trades: lists pending trades, flags due ones Also: - migrate() adds stop_loss_rules and scheduled_trades tables - manifest.json bumped to v2.0.0 with all 21 tools listed - 78 unit tests pass (added 50 new tests for new tools) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
konard
marked this pull request as ready for review
March 25, 2026 19:21
This reverts commit 52b9975.
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (2014KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
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.
Summary
Fixes #43. Expands
ton-trading-botfrom 6 to 21 atomic tools covering all requested algorithmic trading categories, following the same architecture (LLM composes atomic tools into strategies).P0 — Cross-DEX Arbitrage
ton_trading_get_arbitrage_opportunities— compares prices across StonFi, DeDust, TONCO, swap.coffee; returns opportunities sorted by net profit after feesP0 — Sniper Trading
ton_trading_get_token_listings— fetches recently-listed tokens via GeckoTerminal, filtered by liquidity floorton_trading_get_token_info— price, market cap, FDV, 24h volume for any token addresston_trading_validate_token— risk score + warnings (low liquidity, low volume, wash-trade signals)P0 — Copy Trading
ton_trading_get_top_traders— scans trending pools for wallets ranked by win rateton_trading_get_trader_performance— analyses a wallet's on-chain swap history via tonapi.ioP1 — Liquidity & Farming
ton_trading_get_active_pools— lists pools sorted by 24h volume, filterable by DEXton_trading_get_farms_with_apy— estimates APY from fee yield × 365, sorted descendington_trading_get_pool_volume— 1h/6h/24h volumes, price changes, and buy/sell counts for a poolP1 — Backtesting
ton_trading_backtest— replaysbuy_and_hold,mean_reversion, ormomentumstrategy against journal history; returns win rate, PnL, max drawdown, and Sharpe ratioP2 — Risk Management
ton_trading_calculate_risk_metrics— VaR (configurable confidence), max drawdown, Sharpe, profit factor from closed tradeston_trading_set_stop_loss— registers stop-loss / take-profit rules in the journal DBton_trading_get_optimal_position_size— Kelly Criterion + fixed-fraction sizing from historical win rateP2 — Automation
ton_trading_schedule_trade— stores a pending trade for future execution (validated future ISO datetime)ton_trading_get_scheduled_trades— lists pending trades, flags which are due for executionImplementation notes
migrate()adds two new tables:stop_loss_rulesandscheduled_tradesmanifest.jsonbumped to v2.0.0 with all 21 tools listedAbortSignal.timeout(15_000)per patterns.mdsdk.storagewith appropriate TTLs (30s–5min per data freshness)Test plan
node --test plugins/ton-trading-bot/tests/index.test.js)🤖 Generated with Claude Code