skills$openclaw/cow-swap
0xterrybit1.4k

by 0xterrybit

cow-swap – OpenClaw Skill

cow-swap is an OpenClaw Skills integration for coding workflows. CoW Swap MEV-protected DEX aggregator. Batch auctions for best execution and surplus sharing.

1.4k stars782 forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namecow-swap
descriptionCoW Swap MEV-protected DEX aggregator. Batch auctions for best execution and surplus sharing. OpenClaw Skills integration.
owner0xterrybit
repository0xterrybit/cow-swap
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @0xterrybit/cow-swap
last updatedFeb 7, 2026

Maintainer

0xterrybit

0xterrybit

Maintains cow-swap in the OpenClaw Skills directory.

View GitHub profile
File Explorer
3 files
.
_meta.json
272 B
README.md
637 B
SKILL.md
5.4 KB
SKILL.md

name: cow-swap description: CoW Swap MEV-protected DEX aggregator. Batch auctions for best execution and surplus sharing. metadata: {"clawdbot":{"emoji":"🐮","always":true,"requires":{"bins":["curl","jq"]}}}

CoW Swap 🐮

MEV-protected DEX aggregator using batch auctions. Get the best execution with surplus sharing.

💎 Partner Fee Configuration

This skill includes a partner fee (0.5%) to support development. The fee is transparently disclosed to users.

VariableValueDescription
PARTNER_FEE_BPS500.5% partner fee (50 basis points)
PARTNER_FEE_RECIPIENT0x890CACd9dEC1E1409C6598Da18DC3d634e600b45EVM wallet to receive fees

Fee Breakdown:

  • User pays: 0.5% of swap output
  • Partner receives: 100% of fee
  • Fees are collected on-chain after order execution

💡 CoW Protocol also shares price improvement surplus with partners!

Features

  • 🛡️ MEV Protection - Batch auctions prevent front-running
  • 💰 Surplus Sharing - Get better prices than quoted
  • 🔄 Coincidence of Wants - P2P matching for better rates
  • ⛓️ Multi-Chain - Ethereum, Gnosis, Arbitrum, Base
  • 🆓 Gasless Orders - No gas for failed transactions

API Base URL

https://api.cow.fi

Get Quote

CHAIN="mainnet"  # mainnet, gnosis, arbitrum, base

# Token addresses
SELL_TOKEN="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"  # WETH
BUY_TOKEN="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"   # USDC
SELL_AMOUNT="1000000000000000000"  # 1 ETH in wei
FROM_ADDRESS="<YOUR_WALLET>"

# Partner fee configuration
PARTNER_FEE_BPS="50"  # 0.5%
PARTNER_FEE_RECIPIENT="0x890CACd9dEC1E1409C6598Da18DC3d634e600b45"

curl -s -X POST "https://api.cow.fi/${CHAIN}/api/v1/quote" \
  -H "Content-Type: application/json" \
  -d "{
    \"sellToken\": \"${SELL_TOKEN}\",
    \"buyToken\": \"${BUY_TOKEN}\",
    \"sellAmountBeforeFee\": \"${SELL_AMOUNT}\",
    \"from\": \"${FROM_ADDRESS}\",
    \"kind\": \"sell\",
    \"partiallyFillable\": false,
    \"appData\": \"{\\\"partnerFee\\\":{\\\"bps\\\":${PARTNER_FEE_BPS},\\\"recipient\\\":\\\"${PARTNER_FEE_RECIPIENT}\\\"}}\",
    \"appDataHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\"
  }" | jq '{
    quote: {
      sellAmount: .quote.sellAmount,
      buyAmount: .quote.buyAmount,
      feeAmount: .quote.feeAmount
    },
    expiration: .expiration,
    id: .id
  }'

Create Order

# After getting quote, create order
QUOTE_ID="<QUOTE_ID>"

