feat: default shared-liquidity target utilization to 90% and deprecate its tuning surface - #866
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Reworks the "hardcode 90%" change to be non-breaking. Instead of removing the tuning surface, keep it and mark it @deprecated, and change only the default constant values. No public symbol is removed, renamed, or retyped, so morpho-sdk and liquidity-sdk-viem stay on a minor bump. morpho-sdk (minor): - DEFAULT_SUPPLY_TARGET_UTILIZATION and DEFAULT_WITHDRAWAL_TARGET_UTILIZATION are now both 90% (were 90.5% and 92%). - PublicAllocatorOptions.maxWithdrawalUtilization / defaultMaxWithdrawalUtilization and ReallocationComputeOptions.supplyTargetUtilization / defaultSupplyTargetUtilization are @deprecated but still honored. liquidity-sdk-viem (minor): - LiquidityParameters and the LiquidityLoader parameters argument are @deprecated. The source-market withdrawal ceiling defaults to 90% and the API targetWithdrawUtilization field is no longer consulted; explicit parameters overrides are still honored. wdk-protocol-lending-morpho-evm cascades a patch. Tests, JSDoc, and the changeset are updated; the parity suite pins the legacy 92% default so it stays algorithm-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
daeb380 to
eabd95c
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
… peer The pinned-block fork tests in liquidity-sdk-viem/test/loader.test.ts still asserted withdrawal plans computed with the API-provided per-market ceilings; re-record them against the fixed 90% default. Bump the morpho-sdk peer range to ^5.4.0 since the 90% ceiling ships with that release — an older peer would silently keep the 92% default now that the API value is ignored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
… default The withdrawal-utilization default is now always 90%, so the parity harness pins the legacy SimulationState reference onto morpho-sdk's DEFAULT_WITHDRAWAL_TARGET_UTILIZATION (90%) instead of a hardcoded 92% LEGACY_DEFAULT_WITHDRAWAL_UTILIZATION constant. Single source of truth; the comparison stays algorithm-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves the conflicts by taking `main` as the base for every file and re-applying only the deprecated-package removal on top, so nothing landed on `main` since the branch point is reverted. The branch had been rebased in a way that dropped work merged into `main` after its branch point. Restored from `main` and kept out of the resolution: - `ReallocationData.getPublicReallocationLiquidity` and `getAvailableLiquidityToUtilization` (#796, #813) plus their `reallocationData.metrics.test.ts` suite. - `helpers/utilization.ts` (`getSupplyTargetUtilization`) and its use in `computeReallocations`, including the #866 target-utilization changes. - `morpho-sdk` version 5.4.1 and its 4.1.0 → 5.4.1 CHANGELOG entries (the branch reset the manifest to 4.0.0). - `docs/tibs/TIB-2026-06-16-shared-liquidity-target-utilization-metric.md`. - The `README.md` "Secondary packages" wording and the `midnight-sdk` entry. - `BundlerAction.morphoSetAuthorizationWithSig` and the `midnight-sdk` Vitest project / fork-test timeouts. Deprecated-package removal re-applied against current `main`: - Deleted `simulation-sdk`, `bundler-sdk-viem`, `blue-sdk-wagmi`, `migration-sdk-viem`, `simulation-sdk-wagmi`. - Dropped their Biome ignores, Typedoc entry points, Vitest projects and CI filters, JSDoc coverage tiers, and the `--exclude-deprecated` checksum-lint flag. - Removed the frozen-deprecated-package rules from `AGENTS.md` and the `code-quality` / `style-conventions` / `ci-release-security` personas. - Dropped the two `morpho-sdk` devDependencies on the deleted packages and the parity suites that were their only consumers (`bundler-sdk-viem parity` in `bundler/actions.test.ts`, `ReallocationData SimulationState parity` in `reallocationData.test.ts`). - Regenerated `pnpm-lock.yaml` (deletions only, no version drift). Validation: `pnpm lint`, `pnpm build:ci`, `tsc --noEmit` per package, and 1395 + 510 + 96 non-fork tests pass. Fork suites need RPC secrets and were not run locally.
Motivation
The shared-liquidity algorithm exposes configurable supply-target and source-market withdrawal utilizations (via
PublicAllocatorOptions,ReallocationComputeOptions, andliquidity-sdk-viem'sLiquidityParameters/ the API'stargetWithdrawUtilization). We want both knobs to converge on a single 90% default and to stop advertising them as tunable, without breaking existing integrators.Solution
Non-breaking (minor): the defaults move to 90% and the whole tuning surface is
@deprecatedbut still fully honored until the next major.@morpho-org/morpho-sdk(minor):DEFAULT_SUPPLY_TARGET_UTILIZATIONandDEFAULT_WITHDRAWAL_TARGET_UTILIZATIONare now both 90% (previously 90.5% and 92%). Callers passing no override trigger reallocations at 90% and cap phase-1 source-market withdrawals at 90%; the aggressive phase-2 fallback still drains to 100% as a last resort.PublicAllocatorOptions.maxWithdrawalUtilization/defaultMaxWithdrawalUtilizationandReallocationComputeOptions.supplyTargetUtilization/defaultSupplyTargetUtilizationare@deprecated. The per-market → default → constant resolution chain is unchanged, so explicit overrides behave exactly as before.@morpho-org/liquidity-sdk-viem(minor):LiquidityParametersand theLiquidityLoaderparametersconstructor argument are@deprecated. The loader no longer consults the Morpho API's per-markettargetWithdrawUtilization; the ceiling defaults to 90% viamorpho-sdk. Explicitly passedparametersoverrides are still forwarded and honored.@morpho-org/morpho-sdkpeer range moves to^5.4.0, since the 90% default ceiling ships with that release (an older peer would silently keep the 92% default now that the API value is ignored).@morpho-org/wdk-protocol-lending-morpho-evm(patch): dependency-resolution cascade only.Tests, JSDoc, and the changeset land with the change.
🤖 Generated with Claude Code