Skip to main content
A runnable agent that acts as itself — its own key, its own AgentCap — and swaps SUI on DeepBook through the gated adapter. One swap within the cap is allowed. One over the cap is denied on-chain. After the owner revokes, the same swap halts.

Source on GitHub

altheia-sui-demo — the demo agent repo.

What this shows

Step 1 is a policy decision, not a guaranteed fill. The agent submits a gated DeepBook order; on a thin testnet book it can fill zero. Allowed means the policy permitted the action and the transaction landed — it does not assert the order filled.

Setup

1. Provision the agent

In the dashboard, provision an agent with: Save the agent private key.

2. Configure

The loop

agentRefs derives the agent’s objects from its key. guardedSubmit dry-runs each swap: an allowed swap submits and the on-chain AllowedAction event indexes it; a denied swap is recorded to the Chronicle without spending gas.

What the run shows

Step 1 submits a real gated DeepBook order; the digest is on a Sui explorer. Step 2 aborts inside check_and_consume before any coin leaves the vault, and the denial is recorded. After the owner revokes (via the dashboard, signed with the OwnerCap), step 3 aborts policy_revoked — the same action that worked now halts.

Owner side

Revoke and the kill-and-drain are owner operations. In the dashboard the owner clicks Revoke (or Withdraw to wallet, which revokes and sweeps the vault back). Programmatically, with owner refs:

Verify

Open the agent in the dashboard. The Chronicle has the allowed swap (settled, with a digest), the denied attempt (over_per_tx_cap), and the post-revoke halt.
Chronicle: allowed swap, denied over-cap, revoke

SDK reference

AltheiaSui, agentRefs, builders, reads.