2.1 KiB
2.1 KiB
Design
Context
See proposal.md. The service currently creates two named sample wallets internally; EMC uses one shared service and snapshot for both tabs. Hub startup is explicitly ordered.
Goals / Non-Goals
Keep wallet configuration out of EMC and snapshots instance-owned. No real addresses, integrations, trading, new configuration framework or UI redesign are introduced.
Decisions
- Add an immutable wallet configuration record (stable ID and display name), supplied as a defensively copied list to the implementation constructor. The sample IDs are not Solana addresses. This avoids passing UI data or moving sample position definitions into Hub.
- Hub owns one immutable list of the two existing sample wallet identities, supplied to both independently constructed processes.
- Keep the existing two sample position sets in the service and assign them by configured wallet order, alternating for additional sample wallets. This is explicitly sample-only behavior, not an integration policy; empty configuration gives an empty snapshot. It avoids coupling sample data to wallet IDs or requiring exactly two wallets.
- Inject PROD and TEST service views into EMC. Retain one off-thread scheduled loop, with separate reads and error handling for each tab. Preserve existing rendering and session guards.
- Retire the default ID rather than aliasing it, following explicit process selection and fail-fast dependencies.
Risks / Trade-offs
- Identical fixtures conceal crossed wiring → verify routing by source inspection and an isolated session with distinct snapshots.
- Private startup configuration is ignored by Git → update the local file and document the required deployment migration.
- Sample assignment is ordinal → document this temporary fixture behavior; real integration remains a later task.
Migration Plan
Replace evelyn.perps.default with evelyn.perps.prod and evelyn.perps.test before EMC. Both must precede EMC. The minimal tracked bootstrap template stays unchanged. Rollback requires restoring both code and the old configuration entry. Do not start production processes during verification.