Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1fa5ff2
feat(morpho-sdk): support Public Allocator V2 reallocations
prd-carapulse[bot] Aug 6, 2026
77d49ac
docs(morpho-sdk): document allocator V2 overflow errors
prd-carapulse[bot] Aug 6, 2026
77714ea
fix(morpho-sdk): validate allocator V2 source types
prd-carapulse[bot] Aug 6, 2026
bb5ce3e
fix: harden Public Allocator V2 support
Rubilmax Aug 6, 2026
5ed0d27
refactor: align BluePublicAllocator naming
Rubilmax Aug 6, 2026
e75a1d8
feat: add Vault V2 shared liquidity support
Rubilmax Aug 6, 2026
6122198
fix: simplify Vault V2 shared liquidity
Rubilmax Aug 7, 2026
50a225e
fix: centralize market params ABI and preserve TIBs
Rubilmax Aug 7, 2026
f3cc8b3
feat: add Vault V2 liquidity loader
Rubilmax Aug 7, 2026
c2b6a5d
refactor: rename Vault V2 allocator options
Rubilmax Aug 7, 2026
3abb520
feat: use REST data for Vault V2 liquidity
Rubilmax Aug 11, 2026
6e52e15
fix: update BluePublicAllocator contract integration
Rubilmax Aug 14, 2026
a9433e9
fix: correct Vault V2 public allocator planning
Rubilmax Aug 14, 2026
fdce6c4
fix: harden Vault V2 reallocation planning
Rubilmax Aug 14, 2026
c2eddaa
fix: keep Vault V2 simulation state coherent
Rubilmax Aug 14, 2026
6649e1c
refactor: split Vault V2 liquidity loader
Rubilmax Aug 17, 2026
bcbe0fc
refactor: normalize Vault V2 active adapters
Rubilmax Aug 17, 2026
141f00a
refactor: simplify public allocator implementation
Rubilmax Aug 17, 2026
db7906a
refactor: accept iterable reallocation inputs
Rubilmax Aug 17, 2026
4f1a196
feat: register Vault V2 public allocators by chain
Rubilmax Aug 17, 2026
15112a8
refactor: clarify Vault V2 cap IDs
Rubilmax Aug 18, 2026
6aa6be4
chore: drop unrelated PR changes
Rubilmax Aug 18, 2026
25840c3
refactor: align Vault V2 Blue reallocation API
Rubilmax Aug 18, 2026
d625850
feat: configure Vault V2 withdrawal utilization
Rubilmax Aug 18, 2026
93fbdea
test: use deployed BluePublicAllocator
Rubilmax Aug 19, 2026
2bc9da8
refactor: align allocator reallocation names
Rubilmax Aug 19, 2026
fbe58b8
refactor: separate allocator reallocation versions
Rubilmax Aug 19, 2026
ead1aad
refactor: model vault v2 allocator penalties
Rubilmax Aug 19, 2026
c2e46d3
refactor: hydrate vault v2 market allocator config
Rubilmax Aug 19, 2026
0c378fd
fix: harden Vault V2 allocator compatibility
Rubilmax Aug 19, 2026
a001917
fix: address Vault V2 allocator review findings
Rubilmax Aug 19, 2026
82c9cee
Merge remote-tracking branch 'origin/vault-v2-public-allocator-tib' i…
Rubilmax Aug 19, 2026
781059e
fix: handle Vault V2 allocator edge cases
Rubilmax Aug 19, 2026
913f6ee
fix: address Vault V2 allocator review findings
Rubilmax Aug 20, 2026
f2119a6
fix: complete Vault V2 allocator review fixes
Rubilmax Aug 20, 2026
c7d9a57
fix: finish Vault V2 allocator review fixes
Rubilmax Aug 21, 2026
bb9bd15
fix(morpho-sdk): validate allocator penalty limits
Rubilmax Aug 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/brave-vaults-reallocate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@morpho-org/morpho-ts": minor
"@morpho-org/blue-sdk": minor
Comment thread
Rubilmax marked this conversation as resolved.
"@morpho-org/blue-sdk-viem": minor
"@morpho-org/liquidity-sdk-viem": patch
"@morpho-org/morpho-sdk": minor
Comment thread
Rubilmax marked this conversation as resolved.
Comment thread
Rubilmax marked this conversation as resolved.
Comment thread
Rubilmax marked this conversation as resolved.
"@morpho-org/wdk-protocol-lending-morpho-evm": minor
---

