Skip to main content

CoreIntegrate with CreatorOVault

How to integrate with CreatorOVault

CreatorOVault is ERC-4626 + protocol extensions. Do not treat it as a vanilla Yearn/OZ vault. Full deviation table: ERC-4626 deviations. Impairment: state machine.

Retail users should go through CreatorOVaultWrapper (creator coin ↔ ShareOFT). This page is for routers, keepers, and vault-share () holders.

Tokens

TokenSymbolWhat it is
Creator coine.g. AKITAVault asset()
Vault sharesERC-4626 share. 1000 virtual-share offset.
ShareOFT1000:1 wrap of . Trading / lottery / LZ mesh.

after wrap. Do not display to end users.

Deposit / mint

  • deposit / mint are gated: whitelist (if enabled), not paused, not shutdown, vault Normal (not Suspect).
  • First deposit has a minimum (FirstDepositTooSmall).
  • previewDeposit / previewMint are vanilla OZ. They ignore deposit limit, whitelist, and strategy marks. Use maxDeposit / maxMint (ViewLib) as the capacity check; do not size a tx from preview alone.
  • Agent-lane vaults: maxMint == 0, previewMint reverts. Use deposit.

Withdraw / redeem

Three-arg ERC-4626 paths stay. Large exits are not instant.

SizePath
Below largeWithdrawalThresholdredeem / withdraw (optional 4-arg maxLoss bps)
At or above thresholdqueueWithdrawal(shares, receiver) → wait unlockBlockclaimQueuedWithdrawal()
  • LargeWithdrawalMustBeQueued if you try the sync path on a large size.
  • One queue slot per address. cancelQueuedWithdrawal returns shares.
  • Same-block deposit→exit is blocked (withdrawDelayBlocks, default 1). Trusted adapters skip the stamp.
  • 4-arg redeem/withdraw(..., maxLoss) is Yearn-style. 3-arg uses defaultMaxLossBps (0 = allow all).

Previews (integrator trap)

FunctionHonest when queues / strategies are live?
previewRedeemYes — caps at liquid − queued
erc4626PreviewRedeemNo — raw OZ convert
previewWithdraw / previewDeposit / previewMintNo — inherited OZ
maxWithdraw / maxRedeemYes — liquidity + sync-size ceiling
withdrawalEta(user, shares)Yes — cooldown + queue delay
positionOf(user)Yes — holdings, queue, claimable

Prefer previewRedeem + maxRedeem + withdrawalEta. Do not quote large exits with previewWithdraw.

CreatorOVaultWrapper.withdraw refuses the queue path (AsyncRedemptionRequired). Large exits must unwrap to and call queueWithdrawal on the vault.

maxLoss

maxLoss is bps of requested assets, not of the shortfall. Unrealised strategy loss above the cap reverts StrategyHasUnrealisedLosses. If you do not pass it, you inherit defaultMaxLossBps.

Impairment

While vaultMode == Suspect:

  • deposit / mint / withdraw / redeem revert
  • maxDeposit / maxMint / maxWithdraw / maxRedeem return 0

Do not retry sync exits. Recovery is merkle claims + escrow (mintImpairmentClaim / claimImpairmentRecovery). Preferred leaves are ShareOFT holders, not vault.balanceOf(wrapper). Details: Impairment v1 disclosures.

Operators

Unregistered addresses are permissionless. A grant — including setOperatorPerms(exec, 0)fail-closes that exec. clearOperatorPerms restores baseline. Activation batcher checks isAuthorizedOperator(exec, OP_ACTIVATE).

What not to add

The vault file is an ABI + storage facade. New product logic goes in a module or OVaultViewLib, not on CreatorOVault.