How It Works
The intent-simple flow:- Analyzes swap parameters - Source/destination tokens and chains
- Finds optimal route - Leverages LiFi, GlueX, Across, and other providers
- Handles complexity - Manages bridging, swapping, and multi-step routes
- Returns route details - Provides expected output and routing information
Parameters
When using/instructions/intent-simple in your composeFlows array:
| Parameter | Type | Required | Description |
|---|---|---|---|
srcToken | string | Yes | Source token address (checksummed) |
dstToken | string | Yes | Destination token address (checksummed) |
srcChainId | number | Yes | Source chain ID |
dstChainId | number | Yes | Destination chain ID |
amount | string | Yes | Amount to swap (in wei/smallest unit) |
slippage | number | Yes | Slippage tolerance (0-1, e.g., 0.01 = 1%) |
allowSwapProviders | string | No | Comma-separated allowed swap providers |
denySwapProviders | string | No | Comma-separated denied swap providers |
allowBridgeProviders | string | No | Comma-separated allowed bridge providers |
denyBridgeProviders | string | No | Comma-separated denied bridge providers |
Complete Workflow Examples
- EOA Mode
- Smart Account
- Same-Chain Swap
Cross-chain swap with withdrawal
Returned Data Structure
When you useintent-simple in your quote request, the response includes returnedData with swap details:
Route Data Fields
| Field | Type | Description |
|---|---|---|
outputAmount | string | Expected output amount (in wei) |
minOutputAmount | string | Minimum output after slippage (in wei) |
route.summary | string | Human-readable route description |
route.steps | array | Detailed steps with protocol info |
route.type | string | Route strategy (e.g., “DIRECT”, “PIVOT_USDT”) |
route.totalGasFeesUsd | number | Estimated gas fees in USD |
route.totalBridgeFeesUsd | number | Estimated bridge fees in USD |
route.estimatedTime | number | Estimated time in seconds |
| Field | Description |
|---|---|
type | ”swap” or “bridge” |
protocol | Provider used (e.g., “lifi”, “across”) |
sources | DEXes used (e.g., [“uniswapv3”]) |
srcToken, dstToken | Token addresses |
srcChainId, dstChainId | Chain IDs |
inputAmount, outputAmount | Amounts for this step |
Provider Control
Control which providers are used for routing:- Swap: LiFi, GlueX, and others
- Bridge: Across, and others
Best Practices
Always Add Withdrawal for EOA Mode
Always Add Withdrawal for EOA Mode
When using EOA mode, funds remain in Nexus after operations. Always add a withdrawal instruction:
Validate Swap Output
Validate Swap Output
Always check the
minOutputAmount to ensure acceptable slippage:Use Appropriate Slippage
Use Appropriate Slippage
Set slippage based on market conditions and token liquidity:
Review Route Before Execution
Review Route Before Execution
Check the route summary for unexpected routing:
Troubleshooting
No route found
No route found
If no route is available:
- Check token addresses are correct and checksummed
- Verify both tokens are supported on their respective chains
- Try adjusting provider allow/deny lists
- Increase slippage tolerance if needed
Output amount too low
Output amount too low
If
minOutputAmount is lower than expected:- Check current market prices and liquidity
- Review the
route.stepsto see where value is lost - Consider splitting large swaps into smaller ones
- Try different providers using allow/deny parameters
Swap failed during execution
Swap failed during execution
If execution fails:
- Check sufficient balance in source location (EOA or Nexus)
- Verify slippage wasn’t exceeded during execution
- Review transaction on MEE Explorer for specific error