-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Implement multi-user recursive allocation system with Links Notation #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #7
Implements the --plan CLI option that allows users to: - Run the bot with real market APIs in read-only mode - Calculate and display all orders that would be placed - Debug and verify bot behavior without executing trades - Check planned orders for each strategy in the configuration Changes: - Added --plan flag to CLI with TRADER_BOT_PLAN env var support - Created PlannedOrder and PlannedOrders types for order collection - Implemented plan mode display with formatted output - Updated demo mode to support --plan for testing - Added comprehensive test coverage (8 new tests) Usage: trader-bot --demo --plan # See planned orders in demo mode trader-bot --config x --plan # Plan mode with real market Fixes #7 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
--plan optionThis reverts commit c2f7c78.
🤖 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. |
|
We need to update docs, by default we should give CLI first guide, and it should use Links Notation for configuration similar to how it works at:
Prefer indented syntax of links notation to maximize readability. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-06T20:13:28.115Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Reorganize README to prioritize CLI usage documentation - Add comprehensive CLI options reference using indented Links Notation - Document configuration priority chain (CLI > env vars > config files > defaults) - Add lenv file format examples using lino-env style (colon separator) - Include environment variable reference table - Add practical usage examples for common scenarios - Update References section with Links Notation dependencies - Remove redundant JSON configuration example (moved to Quick Start section) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 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. |
|
I see And I repeat: We need to update docs, by default we should give CLI first guide, and it should use Links Notation for configuration similar to how it works at:
Prefer indented syntax of links notation to maximize readability. If something is not implemented in the code it should be done there also. You can temporary copy rust version libraries if they are not yet published. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-06T22:10:25.417Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Update lenv parser to use ": " (colon-space) separator as per Links Notation specification - Maintain backwards compatibility with "=" separator for existing files - Add comprehensive tests for Links Notation format including: - Basic key-value pairs with ": " separator - Comments and empty lines - Quoted values (double and single quotes) - Values containing colons (URLs) - Mixed separators for migration support - Update README to remove JSON configuration section - Add indented Links Notation examples for multi-account configuration - Update CLI options documentation with Links Notation format References: - https://github.com/link-foundation/links-notation - https://github.com/link-foundation/lino-env - https://github.com/link-foundation/lino-arguments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 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. |
|
In docs we should focus on minimum commands to start the bot from the beggining of README, and also start with Links Notation configuration: It should be like this. So user is actually exchange user, it should be connected to single exchange or broker. We don't use So for this configuration to work, looks like we need to redo architecture of our trader bot before we can finish with this pull request. should be effectively the same as So both should work at the same time, but we need the first example to make sure we can add balancers inside balancers and so on. And for example have balancing between scalpers, holds and balancers. So the configuration should support full recursion as well short notation of configuration. I'm preparing everything for the first startup, so the configuration itself must be made perfect, and code should have architecture to support it. To make good architecure read these principles: https://github.com/link-foundation/code-architecture-principles |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-06T22:56:38.626Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
This commit implements the requested architecture changes: - Add Links Notation parser (lino.rs) for hierarchical configuration supporting indented syntax for complex nested structures - Add recursive Allocation domain model supporting: - Simple ticker-based allocations (SBER 30, LKOH 30, GAZP 40) - Strategy-based allocations (balancer, hold, scalper) - Nested/recursive balancers for complex portfolio management - Automatic flattening to ticker->percentage for execution - Add User/Account domain models: - User represents connection to broker/exchange (has API credentials) - Account represents trading account within broker - Each account has its own Allocation configuration - Support for multiple users with multiple accounts each - Update README with CLI-first guide: - Configuration examples using Links Notation - Both short syntax and full recursive syntax documented - Multi-user/multi-account configuration examples - Design principles in Links Notation format All 171 tests pass (unit, integration, and doc tests). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixed brace placement in parse_value_string function to match cargo fmt output on CI server. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removed `#` from raw string literals in tests where they weren't needed, as the strings don't contain quotes that would require escaping. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Merged identical match arms in to_string_value() - Used strip_prefix() instead of manual prefix stripping - Removed unnecessary Result wrapper from parse_tuple_content() - Removed unused line_num field from ParsedLine struct 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 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. |
Summary
This PR implements a comprehensive architecture update for multi-user, multi-account trading with recursive allocation strategies:
Links Notation Parser (
lib/rust/lino_args/lino.rs)config.get("settings/log_level"))Recursive Allocation System (
src/domain/allocation.rs)SBER 30, LKOH 30, GAZP 40Multi-User/Account Models (
src/domain/user.rs)Updated README
Configuration Examples
Simple allocation:
Recursive allocation (nested balancers):
Multi-user config:
Test Plan
🤖 Generated with Claude Code
Fixes #7