Integration guidesIntegrate with CreatorOVault
Integrate with CreatorOVault
How routers, keepers, and vault-claim holders should deposit, quote, and exit CreatorOVault safely.
This page is for routers, keepers, and anyone holding vault claims () directly. Retail flows should use CreatorOVaultWrapper, which converts between the creator coin and ShareOFT ().
At a glance
| Role | Integration rules for CreatorOVault |
| Deployed | Per creator, on Base |
| Standard(s) | ERC-4626 plus protocol extensions — see ERC-4626 deviations |
| Key relationships | CreatorOVaultWrapper, CreatorShareOFT, Vault capabilities |
Which token is which
| Token | Symbol | What it is |
|---|---|---|
| Creator coin | e.g. $AKITA | The vault's asset() |
| Vault claim | The ERC-4626 share. 1000 virtual-share offset. | |
| ShareOFT | 1000:1 wrap of . Used for trading, the lottery, and the LayerZero mesh. |
After wrapping, about 1 creator coin reads as about 1 . Do not show balances to end users. See Token units.
Integration notes
Depositing
Deposits only succeed when the whitelist allows the caller (if enabled), the vault is not paused or shut down, and vaultMode is Normal (not Suspect). The first deposit must be at least 50M creator coins or it reverts FirstDepositTooSmall.
Size deposits from maxDeposit / maxMint, not from previews. previewDeposit / previewMint are vanilla OpenZeppelin and ignore the deposit limit, whitelist, and strategy marks.
On agent-lane vaults, while the asset quotes a transfer tax, maxMint == 0 and previewMint reverts. Use deposit.
Exiting
The three-argument ERC-4626 exits work, but large exits are not instant.
| Size | Path |
|---|---|
Below largeWithdrawalThreshold | redeem / withdraw, optionally with a fourth maxLoss argument in bps |
| At or above the threshold | 1. queueWithdrawal(shares, receiver) 2. wait until unlockBlock 3. claimQueuedWithdrawal() |
- Calling the sync path on a large size reverts
LargeWithdrawalMustBeQueued. - Each address has one queue slot.
cancelQueuedWithdrawalreturns the shares. - Depositing and exiting in the same block is blocked (
withdrawDelayBlocks, default 1). Trusted adapters skip this stamp. - For ShareOFT holders, the wrapper's
withdrawandunwrapboth revertAsyncRedemptionRequiredat or above the threshold. Use the wrapper's async exit instead:requestAsyncExit(amount, receiver), wait for the vault delay, thenclaimAsyncExit(). ChecksupportsShareOFTAsyncExit()first; legacy wrappers return false. See CreatorOVaultWrapper.
Quoting
Some previews stay honest when queues or strategies are live; some do not.
| Function | Honest when queues or strategies are live? |
|---|---|
previewRedeem | Yes — capped at liquid assets minus queued |
erc4626PreviewRedeem | No — raw OpenZeppelin conversion |
previewWithdraw / previewDeposit / previewMint | No — inherited OpenZeppelin |
maxWithdraw / maxRedeem | Yes — liquidity plus the sync-size ceiling |
withdrawalEta(user, shares) | Yes — cooldown plus queue delay |
positionOf(user) | Yes — holdings, queue, and claimable |
Use previewRedeem with maxRedeem and withdrawalEta. Do not quote large exits with previewWithdraw.
Loss cap (maxLoss)
maxLoss is in bps of the requested assets, not of the shortfall. The four-argument redeem / withdraw overloads are Yearn-style. If unrealised strategy loss is above the cap, the call reverts StrategyHasUnrealisedLosses. The three-argument versions use defaultMaxLossBps, where 0 allows any loss.
Operators
Addresses without a grant are permissionless. Any grant, including setOperatorPerms(exec, 0), fail-closes that address to the granted permissions. clearOperatorPerms restores the baseline. The activation batcher checks isAuthorizedOperator(exec, OP_ACTIVATE).
Gotchas
- Impairment: while
vaultMode == Suspect,deposit/mint/withdraw/redeemrevert andmaxDeposit/maxMint/maxWithdraw/maxRedeemreturn 0. Do not retry sync exits. - Recovery after impairment uses merkle claims and escrow (
mintImpairmentClaim/claimImpairmentRecovery). Preferred leaves are ShareOFT holders, notvault.balanceOf(wrapper). See Impairment v1 disclosures and the state machine. - Never treat and as 1:1. The wrap is 1000 per 1 .
- Don't add product logic to the vault.
CreatorOVaultis an ABI and storage facade; new logic belongs in a module orOVaultViewLib.