Add canonical `vaultV1PublicAllocatorAbi` and `vaultV2BluePublicAllocatorAbi` exports plus per-chain `vaultV1PublicAllocator` and `vaultV2BluePublicAllocator` registry entries to `morpho-ts`, preserving `publicAllocatorAbi` and `publicAllocator` as deprecated V1 aliases. Move the shared `marketParamsAbi` source of truth there while preserving its `blue-sdk` re-export, and raise the `blue-sdk` peer range to the introducing `morpho-ts` minor. Add Vault V2 allocation-cap helpers and the updated `canPullFromIdle`/`canPullFromMarket`/WAD-scaled penalty config types to `blue-sdk`, accept iterable active-adapter, vault-allowlist, and reallocation-plan inputs while normalizing them before repeated use, add chain-registry-backed deployless and fallback reads to `blue-sdk-viem`, and expose Vault V2 shared-liquidity discovery, planning, metrics, maximum-penalty filtering, and flat market/idle reallocations through `morpho-sdk` Blue flows.

V2 bundles now pull the proportional loan-token penalty through GeneralAdapter1, grant the allocator an exact non-skippable allowance from Bundler3, pass the configured `uint64 penalty` in calldata, and keep the nonpayable allocator calls out of `tx.value`. The planner mirrors contract execution order for penalties, source deallocation, first vault accrual (including zero-elapsed loss recognition), and target allocation; freezes the resulting relative-cap denominator across later calls for that vault; keeps every adapter coherent with one canonical simulated state per Morpho market; rejects non-positive operation amounts and same-market moves across adapters; and uses the latest timestamp in its complete input snapshot by default.

Use coherent protocol-specific names across the V1 and V2 reallocation APIs, including `VaultV1ReallocationData`, `VaultV2BlueReallocationData`, `computeVaultV1Reallocations`, `VaultV2BluePublicAllocatorOptions`, and Vault V2-prefixed Bundler actions. Add `MorphoBlue.getVaultV1ReallocationData` and `getVaultV2BlueReallocationData`, preserving the published unversioned `getReallocationData` as a deprecated V1 alias. Keep V1's `defaultMaxWithdrawalUtilization` configurable, and add V2's scalar `maxWithdrawalUtilization` for its friendly phase while retaining the 100% adversarial fallback.

Compatibility note: `VaultV2MorphoMarketV1AdapterV2.ids()` now declares its existing three-element result as `readonly [Hash, Hash, Hash]`. The runtime values and ordering are unchanged, and derived allocation identifiers are immutable descriptors. We intentionally accept this TypeScript assignability tightening in the minor release; callers that explicitly require a mutable `Hash[]` can copy the tuple with `[...adapter.ids(params)]`.

Name allocation-cap helpers `adapterCapId`, `collateralCapId`, and `adapterMarketCapId`. Preserve the published `adapterId`, `collateralId`, and `marketParamsId` helpers as deprecated aliases.

Add an explicit `MorphoBorrowWithV2ReallocationsOptions` WDK opt-in for the combined V1/V2 reallocation union and its possible approval requirement while preserving the legacy `MorphoBorrowOptions` input and authorization-only requirement result type.
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ A scannable list of patterns reviewers reject. Most are review-only today (per t
- `@throws` for each typed error class an integrator may pattern-match on.
- One `@example` block with realistic working code: imports, client setup, the call, expected return.
- **AI-legibility is first-class.** Identical signatures across V1/V2 where protocols overlap. Discriminated unions with obvious `type` tags. Deterministic outputs verifiable byte-for-byte. Error messages read like instructions an agent can act on without guessing. Protocol-specific terms (`LLTV buffer`, `wNative`, `GeneralAdapter1`, `bundler3`, `PublicAllocator`, `MetaMorpho`, `Permit2`, `WAD`) live in the [`packages/morpho-sdk/AGENTS.md`](./packages/morpho-sdk/AGENTS.md) glossary.
- **Implemented TIBs are historical records.** Do not rewrite a TIB already present on the target branch to follow later code, symbol, or path changes. Keep the TIB's implementation-time names and examples intact. A changed decision gets a new superseding TIB; an operational clarification gets a dated addendum. Only a TIB introduced for the current implementation may be kept in sync with that implementation before it lands.
Comment thread
Rubilmax marked this conversation as resolved.
Comment thread
Rubilmax marked this conversation as resolved.
Comment thread
Rubilmax marked this conversation as resolved.
- **TypeDoc-generated reference** published per release.
- **Feedback loop:** if the same question is asked twice, the answer goes into the relevant `AGENTS.md` or JSDoc on the export it concerns.

Expand Down
Loading
Loading