Important Notes
**Critical: **
Do NOT use native ETH as sellToken:
0x00000000000000000000000000000000000000000xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
Always wrap ETH to WETH first using the Wrap endpoints. See WETH vs ETH for details.
Token Allowances Required
Before submitting a swap order, ensure the user has approved sellToken for dexRoute.target:
// Check allowance
const allowance = await sellTokenContract.allowance(
userAddress,
dexRoute.target
);
// If insufficient, request approval
if (allowance < sellAmount) {
await sellTokenContract.approve(dexRoute.target, ethers.constants.MaxUint256);
// Wait for confirmation before submitting order
}
Transaction Signing Best Practices
- Sign
mevProtection.transactionParamsexactly as provided - Do not modify any fields (to, data, value, gasLimit, etc.)
- Use the same address that was passed to the quote endpoint
- Always get a fresh quote before each transaction
Last updated on