Opus
FloatVault.totalDeposited per-strategy accounting is unbounded O(strategyCount) and corrupts shadow tracking
- contracts/src/FloatVault.sol:70-96
- contracts/src/FloatVault.sol:100-128
park() and withdraw() both loop over every registered strategy (including retired/shadow) to update totalDeposited. (1) Gas grows linearly with strategyCount — putting an effective cap on how many strategies the AI may register before park/withdraw exceeds the block gas limit, but the README implies many strategies will be tried. (2) On withdraw, when a shadow strategy's totalDeposited < amount, it is silently zeroed rather than decremented proportionally, so shadow totals drift below real deposits and lose accuracy. (3) registerStrategy initializes totalDeposited to current totalDeposits, so newer shadows start at the post-park value, and on a subsequent withdraw of that amount the older shadows would also need to lose that amount, causing inconsistent tracking across strategies. Scoring upstream relies on these values per the consolidator description.
Recommendation
Use a single aggregate variable or compute totalDeposited on demand. If per-strategy historical tracking is needed, write it at registration time and update only the active strategy.