Skip to main content
A treasury wallet rarely uses all its balance at once. Between payouts, x402 spend, and operating reserve, a meaningful slice sits idle. Idle USDC earning zero is a cost. The Agent CLI sweeps that idle balance into Trails earn pools (Aave v3, Morpho, ERC-4626 vaults) in one command, and pulls it back the same way before the next disbursement cycle. Dry-run by default, broadcast when finance signs off. The CLI handles pool discovery (highest TVL by default), session-scoped contract permissions (set once at wallet creation with --defi), and the underlying Trails routing. No multisig coordination, no DEX UI, no signature-collection step. Who this is for:
  • Treasurers at platforms running agent fleets with weekly or monthly disbursement cycles
  • Crypto-native businesses holding USDC working capital
  • Operations teams looking for predictable yield on operating reserves

How it works

Sweep and exit cycle
1OperatorCLIpolygon-agent deposit —asset USDC —amount 50000 (dry-run)
2CLITrailsSelects highest-TVL pool, returns projected APY
3OperatorCLIRe-runs with —broadcast after finance review
4Smart walletAave / MorphoDeposits, accrues yield, holds aToken or vault share
5OperatorCLIpolygon-agent withdraw —asset USDC —amount max —broadcast
The wallet must be created with --defi (or with explicit --contract flags listing the pool and the asset token) so the smart wallet can interact with Aave v3, Morpho, and ERC-4626 vaults without re-approval. Without that, deposit and withdraw fail at dry-run with a session-rejection error.

Get started

Two CLI commands drive the cycle: deposit into the highest-TVL pool by default (override with --protocol aave or --protocol morpho), and withdraw --amount max for a clean exit before the next disbursement run. Both are dry-run by default.

Install

The --defi flag is required at wallet creation so the smart wallet can interact with Aave v3, Morpho, and ERC-4626 vaults without re-approval. Without it, deposit and withdraw fail at dry-run.

Drive it from an LLM

Run the commands directly

Full reference: Swaps and yield.

Implementation

Swaps and yield

Full reference for deposit, withdraw, and swap against Trails earn pools.

Setup and wallets

Pass --defi at wallet creation to enable yield operations.

Trails

The underlying earn-pool router.