Skip to content

feat(morpho-sdk): add vault in-kind redemption - #915

Open
Rubilmax wants to merge 13 commits into
in-kind-redemption-checksfrom
vault-exit-in-kind-redemption
Open

feat(morpho-sdk): add vault in-kind redemption#915
Rubilmax wants to merge 13 commits into
in-kind-redemption-checksfrom
vault-exit-in-kind-redemption

Conversation

@Rubilmax

@Rubilmax Rubilmax commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add pure vaultV1InKindRedeem and vaultV2InKindRedeem transaction actions backed by VaultExitBundlesV1
  • add lazy Vault V1/V2 entity flows with typed preflight validation, max-share permit/approval requirements, and Vault V2's two-field permit domain
  • register the standalone bundle address slot and publish its ABI
  • add unit, property, mock-client, and mainnet-fork coverage, plus SDK docs and a changeset

Why

Vault exits can require withdrawing illiquid Morpho positions in kind. This exposes the bundle flow through the SDK while detecting coverage, gate, balance, chain, vault, permit, and adapter failures before calldata is built.

This PR is stacked on #909.

Validation

  • pnpm lint
  • pnpm test — 220 files, 2,744 tests passed
  • pnpm --filter @morpho-org/morpho-sdk exec tsc --noEmit
  • focused permit encoder tests
  • Vault V2 mainnet-fork permit execution against the contract's DOMAIN_SEPARATOR()

@Rubilmax Rubilmax self-assigned this Aug 4, 2026
@Rubilmax
Rubilmax force-pushed the vault-exit-in-kind-redemption branch from a3ff2ae to 94f578b Compare August 5, 2026 06:51
@Rubilmax
Rubilmax marked this pull request as ready for review August 5, 2026 07:06
@Rubilmax
Rubilmax requested a review from a team as a code owner August 5, 2026 07:06

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

@Rubilmax Rubilmax left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost lgtm, pending deployment

jinmel
jinmel previously approved these changes Aug 6, 2026
Comment thread packages/morpho-sdk/src/actions/vaultV2/inKindRedeem.ts
Comment thread packages/morpho-sdk/src/actions/vaultV1/inKindRedeem.ts
@Rubilmax

Copy link
Copy Markdown
Contributor Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 78eeda202c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/morpho-sdk/src/entities/vaultV1/vaultV1.ts Outdated
Comment thread packages/morpho-sdk/src/entities/vaultV1/vaultV1.inKindRedeem.test.ts Outdated
Comment thread docs/tibs/TIB-2026-07-27-vault-exit-in-kind-redemption.md Outdated
Comment thread packages/morpho-sdk/src/entities/vaultV2/vaultV2.ts
Comment thread packages/morpho-sdk/src/actions/signatures/getVaultExitBundlesV1PermitStruct.ts Outdated
Comment thread packages/morpho-sdk/src/types/error.ts Outdated
Comment thread packages/morpho-sdk/src/types/error.ts Outdated
Comment thread docs/tibs/TIB-2026-07-27-vault-exit-in-kind-redemption.md Outdated
Comment thread docs/tibs/TIB-2026-07-27-vault-exit-in-kind-redemption.md Outdated
jinmel
jinmel previously approved these changes Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants