TrussDocs

Policies

Vault policies

The deposit, holder and withdrawal policies, the hook each one exposes, and every function that asks it.

A vault asks up to three policies about the people using it. The deposit policy decides what may come in, the holder policy who may receive shares, and the withdrawal policy who may take USDC out. This page lists each hook and every function that asks it, so you can see exactly where a rule applies and where it does not.

Key points

  • The deposit policy is asked when a deposit request opens, and once per deposit settlement for how much may fill.
  • The holder policy is asked wherever shares or a pending request arrive, and never about the address they leave.
  • The withdrawal policy is asked about whoever controls or is paid by a redemption, never about the owner whose shares it takes.
  • Settlement never asks the holder or withdrawal policy, so one refused address cannot stop a batch.

The deposit policy

applyDepositPolicyOnRequest(intent) sees the caller, the owner the USDC comes from, the controller and the amount. It reverts to refuse, and may update its own state, such as using up a limit. settlementHeadroom() returns the most one deposit settlement may fill across its batch.

FunctionHookWhen
requestDepositapplyDepositPolicyOnRequestAfter the minimum and the holder check, before the USDC moves
settleDepositsettlementHeadroomOnce per batch. Below demand, every request fills pro rata
depositCapacity()settlementHeadroomA view

Claims, cancellations and deposit request transfers never ask it. DepositCapPolicy admits every request. Its headroom is the cap less the net principal already settled.

The holder policy

canHold(account) says whether account may receive shares or a pending request. A false reverts the action with HolderNotAllowed. A policy that reverts reverts the action too.

FunctionWho is asked about
requestDepositThe controller
requestRedeem, requestRedeemAndExecuteThe controller, only when it is not the owner
deposit, mint, claimDepositForThe address the shares go to
transfer, transferFromThe recipient
transferDepositRequest, transferRedeemRequestThe new controller
cancelRedeemRequestThe controller, whom the shares return to
forceTransferThe address the position moves to

It is never asked about the sender, a burn, the vault itself, which holds escrowed shares, or the fee recipient. A refused address keeps its shares and can send them on. It cannot cancel a redemption, because the shares would return to it.

The withdrawal policy

canWithdraw(account) says whether account may redeem shares for USDC or be paid by a redemption. Anything but a clean true, a revert included, counts as a refusal, and the action reverts with WithdrawalNotAllowed.

FunctionWho is asked about
requestRedeemThe controller
requestRedeemAndExecute, executeRedeemRequestThe controller and the receiver
redeem, withdrawThe controller and the receiver
claimRedeemForThe controller, who is paid
transferRedeemRequestThe new controller
forceTransferThe address moved to, when a redemption or its fills move
maxRedeem, maxWithdraw, previewInstantRedeem, maxInstantRedeemRead zero for a refused controller

It is never asked about the owner whose shares go into escrow, or about the caller. A refused owner can therefore open a redemption that names an allowed controller. Settlement never asks it: a refused controller's request still fills, and the USDC waits until the policy allows a claim. Cancelling a request does not ask it either.

Where to read more

PageWhat it covers
PoliciesEvery slot, and what exists today
Building a policyWhat happens when a hook refuses or reverts
Using policies for complianceWhich hook fits which compliance need
DepositsThe deposit flow these hooks sit in
WithdrawalsThe redemption flow these hooks sit in