openocean

OpenOcean DEX aggregator. Best swap rates across 25+ blockchains with cross-chain support.

7 stars

Best use case

openocean is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

OpenOcean DEX aggregator. Best swap rates across 25+ blockchains with cross-chain support.

Teams using openocean should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/openocean/SKILL.md --create-dirs "https://raw.githubusercontent.com/Demerzels-lab/elsamultiskillagent/main/public/skills/0xterrybit/openocean/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/openocean/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How openocean Compares

Feature / AgentopenoceanStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

OpenOcean DEX aggregator. Best swap rates across 25+ blockchains with cross-chain support.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# OpenOcean 🌊

Full aggregation protocol across 25+ blockchains. Best rates with cross-chain swap support.

## 💎 Referral Fee Configuration

This skill includes a referral fee (1%) to support development.

| Variable | Value | Description |
|----------|-------|-------------|
| `REFERRER` | `0x890CACd9dEC1E1409C6598Da18DC3d634e600b45` | EVM wallet to receive fees |
| `REFERRER_FEE` | 1 | 1% referral fee (max 3%) |

**Fee Breakdown:**
- User pays: 1% of swap output
- Referrer receives: 100% of fee
- Fees are collected on-chain directly to your wallet

> 💡 OpenOcean allows up to 3% referral fee!

## Features

- 🔄 **DEX Aggregation** - Best rates across all major DEXs
- ⛓️ **25+ Chains** - EVM, Solana, Tron, Aptos, Sui, etc.
- 🌉 **Cross-Chain Swaps** - Bridge + swap in one transaction
- 🛡️ **MEV Protection** - Private transaction routing
- 📊 **Smart Routing** - Optimal path finding

## API Base URL

```
https://open-api.openocean.finance
```

## Get Swap Quote

```bash
CHAIN="eth"  # eth, bsc, polygon, arbitrum, optimism, avax, fantom, base, solana, etc.

# Token addresses
IN_TOKEN="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"   # ETH
OUT_TOKEN="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"  # USDC
AMOUNT="1000000000000000000"  # 1 ETH in wei
ACCOUNT="<YOUR_WALLET>"

# Referral configuration
REFERRER="0x890CACd9dEC1E1409C6598Da18DC3d634e600b45"
REFERRER_FEE="1"  # 1%

curl -s "https://open-api.openocean.finance/v3/${CHAIN}/quote" \
  -G \
  --data-urlencode "inTokenAddress=${IN_TOKEN}" \
  --data-urlencode "outTokenAddress=${OUT_TOKEN}" \
  --data-urlencode "amount=${AMOUNT}" \
  --data-urlencode "gasPrice=5" \
  --data-urlencode "slippage=1" \
  --data-urlencode "referrer=${REFERRER}" \
  --data-urlencode "referrerFee=${REFERRER_FEE}" | jq '{
    inAmount: .data.inAmount,
    outAmount: .data.outAmount,
    estimatedGas: .data.estimatedGas,
    path: .data.path
  }'
```

## Get Swap Transaction

```bash
curl -s "https://open-api.openocean.finance/v3/${CHAIN}/swap_quote" \
  -G \
  --data-urlencode "inTokenAddress=${IN_TOKEN}" \
  --data-urlencode "outTokenAddress=${OUT_TOKEN}" \
  --data-urlencode "amount=${AMOUNT}" \
  --data-urlencode "gasPrice=5" \
  --data-urlencode "slippage=1" \
  --data-urlencode "account=${ACCOUNT}" \
  --data-urlencode "referrer=${REFERRER}" \
  --data-urlencode "referrerFee=${REFERRER_FEE}" | jq '{
    to: .data.to,
    data: .data.data,
    value: .data.value,
    outAmount: .data.outAmount
  }'
```

## Cross-Chain Swap

```bash
FROM_CHAIN="eth"
TO_CHAIN="bsc"
IN_TOKEN="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"   # USDC on ETH
OUT_TOKEN="0x55d398326f99059fF775485246999027B3197955"  # USDT on BSC
AMOUNT="100000000"  # 100 USDC

curl -s "https://open-api.openocean.finance/v3/cross/quote" \
  -G \
  --data-urlencode "fromChain=${FROM_CHAIN}" \
  --data-urlencode "toChain=${TO_CHAIN}" \
  --data-urlencode "inTokenAddress=${IN_TOKEN}" \
  --data-urlencode "outTokenAddress=${OUT_TOKEN}" \
  --data-urlencode "amount=${AMOUNT}" \
  --data-urlencode "slippage=1" \
  --data-urlencode "account=${ACCOUNT}" \
  --data-urlencode "referrer=${REFERRER}" \
  --data-urlencode "referrerFee=${REFERRER_FEE}" | jq '.'
```

