Docs / 04

Vaults and safety

The agents never hold your tokens. You create your own vault, a small contract you own, and deposit what you want them to work on. The agents get one narrow permission inside it: swapping between allowed assets through allowed venues, with the output landing back in the vault. Only you can take anything out, at any time, all of it or part of it.

Owner (you)+ deposit+ withdraw, any time+ withdraw all+ pause the agents+ replace or remove keeper+ change the mandateYour vaultone clone per walletno upgrade pathno admin keyETH, USDG, 47 stocks,Pons V2 coins onlycaps per trade and per dayKeeper (the agents)+ swap inside the vault- withdraw- choose a recipient- touch other assets- trade with minOut 0- trade while pausedPons V2 bonding curveponsBuy, ponsSell, while phase 0Uniswap v4 PoolManagerswapV4, hook none or Ponsoutput always lands back in the vault
The owner holds every key that matters. The keeper can only turn assets into other allowed assets, inside the vault.

The contracts

ContractAddress
AgentVaultFactory0x2F89651d095E5a442091C080791aeADfCfB407B9
Vault implementation0xCd957DeCC91E1c7A1B6c991e060ae60bBaFDA649
Keeper (the agents' key)0xA3849BF072494597872b079A07A91b1185AFFc12

Both contracts are verified on Sourcify (exact match) on Robinhood Chain. Each vault is an EIP-1167 clone of the implementation, one per wallet: createVault(mandate, maxTradeBps, maxTradesPerDay) makes the calling wallet its owner, and any ETH sent with the call is deposited. The keeper is set at creation; the owner can replace it or remove it with setKeeper.

An eye seen through an old keyhole

What the contract enforces on every trade

  • Allowed assets only: native ETH, USDG, the 47 tokenized stocks fixed when the factory was deployed, and tokens the Pons V2 factory itself reports as launched (getLaunchedToken(token).exists).
  • Allowed venues only: the Pons V2 bonding curve that the factory records for that coin, while the coin is still on it (ponsBuy, ponsSell), or a Uniswap v4 pool on the PoolManager 0x8366a39CC670B4001A1121B8F6A443A643e40951 whose hook is none or the Pons hook (swapV4, exact input, through the PoolManager's unlock, settle and take, with no router in between).
  • The output always lands in the vault: no trade function takes a recipient.
  • Every trade states a minimum output, which must be above zero, and the vault checks it on its own balance change after the fee. A trade can never spend more than the amount it states.
  • Each trade is capped at maxTradeBps of the input balance (at most 10,000, the whole balance), and the number of trades per day at maxTradesPerDay (at most 96).
  • Nothing trades while the owner has paused the vault, and only the current keeper can trade at all.

What only the owner can do

  • withdraw(token, amount, to): any amount of one token, ETH as the zero address, to any address. Passing the maximum amount takes all of it.
  • withdrawAll(tokens, to): everything in each listed token, in one transaction.
  • setPaused, setKeeper, setMandate.

Withdrawals work at any time, paused or not. deposit(token, amount) records a deposit with an event; anyone may deposit, and a plain transfer to the vault works as well.

No custody, no upgrades

There is no upgrade path in the vault or the factory, and nobody but the owner holds a key to a vault. The factory's owner, the protocol's deployer, can do four things, none of which touches a vault's funds: point the fee waiver at $FIXMYBAGS once (setEye), change the waiver threshold, change where fees go (setTreasury), and change the keeper given to vaults created from then on (setDefaultKeeper).

The fee

Each trade the agents make pays 0.3% of its output (FEE_BPS = 30) to the treasury, the protocol's public case vault. A vault whose owner holds at least the $FIXMYBAGS threshold pays nothing, once the factory points at $FIXMYBAGS. The rule for that revenue is in $FIXMYBAGS.

Events

Deposited(token, amount, from), Withdrawn(token, amount, to) and Traded(tokenIn, tokenOut, amountIn, amountOut, fee, venue, note), where note carries the agents' short reason. Every movement of a vault can be read from its own logs.

Tests

Fifteen unit tests run against a mock Pons curve and factory: the per-trade cap (with a fuzz test), the daily limit, the pause, a removed keeper, owner-only withdrawals that still work while paused, the fee and its waiver, and the bounds on every setting. Four fork tests run against live Robinhood Chain state:

  • ETH to NVDA and back in the v4 pool (ETH, NVDA, fee 500, tick spacing 10, no hook).
  • A real Pons V2 coin bought and sold on its bonding curve.
  • A graduated Pons V2 coin bought and sold in its v4 pool with the Pons hook.
  • A pool with a hook that is not allowed, rejected, then a full withdrawal.