← All posts

Swap on Optimism: MEV-protected DEX aggregator

How to swap on Optimism with Ophis: intent orders, MEV-protected batch settlement, and solver-aligned pricing.

  • optimism
  • dex-aggregator
  • mev
  • swaps
Ophis emblem with Optimism and supported chain logos

To swap on Optimism, open the Ophis swap page with chain id 10 pre-selected, pick your pair, and sign the order your wallet shows. That order is an EIP-712 intent with a hard limit price, not a transaction: a competing solver network fills it and settles it in an MEV-protected batch. Pricing is a 1 bp base plus capped reference-quote improvement capture; see the current schedule.

Ophis, the intent-based DEX aggregator at ophis.fi, is a fork of CoW Protocol’s frontend with a natural-language intent layer and an agent stack (MCP server, SDK, plugins) on top. It runs on 14 EVM chains, and Optimism is one of four where the deployment is sovereign, alongside Unichain Robinhood Chain and Arc: Ophis operates its own orderbook and settlement contracts there. This post covers the flow, what batch settlement changes versus a router, what it costs, and how integrators track routed volume.

Swap on Optimism in four steps

  1. Open the app. swap.ophis.fi/#/10/swap loads with Optimism (chain id 10) pre-selected. Connect a wallet. Standard signed ERC-20 orders keep funds in your wallet until settlement. Native-token placement and bridges have separate deposit rules.
  2. Sign an intent, not a transaction. Enter the pair and amount, review the quote, and sign the order. The signature carries a hard limit price, the worst execution you can receive. Standard ERC-20 settlement is solver-paid; approvals and other wallet transactions can still require gas.
  3. Let solvers compete. Your order goes to the Ophis orderbook off chain, where solvers race to fill it. The batch settles at a uniform clearing price, and improvement is shared under the published capped pricing policy.
  4. Check trade rewards. View the live USDG campaign on the trade rewards page.

Step for step, this is the same flow as on any other Ophis chain. What is different on Optimism sits underneath.

A sovereign deployment: own orderbook, own settlement

On most of its chains, Ophis settles through CoW Protocol’s canonical audited GPv2 contracts via api.cow.fi. On Optimism, Unichain, Robinhood Chain and Arc, Ophis operates its own orderbook and settlement deployment derived from CoW Protocol. The Optimism settlement address is:

0x310784c7FCE12d578dA6f53460777bAc9718B859

For a trader in the app this changes nothing visible. For anyone building against the API it changes two things: Optimism orders sign against a different EIP-712 domain than canonical CoW deployments, and they submit to a different orderbook host. Do not hardcode either one. Resolve the per-chain settlement domain via @ophis/sdk or the MCP list_chains tool and both are always correct.

The settlement mechanics themselves are CoW Protocol’s, and Ophis says so plainly: batch auctions, solver competition, and the GPv2 contract suite are documented at docs.cow.fi. Ophis adds the intent layer, the agent stack, and the fee policy below.

What batch settlement changes versus a router aggregator

A router-style aggregator quotes you a route, then has you broadcast a transaction that executes that route on chain. Your price protection is a slippage tolerance: a percentage worse than the quote that you accept in advance. The pending transaction is public before it lands, and if it reverts, you still pay gas.

An intent flips each of those properties.

  • A hard limit price, signed. The EIP-712 order states the minimum you will receive. Your slippage setting determines that bound, just as router minimum-output bounds constrain execution. Neither guarantees a fill at the original quote.
  • MEV protection by construction. Order flow stays off chain until settlement, orders settle in batch auctions, and each token pair clears at a uniform price. This mitigates common MEV; external-pool settlement can still be public and exposed to adversarial conditions.
  • Capped, published improvement sharing. Ophis retains 80% of reference-quote improvement on volatile pairs, capped at 99 bps of volume, or 50% on stable pairs, capped at 20 bps. The trader receives the remainder and everything above the cap.

The comparison page goes deeper on the trade-offs, and Ophis vs CoW Swap covers what the fork changes.

Fees

Every trade pays a 1 bp base. Ophis retains 80% of reference-quote improvement on volatile pairs, capped at 99 bps of volume, or 50% on stable pairs, capped at 20 bps.

Agents, bots, and integrators: tracking OP flow

Optimism flow does not have to come from a human clicking a UI. Integrations can attach a referral code so settled trades are attributed to the code, then track routed volume and fees by appCode.

  • MCP server. A hosted, keyless endpoint at https://mcp.ophis.fi/mcp exposes thirteen tools, from parse_intent and get_quote through build_order, validate_order, and submit_order. list_chains resolves the Optimism orderbook and settlement domain, build_order pins the receiver to the owner, and the server never holds keys or signs anything. The agent walkthrough covers the full safety model.
  • SDK. @ophis/sdk resolves the orderbook URL and the EIP-712 signing domain per chain. That is exactly the part integrations get wrong when they hardcode canonical endpoints on a sovereign chain. Details in the AI agent docs.
  • Referral attribution. Create a referral code and pass it as referrerCode to build_order. Use get_integrator_earnings to read routed volume, the Ophis base fee, and your own fee on CoW-hosted chains by appCode. Details in the partner docs.

For apps that want the interface without the plumbing, @ophis/widget-react embeds the swap form directly; see the widget docs.

FAQ

How is Ophis different from a router aggregator on Optimism?

A router aggregator executes your swap as an on-chain transaction through a router contract, protected only by a slippage tolerance. Ophis never broadcasts your order as a public-mempool router swap: you sign an order with a hard limit price, solvers fill it, and the batch settles at a uniform clearing price. The signed limit remains enforceable, while any reference-quote improvement is shared under Ophis’s published capped policy.

Do failed swaps cost gas?

No. An Ophis order is a signed message, not a broadcast transaction, so there is no failed transaction to pay for. If no solver can fill your order at your limit price before it expires, it expires and nothing lands on chain. Fills are gasless for you as well, and the fee comes out of the traded amount; approvals, native-token placement, wrapping, hard cancellation and refunds can still require gas.

Can I integrate Ophis into my app?

Yes, at whichever depth fits. @ophis/widget-react is a drop-in swap UI, @ophis/sdk handles per-chain orderbook and signing-domain resolution for programmatic orders, and agents can point at the hosted MCP server with no keys involved. Create a referral code in the swap app to attribute routed trades. Track routed volume in the earnings report at rebates.ophis.fi/earnings/<appCode>.

One signature, a solver auction, batch settlement, and a 1 bp base fee plus capped price-improvement capture. If you are starting from zero, the getting-started guide walks through a first swap end to end. When you are ready, open swap.ophis.fi/#/10/swap with Optimism pre-selected and place your first order.