fix: OptimizerV3 / OptimizerV3Push3 not explicitly typed against IOptimizer (#661)

- Optimizer: add `is IOptimizer` and mark getLiquidityParams() with
  `override`, making the interface conformance explicit at the base level.
  OptimizerV3 inherits it transitively via Optimizer.
- OptimizerV3Push3: add `is IOptimizer` and implement getLiquidityParams()
  that calls calculateParams() with zeroed inputs, returning bear-mode
  defaults (ci=0, anchorShare=0.3e18, anchorWidth=100, discoveryDepth=0.3e18).
  Behaviour is identical to the previous try/catch fallback used by
  LiquidityManager and the backtesting deployer.
- Update backtesting comments to reflect that getLiquidityParams() now
  exists on OptimizerV3Push3 (returns bear defaults via zeroed inputs).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-14 05:08:32 +00:00
parent de93cb8997
commit 6978d1399f
5 changed files with 30 additions and 14 deletions

View file

@ -134,8 +134,8 @@ contract BacktestRunner is Script {
// ------------------------------------------------------------------
// KrAIken system deployment (follows DeployLocal.sol pattern)
//
// 1. Deploy OptimizerV3Push3 (no proxy only exposes isBullMarket(),
// causing LM to fall back to safe bear-mode defaults via try/catch).
// 1. Deploy OptimizerV3Push3 (no proxy getLiquidityParams() uses zeroed
// inputs, returning bear-mode defaults on every recenter).
// 2. Deploy LiquidityManager pointing at the shadow pool.
// 3. Wire BacktestKraiken.setLiquidityManager(lm).
// 4. Set feeDestination = sender.