Skip to content

feat: add Sapien Vault TypeScript action provider - #1

Open
xhad wants to merge 3 commits into
mainfrom
cursor/sapien-vault-action-provider-bb50
Open

feat: add Sapien Vault TypeScript action provider#1
xhad wants to merge 3 commits into
mainfrom
cursor/sapien-vault-action-provider-bb50

Conversation

@xhad

@xhad xhad commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a TypeScript Sapien Vault action provider for AgentKit so agents can deposit, withdraw or redeem, transfer vSAPIEN shares, and read vault totals plus tranche position state on the Sapien Vault (Base ERC-4626).

Upstream: coinbase#1493

Actions

  • deposit — ERC-4626 deposit. Approves SAPIEN internally only when allowance is insufficient (not a public action)
  • withdraw — ERC-4626 withdraw back to SAPIEN
  • redeem — ERC-4626 redeem by vSAPIEN share amount
  • transfer — ERC-20 transfer of matured, unlocked vSAPIEN shares
  • get_position — shares, assets, matured/pending tranches, available balance, locked stake, depositAgeStatus
  • get_vault_totalstotalAssets and total shares (totalSupply)

There is no standalone approve action.

Network

Base mainnet only (supportsNetwork gated). Other chains get a clear error from each action.

Contracts (EIP-55)

  • Vault / vSAPIEN: 0x60Bf63729f688287a450299962b36Cef0aFfaa42
  • Underlying SAPIEN: 0xC729777d0470F30612B1564Fd96E8Dd26f5814E3

Notes

  • Pattern follows the Morpho Vault provider.
  • Includes unit tests, provider README, package README mention, and a changeset (patch for @coinbase/agentkit).
  • App: https://vault.sapien.io

Test plan

  • cd typescript/agentkit && pnpm test (sapienVault: 33 passed)
  • Review Base-only network gate
  • Optional: smoke via langchain CDP smart wallet chatbot example
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 10, 2026 06:42
Add an EVM action provider so AgentKit agents can deposit SAPIEN,
withdraw or redeem vSAPIEN, and read position state on the Base
mainnet ERC-4626 Sapien Vault.

Co-authored-by: Chad <xhad@users.noreply.github.com>
Prevent a leftover approve call from the insufficient-allowance
deposit test from failing the skip-approve assertion.

Co-authored-by: Chad <xhad@users.noreply.github.com>
@xhad
xhad marked this pull request as ready for review September 10, 2026 06:44
Remove RewardsController. Keep SAPIEN approve as an internal
deposit helper only. Add get_vault_totals, tranche fields on
get_position, and vSAPIEN transfer with matured/available checks.

Co-authored-by: Chad <xhad@users.noreply.github.com>
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.

2 participants