TrussDocs

Integrating with a vault

Standards and deviations

Where a Truss vault follows ERC-4626, ERC-7540, ERC-7575, ERC-8161 and ERC-20, and each place it departs from them, with the reason.

A Truss vault implements ERC-4626 as ERC-7540 extends it for asynchronous deposits and redemptions. It also implements ERC-7575, with the vault contract as its own share token, and ERC-8161. Tools built for these standards mostly work unchanged. This page lists each place the vault goes beyond or against their text, why, and what an integration should do about it. The source repository's conformance tests check the behaviour each standard requires.

Key points

  • Deposits and redemptions are requests. The ERC-4626 previews revert, and the claim functions pay at each request's settled price.
  • The share price views keep answering at the last fresh price while the NAV is stale, and say so through nav().
  • Requests can be cancelled for free, transferred under ERC-8161, and on some vaults redeemed instantly.
  • A vault may restrict who holds or redeems shares, and may be deployed with forced transfers.

Where the vault departs from the standards

StandardWhat differsWhy
ERC-4626The underlying must transfer exact amounts: no fee on transfer, no rebasingThe vault is built for USDC
ERC-4626totalAssets and convertTo* revert during one of the vault's own calls, and while an attested sub-account's NAV awaits re-anchoringA half-updated book, or a NAV known to be wrong, would misprice the share
ERC-4626While the NAV is stale, the price views answer the last fresh price. Check nav().isStale and observedAtA market reading the price keeps working through a feed lapse
ERC-4626previewDeposit, previewMint, previewWithdraw and previewRedeem revert with PreviewNotSupportedERC-7540 requires it: the price is set at settlement
ERC-4626deposit, mint, withdraw and redeem claim settled requests, each at the price it settled atERC-7540 defines them so
ERC-7540requestRedeemAndExecute opens, fills and claims a redemption in one call; executeRedeemRequest does the same for a pending oneImmediate liquidity within the instant window
ERC-7540claimDepositFor and claimRedeemFor let anyone deliver a controller's claim, to the controller onlyA keeper can complete claims. Expect claims you did not make
ERC-7540Only the owner or its operator can open a redemption. A share allowance alone cannot. Use setOperatorA request carries control, so only an operator may hand it away
ERC-7540Both kinds of request can be cancelled, for the whole remainder and for freeA holder the settler does not serve can leave the queue
ERC-7540, ERC-20A bound holder policy refuses an address it does not allow wherever shares or a pending request arrive. A bound withdrawal policy refuses a controller or receiver on the way out. The fee recipient is never refused sharesRestricted share classes. Read holderPolicy() and withdrawalPolicy()
ERC-8161A transfer moves the whole pending balance, and the bound policies are asked about the new controllerOne controller per request, and none the policies refuse
ERC-20, ERC-7540, ERC-8161On a vault deployed with forced transfers, the VaultAdmin or a VaultManager can move a holder's shares, requests and fills without consentLost keys and court orders. Read forcedTransfersEnabled(), fixed at deployment

ERC-8161, not plain ERC-7540

ERC-8161 extends ERC-7540 so that a pending request can change hands. That is what lets a holder sell a queued request before it settles; see Selling a pending request. An integration written for plain ERC-7540 still works, but should expect a request's controller to change while it is pending, and watch TransferDepositRequest and TransferRedeemRequest.

Calls on the concrete contracts only

A few calls are on no interface, because they belong to this implementation. Read them from each contract's own ABI: silo(), highWaterMark(), queuedFeeAssets() and crystalliseFees() on the vault; syncNav() on an attested sub-account, which anyone may call; window() on the instant redemption policy; and every restricted lever.

Where to read more

PageWhat it covers
Deposits and redemptionsThe calls these rows describe
Reading vault stateThe price, NAV and policy views
Vault policiesThe holder and withdrawal policies
Forced transfersWhat a forced transfer moves, and who can make one