NativeOrdersFactory for transaction broadcasting.
Overview
Native token swaps require special handling:- Use
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeas the token address - Submit orders using
submitNativeOrder()instead ofsubmitOrder() - Broadcast transactions using
NativeOrdersFactory - Include native token value in the transaction
Prerequisites
- Wallet with sufficient native token balance
- No allowance required (native tokens don’t need approval)
- RPC provider supporting the source chain
Complete Example
This example swaps 0.4 AVAX from Avalanche to USDC on BSC.Get Quote for Native Token
Request a quote using the native token address.
The address
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee is used for all native tokens (ETH, AVAX, BNB, MATIC, etc.).Broadcast Transaction with NativeOrdersFactory
Create the transaction call data and broadcast it.The
call.value field contains the amount of native token to send.Key Differences from Token Swaps
Token Address
Token Address
Native tokens use a special address:
Order Submission
Order Submission
Use
submitNativeOrder() for native tokens:Transaction Broadcasting
Transaction Broadcasting
Use For ERC20 tokens, the order submission handles this automatically.
NativeOrdersFactory to create transaction data:No Allowance Required
No Allowance Required
Native tokens don’t require approval:You can create orders immediately if you have sufficient balance.
Supported Native Tokens
| Chain | Native Token | Address |
|---|---|---|
| Ethereum | ETH | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| Polygon | MATIC | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| BSC | BNB | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| Avalanche | AVAX | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| Arbitrum | ETH | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| Optimism | ETH | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
Error Handling
Best Practices
Wait for Confirmation
Always wait for sufficient confirmations (3+ blocks) before proceeding.
Check Balance
Verify sufficient native token balance before creating orders.
Gas Estimation
Ensure wallet has extra native tokens for gas fees.
Use Recommended Preset
Use
quote.recommendedPreset for optimal execution.Transaction Value Calculation
Thecall.value includes the swap amount plus any required deposits:
Next Steps
EVM to EVM
Learn about ERC20 token swaps
Integrator Fees
Add fees to your integration