Unify trader-bot: add strategies, adapters, and multi-user support#4
Merged
Unify trader-bot: add strategies, adapters, and multi-user support#4
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #3
This commit transforms the balancer-trader-bot into a unified trader-bot framework with: ## Package Changes - Renamed from balancer-trader-bot to trader-bot (v0.2.0) - Updated library name to trader_bot - Added uuid dependency for generating unique IDs ## New Strategy Module - Added Strategy trait for composable trading strategies - Moved balancer module under strategy/ as a sub-strategy - Added ScalpingStrategy with FIFO lot tracking for buy-low/sell-high - Added HoldingStrategy for maintaining target allocations - Added TradingSettings for configurable strategy parameters - Added MarketState and StrategyDecision types ## New Adapters Module - Added TBankAdapter for T-Bank (formerly Tinkoff) integration - Added BinanceAdapter for Binance exchange - Added InteractiveBrokersAdapter for TWS/IB Gateway - All adapters implement ExchangeProvider trait (placeholder impl) ## Domain Enhancements - Added Trade type for recording executed trades - Added TradeHistory for managing trade records - Enhanced OrderBook with new methods (empty, with_levels, bid/ask depth) ## Configuration Enhancements - Added UserConfig for multi-user support - Users can have their own accounts - Global accounts available for all users - Enhanced validation for new config structure ## Documentation - Updated README with new project structure - Added strategy and adapter documentation - Updated code examples for new API Fixes #3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit f2c7536.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
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
This PR transforms the balancer-trader-bot into a unified trader-bot framework with multiple trading strategies, exchange adapters, and multi-user support.
balancer-trader-bottotrader-bot(v0.2.0)Strategytrait with scalping, holding, and balancer strategiesKey Changes
New Strategy Architecture
Strategytrait for composable trading strategiesScalpingStrategy: Buy-low/sell-high with FIFO lot trackingHoldingStrategy: Maintain target allocations per assetstrategy::balanceras a sub-strategyExchange Adapters
TBankAdapter: T-Bank (formerly Tinkoff) integrationBinanceAdapter: Binance exchange supportInteractiveBrokersAdapter: TWS/IB Gateway integrationExchangeProvidertrait (placeholder implementations)Configuration
UserConfigfor multi-user supportTest Plan
cargo fmt --checkcargo run --example basic_usage) works correctlycargo run) works correctlyFixes #3
🤖 Generated with Claude Code