swap routes through the Trails DEX API, including cross-chain swaps via --to-chain. deposit parks idle balances in Trails earn pools (Aave v3, Morpho, ERC-4626 vaults). withdraw exits those positions, with auto-discovery if you know only the asset and protocol. The CLI picks the highest-TVL pool by default; pass --protocol to constrain.
All three are dry-run by default. Pass --broadcast to execute.
How it works
--defi at wallet create time gives the smart wallet permission to interact with Aave v3, Morpho, and ERC-4626 vaults. Without --defi, deposit and withdraw fail with a session-rejection error before any funds move.
Commands
swap
--to-chain to bridge during the swap.
deposit
--protocol, the CLI auto-selects the highest-TVL pool for the asset. --protocol aave or --protocol morpho constrains the choice.
withdraw
--amount max for a full exit.
Worked example
Implementation
Setup and wallets
Pass
--defi at wallet creation to enable swaps and yield.Transfers
Plain token transfers; no DEX routing.
Trails
The underlying DEX and earn-pool router.