For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

Earn with yield vaults

Browse yield vaults, supply tokens, and withdraw positions using the mm earn commands. Agent Wallet routes supply and withdraw operations through LiFi for cross-chain support.

Ask your agent

You (to your agent): "Show me the best yield vaults for USDC on Base"
You (to your agent): "Supply 100 USDC to a vault on Base"
You (to your agent): "Withdraw all my USDC from the Aave vault on Base"

Your agent lists available vaults, compares APYs and TVL, confirms your choice, then executes.

Prerequisites

  • Quickstart completed
  • Sufficient token balance on the source chain

Browse vaults

List available yield vaults with APY and TVL data:

mm earn markets [--chain-id <chain-id>] [--token <symbol|address>] [--protocol <protocol>] [--min-tvl <amount>] [--sort apy|tvl] [--limit <n>]

Filter by chain, token, protocol, minimum TVL, or sort order to find the best opportunities.

Check your positions

View your current yield positions:

mm earn positions [--chain-id <chain-id>] [--address <address>] [--token <symbol|address>] [--protocol <name>] [--vault <address>] [--min-usd <n>] [--sort usd] [--limit <n>]

--address defaults to the active wallet.

Supply to a vault

Supply tokens to a yield vault:

mm earn supply --token <TOKEN> --amount <AMOUNT> --chain-id <chain-id> [--vault <address>] [--protocol <name>] [--min-tvl <usd>] [--from-chain-id <chain-id>] [--from-token <symbol|address>] [--wait]
FlagRequiredDescription
--tokenYesToken symbol or contract address
--amountYesHuman-readable amount to supply
--chain-idYesDestination chain for the vault
--vaultNoVault contract address (skips auto-selection)
--protocolNoRestrict vault auto-selection to a protocol
--min-tvlNoMinimum TVL in USD for vault auto-selection
--from-chain-idNoSource chain if supplying cross-chain
--from-tokenNoSource token. Required when --from-chain-id differs from --chain-id
--waitNoPoll until the position reflects (up to ~45s) and confirm balance

Pass either --token or --vault. The CLI automatically handles ERC-20 approval when the vault's allowance is insufficient.

Withdraw from a vault

Withdraw tokens from a yield vault:

mm earn withdraw --token <TOKEN> --chain-id <chain-id> [--amount <amount>] [--vault <address>] [--protocol <name>] [--all]

Pass either --amount or --all. Use --all to withdraw your full position. For Aave rebasing aTokens, --all applies a small dust buffer to avoid revert from interest accrual between the query and the transaction.

Cross-chain supply

Supply from a different chain than the vault's chain by passing --from-chain-id and --from-token:

mm earn supply --token USDC --amount 100 --chain-id 8453 --from-chain-id 1 --from-token USDC

This bridges and supplies in a single operation. --from-token is required whenever --from-chain-id differs from --chain-id. The CLI routes through LiFi and polls until the cross-chain transaction completes, with a 10-minute timeout.

Common pitfalls

Approval required

When supplying for the first time, the CLI sends an ERC-20 approval transaction before the supply transaction. In server-wallet mode, this may require 2FA approval depending on your trading mode.

Withdraw reverts

If a full withdrawal reverts, retry with a slightly smaller amount. Rebasing tokens (like Aave aTokens) accrue interest between the balance query and transaction execution.