Skip to content
Documentation

How to take everything and leave

Leaving takes two on-chain steps. Both are signed by the wallet that owns the authorization. Brace never holds that wallet's keys.

Revoke authorization

In the web app: open the position panel at /chat and choose Revoke authorization. The transaction removes the agent's permission to act on this position.

In the chat: send /revoke. The chat opens the same owner-signed operation.

Revoking does not change your collateral, debt, liquidation price, or reserve. It only prevents the delegated agent from submitting another action.

Withdraw the reserve

Open Fund or withdraw from the position panel, or go directly to /chat/reserve. Choose Withdraw the reserve and sign with the owner wallet.

The program deliberately does not gate withdrawal on the guard state. It works when the agent is:

  • paused;
  • expired;
  • revoked; or
  • looking at an unhealthy position.

The reserve is held by the guard vault, not by the agent key. Withdrawing does not require the agent, a watcher, or a Brace server to be running.

Disconnect the wallet

After the on-chain steps are complete, use Disconnect in the header if you want to remove the wallet connection from this browser. Disconnecting is local session control. It does not revoke an authorization or alter the position.

If Brace is unavailable

The deployed program is on Solana devnet at CCSVvtVuDpH1wCCQWExCpdmZ1sqUBabJA1QQGai7aVaY. The owner can call withdraw_reserve directly through any Solana client that supports Anchor instructions.

The instruction needs the guard PDA, its vault, the owner's token destination, the vault mint, the SPL token program, and the owner's signature. Passing u64::MAX as the amount asks the program to resolve and withdraw the entire current vault balance on chain, so a stale browser balance cannot make the request too large.

The repository contains the instruction encoder in frontend/lib/core/tx/instructions.ts and the account builder in frontend/lib/platform/guard-tx.ts. Use the devnet program ID and verify every account against the guard before signing. Do not paste a mainnet address into a devnet transaction.

What remains on chain

Disconnecting the wallet does not delete on-chain history. Revoking removes the agent's authority, and withdrawing moves the reserve back to the owner's token account. Neither operation deletes the Kamino position.