Cover photo

The CoW Swapper: A New Building Block for Better LP Automations

Enabling MEV-Protected Trustless ERC20 Token Swaps to Extend DEX LP Automations on the Superchain

Arcadia's Compounders and Rebalancers can automate just about anything for your LP positions, the exception being swaps beyond the two tokens of the LP pair. For many real-world strategies, that turns out to be a missing piece of the puzzle. Let's explain.

When analyzing common intents across Arcadia users, we see a few patterns emerge. The most notable include:

  • Compounding reward tokens

  • Repaying debt tokens

  • Converting yield into stablecoins

In most cases, actions like these require a conversion to or from a third token. For example, farming a Staked Slipstream WETH/USDC position yields AERO as a third token. Up until now, third tokens were not supported in Asset Managers, because we could not guarantee the safety of a trustless execution inside an Arcadia Account.

This meant Arcadia users had to perform these actions manually. While not a deal breaker for most, we aspire to have the best DEX LP automations on the Superchain.

Today we introduce the CoW Swapper, a new Asset Manager module enabling trustless, MEV-protected ERC20-to-ERC20 swaps while assets remain deployed as collateral. Powered by an integration with CoW Protocol, the CoW Swapper extends Arcadia's automation stack to cover any token pair, not just the two in the pool.

The Problem: Third-Token Swaps in a Non-Custodial World

Arcadia's existing automations achieve trustless execution by relying on information from the pool itself. The smart contracts enforce that the pool is not manipulated, that swaps execute without excessive slippage, and that a viable amount of liquidity is minted after each action.

This works because the Compounder and Rebalancer only ever need to swap between the pool's own tokens. The pool provides all the pricing data required, which is then used to check the validity of the swap.

But the moment a swap needs to happen to or from a third token, the model breaks. There is no pool to anchor trust against. One solution is to use price oracles, but that only works for token pairs where oracles are already configured: it doesn't generalize to any-to-any swaps.

What is needed is a swap mechanism that provides competitive pricing and MEV protection for arbitrary ERC20 pairs, while respecting Arcadia's non-custodial framework. That swap mechanism is what our new CoW Swapper provides.

Let's take a look.

The Solution: CoW Protocol Meets Arcadia Flash Actions

Whenever an account performs an action requiring a swap, the Arcadia stack uses Flash Actions and DEX aggregators to offer the best possible execution. Extending the architecture with the CoW Swapper is simply the next stepping stone.

Here's how it works:

The CoW Swapper delegates swap execution to CoW Protocol's batch auction system, which runs a fair combinatorial batch auction.

Solvers compete to offer the best price, with each solver able to bid on unique subsets of the batch. In this way, the swap gets a better outcome than having a single solver win. This embeds fairness at the auction level and removes the need for post-facto checks. And since CoW settles trades off-chain in batches rather than exposing them to the public mempool, users get competitive rates with native MEV protection.

In short, the fair auction guarantees MEV protected competitive prices for any-to-any token swaps, fully compatible with all account actions and automations.

But the real power comes from the integration with Arcadia Flash Actions. CoW Protocol allows execution of arbitrary logic before or after a swap. This means swaps can happen within a Flash Action: one token leaves and another enters in a single transaction, while the Account's collateral position is never at risk.

This is a major breakthrough for margin accounts, where the safety (health) of a position is paramount to the interests of the lenders. A Flash Action powered CoW Swapper guarantees borrowers stay solvent throughout the swap, and lenders are not at risk of accruing bad debt.

This means automation strategies relying on a Flash Action powered CoW Swapper will work for both Arcadia spot and margin accounts!

The CoW Swapper executes non-atomically before or after our automation modules. For a deep dive into the CoW Swapper's settlement flow, trust model, and Order Hook architecture, see our technical documentation.


What You Can Do with the CoW Swapper

Combining CoW Protocol swaps with Arcadia Flash Actions unlocks automations that were previously out of reach for our Arcadia Accounts.

Compound Reward Tokens

Staking rewards paid in a third token (OP, ARB, AERO) can now automatically swap back into the pool's underlying tokens and compounded into the liquidity position. The CoW Swapper handles the third-token conversion; the existing Compounder handles the rest.

This closes a gap where staking rewards were sitting idle as unclaimed or uncompounded ERC20 balances.

Take Profit in Any Token

Instead of compounding 100% of earned yield back into the pool, Account owners can automatically take a portion and swap it into any token of choice: USDC, ETH, or anything else. Yield streams out while the position stays intact.

General ERC20-to-ERC20 Swaps

Any ERC20 token held in an Arcadia Account can be swapped to any other ERC20 via CoW Protocol. This gives you flexible portfolio management without ever leaving the Account: no manual withdraw, swap, and re-deposit cycle.

Coming Soon: Debt Repayment and Stop Losses

In the medium term, we're extending the CoW Swapper to power two additional use cases:

  • Repay debt with yield: For leveraged positions, earned yield is automatically swapped into the debt token and used to repay the loan, gradually deleveraging the position over time.

  • Stop losses: Automatically unwind and swap a position's assets when certain price conditions are met, protecting against downside risk.


Trust Model: Three Layers of Protection

Arcadia's non-custodial framework guarantees users always remain in control. The CoW Swapper maintains this through three layers of protection:

Solver Integrity through Hash Verification

Every field in the swap order — tokenOut, amountOut, deadline, fee — feeds into a hash that is reconstructed and verified onchain at settlement. If a solver modifies any parameter between submission and execution, the hash check fails and the transaction reverts.

The Initiator triggering an automation commits to specific terms upfront. Those exact terms are what gets executed.

Competitive Pricing through Batch Auctions

Even with a conservative minimum amountOut, CoW Protocol's decentralised auction mechanism ensures solvers compete to offer the best actual price. The minimum is a safety floor, the expected outcome is often even better.

User-Defined Constraints through Order Hooks

Account owners who want additional control can deploy custom Order Hooks to enforce per-account restrictions:

  • Oracle Checks: Verify the solver's output against an onchain price as a second layer of protection.

  • Token Filters: Whitelist or blacklist specific assets the Initiator can swap into.

  • Rate Limits: Cap the swap frequency or maximum size per time window.

The Initiator can charge a fee (a percentage of tokenOut, capped by a maxSwapFee configured by the Account owner). CoW Protocol charges gas costs indirectly by factoring them into the quoted price.


Expanding What's Possible on the Liquidity Management Layer

The CoW Swapper is the first Arcadia Asset Manager that operates beyond the boundaries of a single liquidity pool. By generalizing trustless swaps to any ERC20 pair, it opens the design space for a new class of automations, from yield diversification to structured deleveraging, all while your assets continue to earn yield as collateral.

Combined with the existing Compounder and Rebalancer modules, we now have a composable toolkit covering the full lifecycle of a DEX liquidity position: deploy, rebalance, compound, take profit, and manage risk.

All non-custodial. All automated.
One step closer to 100% intelligently managed onchain liquidity.

Official Links

Website | Discord | Twitter (𝕏) | Medium | Docs

Join our community to ask questions, discuss strategies and request new features.

Key Words: CoW Protocol, Asset Managers, MEV Protection, Flash Actions, Non-Custodial, LP Automation, Superchain

Written by TS & ilo_0x