- Intent-Based Swaps: Token transformations with automatic route optimization
- Portfolio Rebalancing: Multi-asset allocation management
- Composable Actions: Chain multiple operations in sequence
- Custom Operations: Direct contract calls when needed
Intent-First Approach
Express DeFi operations as token transformations (input → output) and let the solver network find optimal execution paths. Only use custom calls for operations that can’t be expressed as intents.
Express DeFi operations as token transformations (input → output) and let the solver network find optimal execution paths. Only use custom calls for operations that can’t be expressed as intents.
Workflow Process
All operations use the unified quote → sign → execute flow:- Create quote with embedded
composeFlowsusing/v1/quote - Sign the returned payloads
- Execute with
/v1/execute
1. Token Operations with Intents
Use intent-based compose flows for all token transformations, including DeFi deposits and withdrawals.Simple Token Swap
Example: Swap 1 ETH to USDCAave Deposit via Intent
Example: Deposit WETH to get aWETH (expressed as token transformation)2. Portfolio Management with Intents
Use the/instructions/intent compose flow type for complex multi-asset rebalancing.
Multi-Token LP Entry
Example: Deposit multiple stablecoins into Curve 3pool3. Composed Strategies
Combine multiple operations incomposeFlows for complex DeFi strategies.
Leveraged Staking Position
Example: Create 2x leveraged ETH position using Aave with dynamic amountsMulti-Step Yield Optimization
Example: Swap, split, and deploy across multiple protocols using dynamic amountsPosition Migration
Example: Move from Compound to Aave4. Custom Operations (When Intents Won’t Work)
Use custom function calls only for operations that can’t be expressed as token transformations.Borrowing Operations
Example: Borrow against collateral (requires custom call)Claiming Rewards
Example: Harvest staking rewards (requires custom call)Execution Flow
After building your quote withcomposeFlows, sign and execute:
Step 1: Create quote with embedded composeFlows (shown in examples above)
Step 2: Sign the payloads - See Step 2: Sign Payloads for detailed signing instructions based on quoteType.
Step 3: Execute the supertransaction - See Step 3: Execute Transaction for complete execution details and examples.
Quote and Execute Details
The quote/execute flow works as follows:-
Quote Generation (
/v1/quote): Returns payloads requiring signatures based on execution mode- Smart Account: Typically returns
simplepayloads (message signatures) - EOA: Returns
permit(gasless) oronchain(approval tx) payloads - EIP-7702: May return 412 error requiring authorization first
- Smart Account: Typically returns
-
Signing: Sign returned payloads with appropriate method
permit: EIP-712 typed data signaturesimple: Plain message signatureonchain: Send approval transaction
-
Execution (
/v1/execute): Submit signed quote to execute across chains
Best Practices
Use Intents First
- Express operations as token transformations when possible
- Let the solver network optimize execution paths
- Only use custom calls for non-transferable operations
Slippage Guidelines
- Stablecoins: 0.001-0.005 (0.1-0.5%)
- Major tokens: 0.005-0.01 (0.5-1%)
- Volatile tokens: 0.01-0.03 (1-3%)
- LP tokens: 0.005-0.02 (0.5-2%)
Fee Payment Flexibility
- Pay with any ERC-20 from any chain via
feeToken - Use native tokens with address
0x0000...0000 - Omit
feeTokenfor sponsored transactions
Execution Modes
- Smart Account: Best for apps with deployed smart accounts
- EOA: One-click flow for MetaMask users
- EIP-7702: For embedded wallets and backend automation