Overview
The 1inch Fusion SDK provides multiple methods for creating and placing orders. This guide covers the complete workflow from getting a quote to submitting an order.Order Flow
Method 1: Using placeOrder()
TheplaceOrder() method is the simplest way to create and submit an order. It handles the entire process in one call.
Basic Example
With Optional Parameters
Method 2: Manual Order Creation
For more control, you can manually create and submit orders using separate method calls.Step-by-Step Process
Order Parameters
Required Parameters
fromTokenAddress: Address of the token you’re sellingtoTokenAddress: Address of the token you’re buyingamount: Amount to sell (in wei/smallest unit)walletAddress: Your wallet address (order maker)
Optional Parameters
receiver: Address to receive the output tokens (defaults towalletAddress)preset: Execution speed preset (fast,medium,slow)nonce: Custom nonce for batch order cancellationspermit: EIP-2612 permit call data for gasless approvalsintegratorFee: Fee configuration for integratorssource: String identifier for tracking order sources
Execution Presets
Presets control the auction duration and price curve for your order.
- fast: Quick execution with smaller price improvement
- medium: Balanced execution time and price (recommended)
- slow: Longer auction for maximum price improvement
Best Practices
- Error Handling: Wrap order submission in try-catch blocks
- Status Monitoring: Poll order status regularly or use WebSocket integration
- Allowances: Ensure token approvals are set before placing orders
- Gas Estimation: Consider network conditions when choosing presets
- Testing: Test with small amounts first on testnets
Common Issues
Insufficient Allowance
If you haven’t approved the Fusion contract to spend your tokens:Invalid Order Parameters
Next Steps
- Learn about Native Token Swaps for ETH/BNB trades
- Configure Custom Presets for advanced auction control
- Explore Order Management to check and cancel orders