Skip to main content
Use natural language for intent, but keep constraints explicit.

Patterns that work

1) Pass account and chain in metadata

await sdk.ask({
  userQuery: "What's my exposure to ETH?",
  metadata: {
    accountInfo: [
      { blockchain: "evm", chain: "1", user_account: "0xUser" },
      { blockchain: "evm", chain: "42161", user_account: "0xUser" },
    ],
  },
});

2) Split plan and execution

1. "Plan a swap of 100 USDC to WETH on Arbitrum. Show route and fees."
2. "Execute it."

3) Ask for goals, not tool sequences

"Show top 3 pools on Base, pick the highest APR, and plan a zap from USDC."

4) State hard constraints directly

"Swap 100 USDC on Arbitrum, max 1% slippage, no protocols below $10M TVL."

Common pitfalls

Hallucinated token addresses

Prefer metadata or TokenAddressTool for symbol resolution.

Ambiguous chain

“Swap USDC to WETH” is ambiguous unless chain is explicit.

Slippage format

Use percentages (1%) to avoid unit mismatch.

Native token handling

Use asset names (ETH, MATIC, SOL) unless the flow requires explicit addresses.

Bridge timing assumptions

Cross-chain settlement can take seconds to minutes depending on route/provider.

Useful prompt templates

"Summarize my portfolio across Ethereum, Arbitrum, and Base.
Group by token and USD value. Flag dust positions under $1."
"Target allocation: 60% USDC, 30% WETH, 10% WBTC across Arbitrum and Base.
Show the plan only. Do not execute."

When to avoid agent-driven execution

  • High-value production trades without a review loop
  • Unsupervised wallets with broad permissions
  • Fully deterministic backend flows that should call SDK methods directly
Last modified on May 21, 2026