Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

refactor(broker): demote PaperBroker to test-only (#185)#187

Merged
crrow merged 5 commits intomainfrom
issue-185-paper-test-only
Apr 1, 2026
Merged

refactor(broker): demote PaperBroker to test-only (#185)#187
crrow merged 5 commits intomainfrom
issue-185-paper-test-only

Conversation

@crrow
Copy link
Copy Markdown
Collaborator

@crrow crrow commented Apr 1, 2026

Summary

  • Remove BrokerConfig::Paper — users can no longer configure broker = "paper" in accounts.toml
  • Remove paper broker from registry — not discoverable by setup wizard
  • Daemon uses account configrun_live_trading creates broker from accounts.toml instead of hardcoding PaperBroker
  • CLI simplified--broker and --fill-price args removed; --exchange is now required
  • Template updated — default account is ccxt + sandbox = true (Binance testnet)
  • PaperBroker kept for tests — still used by engine tests, UTA tests, and e2e smoke tests

Paper trading = CcxtBroker { sandbox: true } against real exchange testnets.

Verification

  • cargo check — clean, zero warnings
  • cargo test — 11 tests pass (4 lib + 7 e2e)
  • cargo clippy --all-targets --all-features -- -D warnings — clean

Closes #185

…tion paths (#185)

- Remove BrokerConfig::Paper variant from account config
- Remove paper broker from registry (register_all)
- Strip registry_entry/parse_fill_price from paper.rs, keep PaperBroker for tests
- Replace hardcoded PaperBroker in daemon with account-config-based broker creation
- Remove --broker/--fill-price CLI args, exchange is now required
- Update accounts.toml template: default to ccxt sandbox instead of paper
- Rename run_paper_trading → run_live_trading
- Rename PaperTrading error variant → Trading
- Fix irrefutable if-let patterns after Paper variant removal

Closes #185
@crrow crrow added the refactor Code restructuring without behavior change label Apr 1, 2026
crrow added 4 commits April 1, 2026 19:07
Reject account creation upfront when credentials are missing for live
accounts instead of silently defaulting to empty strings. Sandbox
accounts still allow omitting credentials since some testnets don't
require them.

Closes #185
…185)

Credentials are mandatory regardless of sandbox mode. Environment
variable overrides (RARA_ACCOUNT_{ID}_API_KEY) are for updating
existing configs at runtime, not for skipping validation.

Closes #185
…nology (#185)

- Rename Paper command → Trade, PaperAction → TradeAction
- Rename all run_paper_* functions → run_trade_*
- Rename PaperStatusResponse/PaperStopResponse/PaperShutdownSummary → Trade*
- Update all JSON action keys from "paper.*" to "trade.*"
- Remove "paper" from setup wizard comments
- Update accounts template comments

Closes #185
@crrow crrow merged commit d32fc59 into main Apr 1, 2026
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(broker): demote PaperBroker to test-only, remove from production paths

1 participant