Skip to content

Conversation

@konard
Copy link
Contributor

@konard konard commented Dec 31, 2025

Summary

This PR transforms the balancer-trader-bot into a unified trader-bot framework with multiple trading strategies, exchange adapters, and multi-user support.

  • Package Rename: Renamed from balancer-trader-bot to trader-bot (v0.2.0)
  • Strategy Module: Added composable Strategy trait with scalping, holding, and balancer strategies
  • Adapters Module: Added exchange adapters for T-Bank, Binance, and Interactive Brokers
  • Multi-User Config: Enhanced configuration to support multiple users with their own accounts
  • Domain Types: Added Trade/TradeHistory types, enhanced OrderBook

Key Changes

New Strategy Architecture

  • Strategy trait for composable trading strategies
  • ScalpingStrategy: Buy-low/sell-high with FIFO lot tracking
  • HoldingStrategy: Maintain target allocations per asset
  • Balancer moved under strategy::balancer as a sub-strategy

Exchange Adapters

  • TBankAdapter: T-Bank (formerly Tinkoff) integration
  • BinanceAdapter: Binance exchange support
  • InteractiveBrokersAdapter: TWS/IB Gateway integration
  • All implement ExchangeProvider trait (placeholder implementations)

Configuration

  • Added UserConfig for multi-user support
  • Users can have their own accounts
  • Global accounts available for all users

Test Plan

  • All 105 unit and integration tests pass
  • Clippy passes with no warnings
  • Code formatting verified with cargo fmt --check
  • Example (cargo run --example basic_usage) works correctly
  • Demo (cargo run) works correctly

Fixes #3

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #3
@konard konard self-assigned this Dec 31, 2025
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>
@konard konard changed the title [WIP] Rename to trader-bot (as repository is renamed from balancer-trader-bot), and make it even better Unify trader-bot: add strategies, adapters, and multi-user support Dec 31, 2025
@konard konard marked this pull request as ready for review December 31, 2025 09:29
@konard
Copy link
Contributor Author

konard commented Dec 31, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $12.703427 USD
  • Calculated by Anthropic: $9.504182 USD
  • Difference: $-3.199245 (-25.18%)
    📎 Log file uploaded as GitHub Gist (2503KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 4ccc326 into main Dec 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename to trader-bot (as repository is renamed from balancer-trader-bot), and make it even better

2 participants