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:
parent
de93cb8997
commit
6978d1399f
5 changed files with 30 additions and 14 deletions
|
|
@ -11,9 +11,9 @@ import { MockToken } from "./MockToken.sol";
|
|||
*/
|
||||
struct KrAIkenSystem {
|
||||
BacktestKraiken kraiken;
|
||||
/// @dev OptimizerV3Push3 is used as the optimizer address. It does not implement
|
||||
/// getLiquidityParams(), so LiquidityManager's try/catch falls back to safe
|
||||
/// bear-mode defaults on every recenter. This is intentional for backtesting.
|
||||
/// @dev OptimizerV3Push3 is used as the optimizer address. Its getLiquidityParams()
|
||||
/// uses zeroed inputs (no on-chain stake data) and returns bear-mode defaults on
|
||||
/// every recenter. This is intentional for backtesting.
|
||||
OptimizerV3Push3 optimizer;
|
||||
LiquidityManager lm;
|
||||
}
|
||||
|
|
@ -65,10 +65,9 @@ library KrAIkenDeployer {
|
|||
returns (KrAIkenSystem memory sys)
|
||||
{
|
||||
// 1. Deploy OptimizerV3Push3.
|
||||
// LiquidityManager wraps getLiquidityParams() in a try/catch and falls back to
|
||||
// safe bear-mode defaults when the call reverts. Since OptimizerV3Push3 only
|
||||
// exposes isBullMarket(), every recenter uses bear defaults — conservative and
|
||||
// correct for a baseline backtest.
|
||||
// OptimizerV3Push3.getLiquidityParams() uses zeroed inputs (no stake data),
|
||||
// so every recenter uses bear defaults — conservative and correct for a
|
||||
// baseline backtest.
|
||||
OptimizerV3Push3 optimizer = new OptimizerV3Push3();
|
||||
|
||||
// 2. Deploy LiquidityManager. It computes the pool address from factory + WETH +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue