Docs · Developers

Protect your users

Add keeperless exits to any wallet or vault UI with GuardianV2.

In one line

Two transactions from the user, and their position is protected. You don't run a keeper, and funds can only go back to them.

Turn protection on

  1. 1
    Approve the vault shares to GuardianV2
    The allowance caps how many shares Guardian can ever redeem.
  2. 2
    Call enable(vault, minConfidenceBps, maxAge)
    The user’s own rule: how sure the verdict must be, and how old it may be.
TypeScript · viem
await wallet.writeContract({ address: vault, abi: erc20Abi, functionName: 'approve', args: [guardian, maxUint256] });
// exit on EXIT verdicts at 85% or more that are at most 10 minutes old
await wallet.writeContract({ address: guardian, abi: abis.guardianV2, functionName: 'enable', args: [vault, 8_500, 600] });
Rule fieldAllowed
minConfidenceBps8,000–9,900
maxAge60–3,600 seconds

enable only works on vaults the admin approved. Calling it again replaces the rule, and disable(vault) turns it off.

Who can trigger an exit

Anyone can call exit(vault, owner). Tare's backend does within seconds of an EXIT verdict, and you can run your own caller as a backup. It reverts unless all of these hold:

  • The vault is approved and the owner’s rule is on.
  • The oracle’s latest verdict on the vault is EXIT.
  • Its confidence is at or above the owner’s minimum.
  • It is no older than the owner’s maxAge, and was posted after they turned the rule on.
  • It hasn’t already been used to fully exit this owner.

The shares are redeemed to the owner. If the vault can't pay everything, Guardian takes what it can, and the same verdict can finish the job later. Events: Enabled, Disabled, Exited.

Every signature, response shape and query in one file: docs/developers.md on GitHub.