Skip to main content

Earn

Move part of a shielded balance into an ERC-4626 yield vault and back without leaving the pool. A deposit spends a private note of the vault’s asset, the external call gateway calls the vault, and the vault shares come back as a private note. A withdrawal redeems shares the same way and credits the asset. If the vault call can’t deliver the signed minimum, the input is refunded to your private balance instead. Like swaps, earn is a gateway feature that each deployment enables separately; see Earn.
earn deposit and earn withdraw need your wallet private key on each run (the CLI prompts for it, or reads PRIVATE_KEY). earn vaults and earn history are public reads, and earn status runs on a saved login session.

Finding Vaults

This prints the deployment’s vault catalog as JSON. For each vault, note vaultAddress, the asset it takes (with its decimals), apy (fractions: 0.05 is 5%), and availability, which says whether deposits and redemptions can be submitted right now. The catalog is optional. A deployment without it fails this command but still supports deposits and withdrawals; get the vault address from the deployment’s operator instead.

Depositing

--amount is net: exactly the assets that enter the vault. The Gateway fee replaces the regular unshield fee and is charged on top, so your balance of the asset has to cover both. With --human, --decimals is the asset’s decimals (default 18). --slippage-bps sets how far below the vault’s on-chain preview the result may land (default 100, or 1%). The deployment caps it. If the vault would mint fewer shares than that minimum when the request executes, the deposit is refunded, and the fee is still charged. Output:
-o json prints the same result as JSON.

Withdrawing

Shares sit in your shielded balance under the vault address:
earn withdraw redeems them. --amount is a number of shares, and the fee is charged in shares on top of it, so leave room for it when you withdraw everything. With --human, --decimals is the share token’s decimals (default 18), which can differ from the asset’s.

Tracking an Operation

The status is printed as JSON and includes the gateway projection. Wait for creditStatus: completed means the output note was credited, and rescued means the escrow was paid to the rescue destination. Both end the wait. settlement is fallback when the vault call missed its minimum and the input was refunded. A failure ends the wait too, since it never reaches completed: settlement is failed_before_settlement when the request failed before it settled on-chain, or reorged when its settlement was reorged out, and creditStatus is failed when the credit didn’t go through. In history, an earn operation appears as two rows, one per epoch. privacy-boost history --collapse-gateway shows it as one.

Vault History

earn history prints one vault’s TVL or net-APY series for a chart. It needs the catalog.
--period is 1w, 1m, 3m, or all (default 1w). See Vault history charts for reading the series.

Next Steps