Skip to main content

Native Token Swaps

The CoW Protocol SDK enables selling blockchain native tokens (ETH, MATIC, etc.) through the EthFlow contract. Since native tokens aren’t ERC-20 compliant, they require special handling for on-chain transactions.

How It Works

When selling native tokens:
  1. An on-chain transaction is sent to the EthFlow contract
  2. Native tokens are locked in the contract
  3. An order is created in the CoW Protocol order book
  4. Upon filling, the buyer receives their tokens
  5. Unfilled orders can be cancelled to reclaim funds
Only selling native tokens is supported. To buy native tokens, trade for wrapped versions (e.g., WETH) first.

Using postSwapOrder (Automatic Detection)

The SDK automatically detects native token orders using the special marker address 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE and routes them through EthFlow.

Using postSellNativeCurrencyOrder

For more control, use the dedicated postSellNativeCurrencyOrder method:

Method Signature

Example

Complete Example with Quote

Order Kinds for Native Tokens

Gas Cost Considerations

Native token orders require on-chain transactions, making them significantly more expensive than regular orders:
Always ensure you have enough ETH for gas in addition to the amount you’re selling.

Cancelling Native Token Orders

Advanced: Custom EthFlow Parameters

Common Chains and Native Tokens

Best Practices

  1. Verify sufficient balance for both the order amount and gas fees
  2. Use OrderKind.SELL for better predictability with native tokens
  3. Wait for transaction confirmation before querying order status
  4. Consider wrapping to WETH for smaller amounts where gas costs might exceed savings
  5. Monitor gas prices before executing native token orders

Next Steps

Last modified on March 11, 2026