-
Notifications
You must be signed in to change notification settings - Fork 43
feat(morpho-sdk): support BluePublicAllocator reallocations #919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
prd-carapulse
wants to merge
37
commits into
vault-v2-public-allocator-tib
from
hermes/public-allocator-v2-sdk
+9,678
−686
Open
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] 77d49ac
docs(morpho-sdk): document allocator V2 overflow errors
prd-carapulse[bot] 77714ea
fix(morpho-sdk): validate allocator V2 source types
prd-carapulse[bot] bb5ce3e
fix: harden Public Allocator V2 support
Rubilmax 5ed0d27
refactor: align BluePublicAllocator naming
Rubilmax e75a1d8
feat: add Vault V2 shared liquidity support
Rubilmax 6122198
fix: simplify Vault V2 shared liquidity
Rubilmax 50a225e
fix: centralize market params ABI and preserve TIBs
Rubilmax f3cc8b3
feat: add Vault V2 liquidity loader
Rubilmax c2b6a5d
refactor: rename Vault V2 allocator options
Rubilmax 3abb520
feat: use REST data for Vault V2 liquidity
Rubilmax 6e52e15
fix: update BluePublicAllocator contract integration
Rubilmax a9433e9
fix: correct Vault V2 public allocator planning
Rubilmax fdce6c4
fix: harden Vault V2 reallocation planning
Rubilmax c2eddaa
fix: keep Vault V2 simulation state coherent
Rubilmax 6649e1c
refactor: split Vault V2 liquidity loader
Rubilmax bcbe0fc
refactor: normalize Vault V2 active adapters
Rubilmax 141f00a
refactor: simplify public allocator implementation
Rubilmax db7906a
refactor: accept iterable reallocation inputs
Rubilmax 4f1a196
feat: register Vault V2 public allocators by chain
Rubilmax 15112a8
refactor: clarify Vault V2 cap IDs
Rubilmax 6aa6be4
chore: drop unrelated PR changes
Rubilmax 25840c3
refactor: align Vault V2 Blue reallocation API
Rubilmax d625850
feat: configure Vault V2 withdrawal utilization
Rubilmax 93fbdea
test: use deployed BluePublicAllocator
Rubilmax 2bc9da8
refactor: align allocator reallocation names
Rubilmax fbe58b8
refactor: separate allocator reallocation versions
Rubilmax ead1aad
refactor: model vault v2 allocator penalties
Rubilmax c2e46d3
refactor: hydrate vault v2 market allocator config
Rubilmax 0c378fd
fix: harden Vault V2 allocator compatibility
Rubilmax a001917
fix: address Vault V2 allocator review findings
Rubilmax 82c9cee
Merge remote-tracking branch 'origin/vault-v2-public-allocator-tib' i…
Rubilmax 781059e
fix: handle Vault V2 allocator edge cases
Rubilmax 913f6ee
fix: address Vault V2 allocator review findings
Rubilmax f2119a6
fix: complete Vault V2 allocator review fixes
Rubilmax c7d9a57
fix: finish Vault V2 allocator review fixes
Rubilmax bb9bd15
fix(morpho-sdk): validate allocator penalty limits
Rubilmax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| "@morpho-org/morpho-ts": minor | ||
| "@morpho-org/blue-sdk": minor | ||
| "@morpho-org/blue-sdk-viem": minor | ||
| "@morpho-org/liquidity-sdk-viem": patch | ||
| "@morpho-org/morpho-sdk": minor | ||
|
Rubilmax marked this conversation as resolved.
Rubilmax marked this conversation as resolved.
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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.