Docs/Agents

Hosted agents

A hosted agent is an agent Essey runs for you. You set its rules once, with your passkey; it acts on its own inside them.

What you get in one tap#

  1. Sign in with a passkey. A passkey is the first sign-in method; a Sui wallet is the second. Sign-up is open.
  2. Name the agent, pick a style, set its rules and the amount. You can run up to three agents (maxAgentsPerUser is 3). A self-run agent counts as soon as it is claimed, before its treasury exists. Revoke one to free a slot. More than three is a self-run agent, with its treasury and cap in the server environment, not a higher hosted limit.
  3. One tap: create and fund. One signature creates your treasury and your agent's capability, sets the agent's rules, moves in the first deposit and then shares the treasury. The OwnerCap goes to your wallet and the AgentCap goes to the agent. Your wallet must hold the amount when you tap; if it doesn't, you are told what it holds and what the tap needs.

Before you sign, the rules are shown back to you as one plain sentence, for example: "Lends up to 20 USDC, 5 to 15 USDC a loan, never below 8.00% a year, at most 50.00% of the SUI's value…".

You pay no gas: the operator pays it for every transaction you sign.

A borrower agent works the same way, with two treasuries: the one tap creates a SUI treasury for collateral and a USDC treasury for cash, each with its own AgentCap, writes the borrowing rules, and deposits the collateral, any spare SUI for top-ups and an interest float.

Keys#

  • Your key stays with you. The server never holds your key; you sign every owner transaction in your own wallet or with your passkey.
  • The agent's key is held by the server, encrypted at rest under a master key.

Lender agents#

StyleWhat it does
steadyPosts a standing offer at your minimum rate, for your longest term.
yieldPosts a standing offer two points above your minimum rate, for your shortest term.
refinancerFinds the most expensive open loan from another lender priced more than four points above your minimum rate, and posts an offer 2.5 points below it, never below your minimum.

A lender agent can: post and cancel offers within your mandate; every loan it funds is checked against your mandate on chain at the moment of the fill.

A lender agent cannot:

  • move money out of your treasury: its spending limit is one unit, payable only to you.
  • change its own rules, raise its limits, mint caps or withdraw: those take your OwnerCap.
  • collect a defaulted loan's collateral: the LenderClaim is sent to your treasury and only your OwnerCap can take it out, so you sign that step.
  • liquidate its own underwater loan; you are warned instead.
  • hand its capability to another address.

Borrower agents#

StyleWhat it doesHosted
takerTakes the cheapest open offer whose lender will accept it.Yes
switcherBorrows from the pool, then moves to a cheaper offer, at most twice.Yes
shopperA sealed room whose bids only you can open.No: you run the room yourself.

A hosted borrower borrows once, and repays every loan by an hour before its rules end. Two switches are yours to set: auto top-up (off by default) adds spare SUI from your SUI treasury when a loan nears its safety line; auto-claim (on by default) brings home any collateral left after a loan closes.

The chain enforces its borrowing rules. When you deposit the collateral, the same signature writes its borrow rules onto the agent's SUI cap: it may open a loan at no more than your maximum rate, take no offer with a term under 6 hours, open no loan after its repay-by time nor an offer loan that matures after it, borrow only from the deployment's pool if it is a switcher, from no pool otherwise, send a new loan's proceeds only to your own cash treasury, and borrow no more in total than its allowance: the amount on your form, plus 0.001 USDC for each of a switcher's two refinances. Any loan outside them is refused on chain, and a cap without them can borrow nothing. See Borrowing through the treasury desk.

The allowance only goes down. Each loan uses it up, and repaying does not give it back. The agent's balances show how much of it is left. A hosted agent takes one loan: once it has opened one, a refinance included, it does not borrow again, even with a fresh allowance. Signing new rules (owner action rules) changes its limits, repay timing and end date in one signature, and moves no money.

A borrower agent cannot send funds to any address but yours: both of its caps pay only you, and it moves money only into and out of loans through the borrower desk. Your own hand stays on every loan: you can repay, top up or claim yourself at any time, even after a revoke. A revoke is refused while a loan is open.

Controls#

ControlEffect
LaunchStarts the agent. Refused if it is revoked, not set up, or its treasury is empty.
PauseThe agent stops acting after the turn in flight.
StopThe agent stops and cancels its standing offers.
RevokeRemoves the agent's limits and mandate on chain, which kills every open offer of its cap.
WithdrawTakes your money out of the treasury, at any time.

Limits on testnet#

LimitValue
Agents per person3
Largest budget100 USDC
Longest rules life30 days
How often an agent actsevery 30 seconds
Gas-paid agent transactions200 per agent per day