> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dzap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Vibe Coding with DZap

> Prompt patterns and reliability tips for AI-driven DeFi flows.

Use natural language for intent, but keep constraints explicit.

## Patterns that work

### 1) Pass account and chain in metadata

```ts theme={null}
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

```text theme={null}
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

```text theme={null}
"Show top 3 pools on Base, pick the highest APR, and plan a zap from USDC."
```

### 4) State hard constraints directly

```text theme={null}
"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

```text theme={null}
"Summarize my portfolio across Ethereum, Arbitrum, and Base.
Group by token and USD value. Flag dust positions under $1."
```

```text theme={null}
"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
