Deposit with getQuote
Deposit 1 USDC into a Morpho vault on Base:
toToken is the position token address of the target protocol, such as a vault share token; take it from Supported Protocols & Chains. The routing engine compares the Composer route with DEX routes into the same token, so check includedSteps for tool: "composer" to see which one you got.
executeRoute throws when execution fails. Keep the latest route from updateRouteHook and read action.error on its FAILED actions for details. For every execution option, see Execute Routes/Quotes.
Compare routes with getRoutes
getRoutes returns several options and uses different parameter names:
executeRoute as above.
Cross-chain deposits
Use differentfromChain and toChain values. A cross-chain route has one of two shapes:
- One transaction: the bridge runs the Composer deposit as a destination call.
getQuotealways returns this shape. - Two transactions: a bridge step, then a separate Composer step on the destination chain.
getRoutescan return this shape; the SDK switches the wallet to the destination chain and asks the user to sign the second transaction. Passoptions: { allowSwitchChain: false }togetRoutesto exclude it.
DONE and substatus PARTIAL, and the user holds the bridged token on the destination chain. See Cross-chain deposits for how to handle it.
Next steps
Vault Deposit Recipes
Quote parameters for each supported protocol
Widget Integration
Composer through the drop-in Widget