## Supported Chains

| Chain | API Name | Native Token |
|-------|----------|--------------|
| Ethereum | eth | ETH |
| BSC | bsc | BNB |
| Polygon | polygon | MATIC |
| Arbitrum | arbitrum | ETH |
| Optimism | optimism | ETH |
| Avalanche | avax | AVAX |
| Fantom | fantom | FTM |
| Base | base | ETH |
| zkSync Era | zksync | ETH |
| Linea | linea | ETH |
| Scroll | scroll | ETH |
| Solana | solana | SOL |
| Tron | tron | TRX |
| Aptos | aptos | APT |
| Sui | sui | SUI |
| Cronos | cronos | CRO |
| Gnosis | gnosis | xDAI |
| Aurora | aurora | ETH |
| Celo | celo | CELO |
| Moonbeam | moonbeam | GLMR |
| Moonriver | moonriver | MOVR |
| Harmony | harmony | ONE |
| Metis | metis | METIS |
| Boba | boba | ETH |
| OKX Chain | okc | OKT |

## Get Token List

```bash
curl -s "https://open-api.openocean.finance/v3/${CHAIN}/tokenList" | jq '.data[:10] | .[] | {symbol: .symbol, address: .address, decimals: .decimals}'
```

## Get Gas Price

```bash
curl -s "https://open-api.openocean.finance/v3/${CHAIN}/gasPrice" | jq '.data'
```

## Check Balance

```bash
curl -s "https://open-api.openocean.finance/v3/${CHAIN}/getBalance" \
  -G \
  --data-urlencode "account=${ACCOUNT}" \
  --data-urlencode "inTokenAddress=${IN_TOKEN}" | jq '.data'
```

## Safety Rules

1. **ALWAYS** display swap details before execution
2. **WARN** if price impact > 1%
3. **CHECK** token allowance before swap
4. **VERIFY** cross-chain destination address
5. **NEVER** execute without user confirmation

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| `INSUFFICIENT_BALANCE` | Low balance | Check wallet balance |
| `NO_ROUTE` | No route found | Try different pair |
| `SLIPPAGE_TOO_HIGH` | Price moved | Increase slippage |

## Links

- [OpenOcean Docs](https://docs.openocean.finance/)
- [OpenOcean App](https://app.openocean.finance/)
- [API Reference](https://docs.openocean.finance/dev/aggregator-api-and-sdk)

Related Skills

paylock

7
from Demerzels-lab/elsamultiskillagent

Non-custodial SOL escrow for AI agent deals.

agent-reputation

7
from Demerzels-lab/elsamultiskillagent

summary: Cross-platform AI agent reputation checker with trust scoring and PayLock escrow recommendations.

Telecom Agent Skill

7
from Demerzels-lab/elsamultiskillagent

Turn your AI Agent into a Telecom Operator. Bulk calling, ChatOps, and Field Monitoring.

OpenClaw-Finnhub

7
from Demerzels-lab/elsamultiskillagent

OpenClaw skill for real-time stock quote, and financials via Finnhub API.

```markdown

7
from Demerzels-lab/elsamultiskillagent

# OpenClaw-Last.fm

security-operator

7
from Demerzels-lab/elsamultiskillagent

Runtime security guardrails for OpenClaw agents.

operator-humanizer

7
from Demerzels-lab/elsamultiskillagent

Transform AI-generated text into authentic human writing.

kit-email-operator

7
from Demerzels-lab/elsamultiskillagent

**AI-powered email marketing for Kit (ConvertKit)**.

agora

7
from Demerzels-lab/elsamultiskillagent

Trade prediction markets on Agora — the prediction market exclusively for AI agents. Register, browse markets, trade YES/NO, create markets, earn reputation via Brier scores.

surf-check

7
from Demerzels-lab/elsamultiskillagent

Surf forecast decision engine.

jinko-flight-search

7
from Demerzels-lab/elsamultiskillagent

Search flights and discover travel destinations using the Jinko MCP server. Provides two core capabilities: (1) Destination discovery — find where to travel based on criteria like budget, climate, or activities when the user has no specific destination in mind, and (2) Specific flight search — compare flights between two known cities/airports with flexible dates, cabin classes, and budget filters. Use this skill when the user wants to: search for flights, find cheap flights, discover travel destinations, compare flight prices, plan a trip, find deals from a specific city, or explore where to go. Triggers on any flight-booking, travel-planning, or destination-discovery request. Requires the Jinko MCP server connected at https://mcp.gojinko.com.

mlx-whisper

7
from Demerzels-lab/elsamultiskillagent

Local speech-to-text with MLX Whisper (Apple Silicon optimized, no API key).