feat: add Sapien Vault TypeScript action provider - #1
Open
xhad wants to merge 3 commits into
Open
Conversation
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
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 SAPIENredeem— ERC-4626 redeem by vSAPIEN share amounttransfer— ERC-20 transfer of matured, unlocked vSAPIEN sharesget_position— shares, assets, matured/pending tranches, available balance, locked stake,depositAgeStatusget_vault_totals—totalAssetsand total shares (totalSupply)There is no standalone
approveaction.Network
Base mainnet only (
supportsNetworkgated). Other chains get a clear error from each action.Contracts (EIP-55)
0x60Bf63729f688287a450299962b36Cef0aFfaa420xC729777d0470F30612B1564Fd96E8Dd26f5814E3Notes
@coinbase/agentkit).Test plan
cd typescript/agentkit && pnpm test(sapienVault: 33 passed)