Summary
The agent loop makes portfolio decisions but lacks a structured strategy engine. A pluggable strategy system would allow rule-based (target allocation %) and optimisation-based (max APY, min risk) rebalancing.
Proposed Solution
- Define a
RebalanceStrategy interface in src/agent/types.ts
- Implement two initial strategies:
TargetAllocationStrategy: rebalance toward user-configured % per protocol
MaxYieldStrategy: shift capital to highest-APY protocol within risk limits
- The agent
router.ts selects strategy based on user preference (new DB column)
- Log chosen strategy and deviation trigger in
AgentLog
Acceptance Criteria
Summary
The agent loop makes portfolio decisions but lacks a structured strategy engine. A pluggable strategy system would allow rule-based (target allocation %) and optimisation-based (max APY, min risk) rebalancing.
Proposed Solution
RebalanceStrategyinterface insrc/agent/types.tsTargetAllocationStrategy: rebalance toward user-configured % per protocolMaxYieldStrategy: shift capital to highest-APY protocol within risk limitsrouter.tsselects strategy based on user preference (new DB column)AgentLogAcceptance Criteria