curl -s -X POST "https://api.cow.fi/${CHAIN}/api/v1/orders" \
  -H "Content-Type: application/json" \
  -d "{
    \"sellToken\": \"${SELL_TOKEN}\",
    \"buyToken\": \"${BUY_TOKEN}\",
    \"sellAmount\": \"${SELL_AMOUNT}\",
    \"buyAmount\": \"<MIN_BUY_AMOUNT>\",
    \"validTo\": $(( $(date +%s) + 1800 )),
    \"appData\": \"{\\\"partnerFee\\\":{\\\"bps\\\":${PARTNER_FEE_BPS},\\\"recipient\\\":\\\"${PARTNER_FEE_RECIPIENT}\\\"}}\",
    \"feeAmount\": \"<FEE_AMOUNT>\",
    \"kind\": \"sell\",
    \"partiallyFillable\": false,
    \"receiver\": \"${FROM_ADDRESS}\",
    \"signature\": \"<EIP712_SIGNATURE>\",
    \"signingScheme\": \"eip712\",
    \"from\": \"${FROM_ADDRESS}\"
  }" | jq '.'

Check Order Status

ORDER_UID="<ORDER_UID>"

curl -s "https://api.cow.fi/${CHAIN}/api/v1/orders/${ORDER_UID}" | jq '{
  status: .status,
  executedSellAmount: .executedSellAmount,
  executedBuyAmount: .executedBuyAmount,
  surplus: .surplus
}'

Get User Orders

USER_ADDRESS="<YOUR_WALLET>"

curl -s "https://api.cow.fi/${CHAIN}/api/v1/account/${USER_ADDRESS}/orders" | jq '.[:5] | .[] | {
  uid: .uid,
  status: .status,
  sellToken: .sellToken,
  buyToken: .buyToken
}'

Cancel Order

ORDER_UID="<ORDER_UID>"

curl -s -X DELETE "https://api.cow.fi/${CHAIN}/api/v1/orders/${ORDER_UID}" \
  -H "Content-Type: application/json" \
  -d "{
    \"signature\": \"<CANCELLATION_SIGNATURE>\",
    \"signingScheme\": \"eip712\"
  }"

Supported Chains

ChainAPI PathNative Token
EthereummainnetETH
GnosisgnosisxDAI
ArbitrumarbitrumETH
BasebaseETH

Order Types

TypeDescription
sellSell exact amount, receive at least buyAmount
buyBuy exact amount, spend at most sellAmount

Order Status

StatusDescription
openOrder is active
fulfilledOrder fully executed
cancelledOrder cancelled
expiredOrder expired
presignaturePendingAwaiting signature

AppData Structure (Partner Fee)

{
  "version": "1.1.0",
  "metadata": {
    "partnerFee": {
      "bps": 50,
      "recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f5bE21"
    }
  }
}

Safety Rules

  1. ALWAYS display quote details before signing
  2. VERIFY minimum buy amount
  3. CHECK order expiration time
  4. WARN if price impact > 1%
  5. NEVER sign without user confirmation
ErrorCauseSolution
InsufficientBalanceLow balanceCheck wallet balance
InsufficientAllowanceToken not approvedApprove token first
OrderNotFoundInvalid order UIDCheck order UID
QuoteExpiredQuote too oldGet new quote
README.md

CoW Swap 🐮

MEV-protected DEX aggregator skill for Clawdbot.

Features

  • 🛡️ MEV Protection - Batch auctions prevent front-running
  • 💰 Surplus Sharing - Get better prices than quoted
  • 🔄 Coincidence of Wants - P2P matching
  • ⛓️ Multi-Chain - Ethereum, Gnosis, Arbitrum, Base
  • 🆓 Gasless Orders - No gas for failed transactions

Installation

clawdhub install cow-swap

Usage Examples

"Swap 1 ETH for USDC with MEV protection"
"Get CoW Swap quote for 1000 USDC to ETH"
"Check order status for UID..."
"Cancel pending order"

License

MIT

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

Configuration

This skill includes a partner fee (0.5%) to support development. The fee is transparently disclosed to users. | Variable | Value | Description | |----------|-------|-------------| | `PARTNER_FEE_BPS` | 50 | 0.5% partner fee (50 basis points) | | `PARTNER_FEE_RECIPIENT` | `0x890CACd9dEC1E1409C6598Da18DC3d634e600b45` | EVM wallet to receive fees | **Fee Breakdown:** - User pays: 0.5% of swap output - Partner receives: 100% of fee - Fees are collected on-chain after order execution > 💡 CoW Protocol also shares price improvement surplus with partners!

FAQ

How do I install cow-swap?

Run openclaw add @0xterrybit/cow-swap in your terminal. This installs cow-swap into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/0xterrybit/cow-swap. Review commits and README documentation before installing.