Sapien Vault
The Sapien Vault is the onchain economic-security layer for Proof of Quality (PoQ). You can deposit SAPIEN and receive vault shares (vSAPIEN). Locking stake as collateral for validation work is optional and at your sole discretion if you choose to participate as a validator. When you do lock, the vault escrows that collateral and applies unlock or slash outcomes decided by the offchain PoQ engine.
It does not score contributions or run consensus onchain. It only holds assets and enforces lock / unlock / slash instructions.
What it is
| Property | Detail |
|---|---|
| Standard | ERC-4626 tokenized vault |
| Asset | SAPIEN (ERC-20) |
| Shares | Sapien PoQ Vault / vSAPIEN |
| Deployment | Upgradeable (UUPS) behind an ERC-1967 proxy |
| Storage | ERC-7201 namespaced layout (sapien.storage.SapienVault) |
How it fits PoQ
- Anyone can deposit SAPIEN into the vault and receive vSAPIEN shares.
- If you opt in as a validator, after shares mature past the configured deposit age you may call
lockStake— optionally, at your sole discretion — to put collateral at risk for validation work. - The offchain PoQ engine evaluates outcomes and, when needed, calls:
unlockStake— reduce locked amount; value becomes withdrawable againslashStake— burn shares so the validator loses the slashed value
- The validator withdraws or redeems whatever remains unlocked and matured.
In the product API, validators who choose to participate on staked projects typically lock stake through the staking / batch-lock flow before claiming validations. The vault is the onchain source of truth for locked vs available balance.
Stake model
Each address has one stake account:
| Concept | Meaning |
|---|---|
| Locked | Portion of economic stake committed for validation; not withdrawable until unlocked or slashed |
| Available | Matured position minus locked amount — what you can lock further or withdraw |
| Call | Who | Effect |
|---|---|---|
deposit / mint | Anyone | Add SAPIEN; mint vSAPIEN |
lockStake(amount) | Share holder | Move available → locked |
unlockStake(user, amount) | Engine role | Reduce locked amount (no burn) |
slashStake(user, amount) | Engine role | Reduce locked amount and burn shares |
withdraw / redeem | Share holder | Exit matured, unlocked value |
lockStake is permissionless for the holder and is never automatic — you choose whether and how much to lock. Unlock and slash are engine-only — locked stake cannot be exited without the engine (or a slash).
Roles
| Role | Typical holder | Capabilities |
|---|---|---|
DEFAULT_ADMIN_ROLE | Governance multisig | Pause, upgrades, role grants, deposit-age / tranche settings |
ENGINE_ROLE | PoQ engine smart account | unlockStake, slashStake only |
Admin can pause the vault to halt a misbehaving engine, and can revoke ENGINE_ROLE. Pause stops deposits, withdrawals, transfers, and lock/unlock/slash paths that respect pause.
Deposit age
To resist flash deposit → lock → exit patterns, the vault can require shares to age before they count as available for lock, transfer, or withdraw.
- Configured by admin (
minDepositAge, capped at 7 days). - Enforced per share cohort (tranche), not as a single global timer per user.
- Fresh deposits create immature tranches; once aged, shares fold into the matured bucket.
- Use
depositAgeStatus(user)(ormaturedShares/pendingShares) when integrating.
When minDepositAge is 0, deposits are immediately mature.
Deployments
| Network | Chain ID | Vault | SAPIEN |
|---|---|---|---|
| Base | 8453 | 0x60Bf63729f688287a450299962b36Cef0aFfaa42 | 0xC729777d0470F30612B1564Fd96E8Dd26f5814E3 |
| Base Sepolia | 84532 | 0x58E72Fa7fb92B100f2c652377465EEEe2642544C | 0x7F54613f339d15424E9AdE87967BAE40b23Fa7F6 |
Canonical deployment JSON lives in the sapien-contracts repository under deployments/.
Integrator notes
- Prefer ERC-4626
preview*andmax*helpers before submitting txs; they reflect pause, locks, and deposit age. - Locked stake reduces
maxWithdraw/maxRedeem. - Slashing burns shares without removing underlying SAPIEN from the vault, so remaining stakers' share value appreciates. Index both slash amount and shares burned.
- Engine liveness matters: if unlocks stop, locked stake stays locked until the engine resumes (or ops intervene via pause / role revoke — which still does not auto-unlock existing locks).
Further reading
- Github Repo: sapien-contracts
- Contract deep dive:
docs/SapienVault.mdin sapien-contracts - OpenZeppelin ERC-4626
Security audit
Quantstamp audited SapienVault. Read the final report: