Vault creation and operations
Resolve deployment inputs
Choose the chain and verify the underlying asset, owner, curator and fee recipient. Creation and address prediction use the canonical T3tris factory 0x0000000000CC53b5Fd649b80f08b05405779cC71, shared across supported chains; no factory input is required.
Creation uses name, symbol, asset, owner, curator and feeRecipient at the top level. Group flags in config, fee rates in fees, and salt/referral in deployment. Choose exactly one oracle variant: { safe: true, owner, maxDeviationUp?, maxDeviationDown? } for a fresh SafeOracle, or { address } for an existing compatible oracle. There are no duplicate oracle fields or zero-address sentinel inputs.
import type { DeployVaultArgs, T3trisWalletClient } from "@t3tris-labs/sdk";
import type { Address, Hex } from "viem";
export async function createVault(
client: T3trisWalletClient,
chainId: number,
deployer: Address,
salt: Hex,
asset: Address,
owner: Address,
referralCode?: Hex,
) {
const payload: DeployVaultArgs = {
chainId,
name: "My Vault",
symbol: "mvUSDC",
asset,
owner,
curator: owner,
feeRecipient: owner,
config: {
ipfsHash: "", // Optional metadata hash; defaults to "".
transferEnabled: true, // Allow share transfers.
depositEnabled: true, // Allow async deposit requests; vault still starts closed.
depositWhitelistEnabled: false, // No deposit whitelist restriction.
withdrawWhitelistEnabled: false, // No withdrawal whitelist restriction.
},
oracle: {
safe: true, // Create a new SafeOracle.
owner, // Address that administers the oracle.
maxDeviationUp: (1n << 128n) - 1n, // Optional WAD bound; default is effectively unbounded.
maxDeviationDown: 10n ** 18n, // Optional WAD bound; default allows a 100% decrease.
},
deployment: {
salt, // Unique bytes32 salt for this deployer.
referralCode, // Optional bytes32; omit when there is no referral.
},
fees: {
entry: 0n, // WAD: 10^16 = 1%; 0 = no entry fee.
exit: 0n, // WAD: 10^16 = 1%; 0 = no exit fee.
performance: 0n, // WAD: 10^16 = 1%; 0 = no performance fee.
management: 0n, // WAD rate accrued over managementDays; 0 = no fee.
managementDays: 365, // Management-fee accrual period in whole days.
},
};
const predicted = await client.vaults.read.previewAddress({ chainId, deployer, salt });
const result = await client.vaults.create(payload);
return { predicted, result };
}
To reuse an existing oracle, replace only oracle:
import type { DeployVaultArgs, T3trisWalletClient } from "@t3tris-labs/sdk";
import type { Address } from "viem";
export function createWithExistingOracle(
client: T3trisWalletClient, payload: DeployVaultArgs, address: Address,
) {
return client.vaults.create({ ...payload, oracle: { address } });
}
The deployer used for prediction must execute the factory call. Confirm execution and contract state before reporting deployment. All deployments start asynchronous; vaultOpened cannot be supplied. The flags above match Curate’s creation defaults: transfers and async deposit requests enabled, both whitelists disabled.
fees.entry, exit, performance, and management are bigint WAD rates (10^16 = 1%); managementDays is an integer number of days. deployment.salt is required bytes32. deployment.referralCode is an optional bytes32 referral identifier; pass it when attributing a deployment to a referral, or omit it to encode zero.
SafeOracle maxDeviationUp and maxDeviationDown are optional bigint WAD bounds. Omitted upward deviation defaults to 340282366920938463463374607431768211455n (2^128 − 1, effectively unbounded); omitted downward deviation defaults to 1000000000000000000n (100%). Each defaults independently. These are permissive defaults, not a risk policy. Set explicit bounds when your valuation policy requires them. oracle.owner remains required. The same defaults apply to defaultSafeOracle(owner).
Deployment is an on-chain action without an API key. Indexing and key attachment are separate steps. Once the API recognizes the vault, attach its { chainId, address } in Curate or with a manage key, then set its metadata.
Valuation and settlement
SafeOracle operations target the oracle contract, not the vault. oracles.setTotalAssets({ chainId, oracle, totalAssets }) pushes a valuation in underlying asset units. Check the oracle's roles and current deviation bounds before proposing a valuation. Custom oracles may expose different behavior, so do not call SafeOracle actions against an arbitrary oracle address.
For settlement, preview the intended path, establish any curator funding required by that preview, then request confirmation and submit once:
import { FeeClaimType, type T3trisWalletClient } from "@t3tris-labs/sdk";
import type { Address } from "viem";
export async function quoteSettlement(client: T3trisWalletClient, chainId: number, vault: Address) {
const preview = await client.vaults.read.previewSettleAll({
chainId, address: vault, feeClaimType: FeeClaimType.None,
});
return {
requiredCuratorAssets: preview.assetsFromCurator,
assetsToFeeRecipient: preview.assetsToFeeRecipient,
managementFeeAssets: preview.lastPeriodData.managementFeeAssets,
};
}
Use kind: "deposits" with previewSettleDeposits for deposits only. The "redemptions" path uses fullClaim and previewSettleRedemptions, rather than the fee-claim enum. A preview does not perform funding, and settle does not create allowances or signatures for you.
See settlement and lifecycle examples for each submission path and administration examples for role, oracle, fee and whitelist workflows.
Keep unsafe false unless your application deliberately supports and explains the escape hatch. Do not bypass a failed safety check merely to make a transaction succeed.
Fees and lifecycle
Fee changes are explicit queued actions: setNextEntryFee, setNextExitFee, setNextPerformanceFee and setNextManagementFee. Use the corresponding vaults.read.next*Fee methods to display queued values separately from active fees.
updateAccruedFees and claimFees are separate operations. Preview a claim with previewClaimFees; inspect its funding and output requirements before setting shares, minAssetsOut or permit2Data.
Lifecycle actions include pause, unpause, enableEndOfFund and disableEndOfFund. Deposit and share-transfer toggles are independent. Re-read state and permissions for each action instead of inferring eligibility from one UI flag. See curator operations for the product workflow.
Roles, whitelists and configuration
Vault and oracle roles are distinct. Inspect vault membership with roles.read.has and the admin relationship with roles.read.adminOf before offering a grant. Possessing an operational role does not automatically authorize assigning it to someone else.
roles.grantBatch, roles.revokeBatch, roles.grantAll and oracles.applyRoles submit ordered atomic multicalls. Put an admin grant before a leaf grant that depends on it. Preview the complete permission change and avoid unrequested grants.
Use the SDK's roles methods for vault admin handovers and oracles methods for oracle default-admin transfers. These are different multi-step processes, and acceptance must be performed by the intended recipient after any required delay. Irreversible renounces/burns need explicit confirmation.
Whitelists have independent enable flags and address membership. applyDepositWhitelist and applyWithdrawWhitelist update a batch of addresses; the corresponding set*WhitelistEnabled method toggles enforcement.
The on-chain reference lists address setters, silo configuration, share-balance updates and sweep actions. These methods can be governance-restricted or destructive. Exposing a method in the SDK does not mean the connected curator can execute it.