Most on-chain swap flows still ask you to think like a router: pick a pool, choose a route, set a slippage number, and hope a bot does not sandwich you on the way in. Ophis replaces all of that with one line of intent, swap 100 USDC for ETH on Base. The twist for developers: that same line is callable by software, so an AI agent can trade the exact same way you do.
I build products for a living, and I built Ophis to collapse that friction into a single intent, then make that intent something an autonomous agent can call safely.
In one paragraph: Ophis is an intent-based DEX (decentralized exchange) aggregator with a natural-language layer. You describe a trade, it resolves the tokens, chain, and amount, then fills the order through a competitive solver auction that settles on-chain. Every trade is gasless, MEV-protected, and non-custodial, and any price improvement is returned to you in full. It ships with a keyless MCP (Model Context Protocol) server and a TypeScript SDK, it is open source, and it is live on about a dozen EVM chains with its own self-hosted stack on Optimism.
What is Ophis?
Ophis is an intent-based DEX aggregator. A DEX is a decentralized exchange: you trade tokens on-chain without handing custody to a company. "Intent-based" means you state the outcome you want instead of hand-coding the path to get there. An intent is a signed statement ("I want ETH for my 100 USDC on Base"), not a transaction that pins down every hop. Solvers then compete to fill that intent at the best price they can find.
Under the hood, Ophis is a fork of CoW Protocol (its orderbook, autopilot, driver, and baseline solver) with a natural-language intent layer added on top of a rebranded CoW Swap UI. That lineage is deliberate. CoW's batch-auction settlement is what makes the MEV protection structural rather than a best-effort filter, and forking it let me spend my time on the parts that are new: the language layer, the agent tooling, and a self-hosted deployment.
What do you get on every Ophis trade?
- Gasless. You sign an order in your wallet instead of broadcasting a transaction, so you do not pay gas up front in the chain's native token. A solver executes the trade and settlement covers the gas.
- MEV-protected. Orders settle in a batch auction where every trade in the batch clears at one uniform price. Sandwich attacks and front-running are structurally absent, not filtered after the fact. (MEV is maximal extractable value: the profit bots skim by reordering your transaction. A uniform clearing price removes the opening.)
- Surplus stays with you. Solvers compete to beat the price you signed. Any improvement, the surplus, is returned to you in full. Ophis takes zero share of it.
- Non-custodial and keyless. Every order is signed in your own wallet (EIP-712 for regular accounts, ERC-1271 for smart accounts). Ophis never holds keys or funds and cannot move, freeze, or recover them. The signature is the only trust boundary.
- A flat, transparent fee. 0.10% (10 bps) on volume, dropping to 0.01% (1 bp) on same-chain stablecoin pairs. Part of the fee comes back as monthly WETH rebates, and integrators earn 8% of the net fee on the volume their referrals route.
| Trade type | Fee |
|---|---|
| Any swap (on volume) | 0.10% (10 bps) |
| Same-chain stablecoin pair | 0.01% (1 bp) |
| Surplus / price improvement | 0% (returned to you) |
Ophis vs. a typical aggregator
| Ophis | A typical aggregator | |
|---|---|---|
| MEV protection | Structural: uniform-price batch auction | Best-effort: private relay or slippage guard |
| Price improvement | Surplus returned to you in full | Often kept by the solver or skimmed by a bot |
| Gas | Gasless: you sign an off-chain order | You broadcast the transaction and pay gas |
| Custody | Non-custodial, keyless | Varies |
| AI-agent access | Hosted MCP server + TypeScript SDK | Usually none |
The Intent API: the natural-language layer
The one bespoke API Ophis adds to the CoW stack turns natural language into a structured order. No key, no account, just POST your text:
curl -sS https://ophis.fi/api/intent \
-H 'content-type: application/json' \
-d '{"text":"swap 100 USDC for ETH on Base"}'
{
"ok": true,
"data": {
"intent": "swap",
"entities": [
{ "type": "amount", "value": "100", "raw": "100", "start": 5, "end": 8 },
{ "type": "sellToken", "value": "USDC", "raw": "USDC", "start": 9, "end": 13 },
{ "type": "buyToken", "value": "ETH", "raw": "ETH", "start": 18, "end": 21 },
{ "type": "chain", "value": "base", "raw": "Base", "start": 25, "end": 29 }
]
}
}
The endpoint only normalizes text. It never places, signs, or executes a trade. It is rate-limited to 30 requests per minute per IP, and it accepts non-browser callers (no Origin header), which is the path agents use. Your app maps the chain slug to a chain ID and hands the user a deep link to review and sign.
How do AI agents trade on Ophis?
This is where Ophis diverges from a typical aggregator: it was built to be traded by software, not only clicked by people. There are three integration depths, all non-custodial and keyless.
- The MCP server (the fast path)
Point any Model Context Protocol (https://modelcontextprotocol.io) client (Claude, Cursor, Cline, or a custom agent) at the hosted server:
It speaks Streamable-HTTP MCP and exposes about a dozen tools. For a swap, an agent chains just four of them:
parse_intent → get_quote → build_order → submit_order
The rest (resolve_token, expected_surplus, list_chains, lookup_tier, get_balances, get_portfolio, get_gas, get_token_chart) are read-only helpers. submit_order is the only state-changing tool. The server holds no keys and never signs: build_order returns a bounded, ready-to-sign EIP-712 order with the receiver pinned to the owner, and the agent signs locally with its own key before submitting.
In Claude Code, it is two commands:
/plugin marketplace add ophis-fi/skills
/plugin install ophis@ophis-fi
Then just ask: "swap 100 USDC for ETH on Base." For any other MCP client, add it as a remote HTTP server. Cursor, in ~/.cursor/mcp.json:
{
"mcpServers": {
"ophis": {
"url": "https://mcp.ophis.fi/mcp"
}
}
}
The same endpoint works in VS Code, GitHub Copilot, Codex, Cline, Roo Code, and Goose. For a stdio-only client like Claude Desktop, bridge with npx -y mcp-remote https://mcp.ophis.fi/mcp.
- @ophis/sdk (build and sign directly)
For agents that construct and sign CoW orders themselves:
npm install @ophis/sdk
The SDK is dependency-free and encodes four fork details that fail silently if you guess them: the per-chain orderbook host, the EIP-712 signing domain, the CIP-75 partner-fee appData, and a guard that pins the order receiver. End to end, the shape looks like this:
import {
getOphisOrderbookUrl,
getOphisOrderDomain,
buildOphisAppDataPartnerFee,
assertReceiverIsOwner,
} from '@ophis/sdk'
const chainId = 8453 // Base
const owner = account.address
// 1. Quote the parsed intent (getQuote + order typing come from cow-sdk)
const quote = await getQuote({ chainId, sellToken, buyToken, sellAmount })
// 2. Build the order, pinning the receiver to the signer
const receiver = owner
assertReceiverIsOwner(owner, receiver) // throws if they differ
const order = {
...quote,
receiver,
appData: buildOphisAppDataPartnerFee(chainId), // CIP-75 volume fee
}
// 3. Sign the EIP-712 order with the agent's own key
const domain = getOphisOrderDomain(chainId) // correct verifyingContract
const signature = await wallet.signTypedData({ domain, ...orderTypedData(order) })
// 4. Submit to the correct per-chain orderbook host
await fetch(`${getOphisOrderbookUrl(chainId)}/api/v1/orders`, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ ...order, signature }),
})
The four Ophis helpers are the fork-specific glue; the quoting and typed-data calls are standard cow-sdk. A runnable version lives in the docs. One helper is worth calling out: assertReceiverIsOwner(owner, receiver) pins the receiver, because an unpinned receiver is the most common drain vector for an automated signer.
- Agent discovery
Ophis publishes machine-readable manifests under https://mcp.ophis.fi/ (mcp.json, ai-plugin.json, agent-skills/, and an RFC 9727 api-catalog) plus a root-served llms.txt and openapi.json, so an agent can discover the tools on its own rather than being hard-wired.
After you sign: the order lifecycle
Signing is not broadcasting, so the "what happens next" is worth spelling out. Once you sign, the order goes to the orderbook and competes in the next batch auction. A market order typically fills within a block or two, when a solver includes it in a winning settlement, and you can watch it resolve on the order explorer at https://explorer.ophis.fi. Every order carries an expiry (validTo); if no solver can fill a limit order at your price before it expires, the order simply lapses with nothing given up. Orders can be cancelled before they settle. Because a pending order is a signed off-chain message rather than a transaction in the public mempool, there is nothing sitting in the open for bots to react to.
The safety model for autonomous signing
Letting software sign trades is exactly where things go wrong, so it is worth being precise about what protects you. Ophis makes the safe path the default:
- resolve_token maps a symbol to its canonical address and fails closed, so an agent never swaps into a token that merely spoofs a well-known symbol.
- Every built order pins the receiver to the owner, so proceeds cannot be redirected.
But be clear-eyed: these off-chain helpers are guards, not an authorization boundary. A prompt-injected agent can ignore them. For an agent that signs without a human in the loop, the guidance is to enforce policy where the agent cannot reach it: keep funds in a Safe (https://safe.global) smart account behind a deterministic policy gate (allowlisted tokens, pinned receiver and appData, an oracle-bounded limit price, spend caps), add a guardian key, and re-check the same policy at orderbook ingestion. The full write-up lives at https://docs.ophis.fi/ai-agents.
What is Ophis built on?
For the developers who want to read the source, the monorepo (https://github.com/ophis-fi/ophis, GPL-3.0) is mostly Rust and TypeScript with Solidity contracts:
- apps/backend is a fork of cowprotocol/services: the Rust orderbook, autopilot, driver, and baseline solver.
- apps/frontend is a fork of cowprotocol/cowswap: the swap UI, order explorer, and landing site, with Ophis code isolated under src/ophis/.
- apps/mcp-server is the agent-facing MCP server, deployed as a Cloudflare Worker.
- packages/sdk is @ophis/sdk.
- contracts/ holds the GPv2 settlement contracts under an Ophis-controlled solver allowlist.
On Optimism (chain 10), Ophis runs the whole stack under its own settlement contracts and keeps the full fee. On the other supported chains, it routes orders through CoW Protocol's hosted solver network. Upstream subtrees are vendored as-is and every divergence is catalogued, so pulling upstream stays tractable, which matters a lot when your backend is a fork you intend to keep in sync.
Which chains does Ophis support?
Trading is live on about a dozen EVM chains, including Ethereum, Optimism, Base, Arbitrum, Polygon, and BNB Chain, with Solana and Bitcoin available as cross-chain destinations via NEAR Intents. Because the live set moves, the MCP list_chains tool (and the SDK's chain registry) reports the authoritative list at runtime instead of hard-coding it. Optimism is the flagship self-hosted deployment; a couple of newer chains have their contracts deployed with the stack paused.
Try it
- App: https://swap.ophis.fi
- Docs: https://docs.ophis.fi (start with the AI-agents guide)
- Source: https://github.com/ophis-fi/ophis
- SDK: npm install @ophis/sdk
Whether you are a trader who wants a gasless swap or a developer wiring a trading tool into an agent, the same non-custodial path works. Tell it what you want in natural language, sign in your own wallet, keep your surplus.
FAQ
What is an intent-based DEX aggregator?
It is a decentralized exchange where you submit the outcome you want (a signed intent, like "buy ETH with 100 USDC on Base") instead of a fully specified transaction. Independent solvers then compete to fill that intent at the best available price across many liquidity sources, and the winning solution settles on-chain.
Is Ophis a fork of CoW Protocol?
Yes. Ophis forks CoW Protocol's orderbook, autopilot, driver, and baseline solver, and rebrands the CoW Swap UI. What Ophis adds is a natural-language intent layer, an agent-facing MCP server and SDK, and a self-hosted settlement stack on Optimism.
Is Ophis custodial?
No. Every order is signed in your own wallet, and Ophis never holds your keys or funds. It cannot move, freeze, or recover them. The signature is the only trust boundary.
What does Ophis cost?
A flat 0.10% (10 bps) on volume, dropping to 0.01% (1 bp) on same-chain stablecoin pairs. Price-improvement surplus is returned to you in full, and Ophis takes zero share of it.
Can an AI agent really place trades safely?
It can, if you keep policy outside the agent's reach. Ophis pins the order receiver to the owner and resolves token symbols to canonical addresses that fail closed. For headless signing, put funds in a Safe smart account behind a deterministic policy gate with spend caps and a guardian key, and re-check that policy at ingestion.
Top comments (0)