TrussDocs

Policies

Policies

The policy slots a vault and its sub-accounts expose, what each one decides, and which policies exist today.

A policy is a small contract that a vault or a sub-account asks a question at a fixed point in a flow, such as "may this address hold shares?". Its answer decides whether that step goes ahead. Policies let a vault take on a rule its product needs, such as a cap or an allowlist, without any change to the vault's own code. This page lists the slots, what each one decides, and which policies exist today.

Key points

  • A vault has three policy slots: deposit, holder and withdrawal. Each sub-account has an allocation slot, and each module on a tracked sub-account has an execution policy.
  • A policy serves one vault. It must name that vault and answer to the vault's AccessManager, or binding it is refused.
  • Binding or replacing a policy on a live vault waits the CRITICAL tier. A holder and a withdrawal policy can also be bound at deployment, with no wait.
  • Deposit cap, allocation, swap and lend policies exist today. No holder or withdrawal policy has been built yet.

The slots

SlotWhat it decidesLives onBound withExists today
DepositWhether a deposit request may open, and how much one deposit settlement may fillThe vaultsetDepositPolicyDepositCapPolicy, bound at deployment
HolderWho may receive shares or a pending requestThe vaultsetHolderPolicy, or at deploymentNone
WithdrawalWho may redeem shares for USDC, and who may be paidThe vaultsetWithdrawalPolicy, or at deploymentNone
AllocationWhether the vault may push USDC into a sub-accountEach sub-accountsetSubAccountAllocationPolicySubAccountAllocationPolicy, bound at deployment
Swap executionWhether a swap may run, and how much it may moveEach swap moduleaddModuleSubAccountSwapPolicy, one per swap module
Lend executionWhether a supply or a withdrawal may run, and how much may be suppliedEach lend moduleaddModuleSubAccountLendPolicy, one per vault

Every binding is the VaultAdmin's alone, at the CRITICAL tier. The tier's length is chosen per vault at deployment; the committed preprod configs use 14 days. See Who can call what.

How a policy is bound

  • The setter reads the policy's vault() and authority(). It refuses a policy that serves another vault, or that answers to another AccessManager.
  • Unbinding is the same setter with the zero address, so it waits the same CRITICAL tier. With no deposit policy, every request is admitted and settlement is uncapped. With no holder or withdrawal policy, anyone may hold or redeem. With no allocation policy, pushes have no cap or rate limit.
  • A slot holds one policy. A vault that needs several rules in one slot needs one contract that combines them. Replacing the deposit cap policy removes the cap, unless the new policy enforces one too.
  • At deployment, the factory binds the deposit cap policy and the allocation policy, and installs each module with its policy. It binds a holder and a withdrawal policy only if the deployer names one; zero binds none. A policy named at deployment must already exist, built against the vault's predicted address.

A module's policy cannot be swapped in place. The module is removed, which removeModule allows only once the sub-account holds nothing but USDC, and added back with the new policy, which waits CRITICAL.

What cannot be swapped

Two contracts that work like policies are fixed for the vault's life. The instant redemption policy is set when the vault is initialized, and the vault has no setter for it. Its limits, freshness gate and default source change at their own tiers. An attested sub-account's call verifier is set when the account is initialized. The call shapes it allows change at their tiers. See What is immutable.

Where to read more

PageWhat it covers
Vault policiesThe deposit, holder and withdrawal hooks, and every function that asks them
Sub-account policiesThe allocation and execution hooks, and every function that calls them
Policies that could be builtUses for each slot that no contract implements today
Building a policyWhat a new policy must satisfy, how its failures behave, and what no policy can do
Bind a policyThe steps to bind, replace or remove a policy on a live vault