ocean-agent
🌊 OPEN BETA: Ocean Agent is in open beta for everyone as of Aug 26, 2026.No invitation and no waitlist: install it and connect your own account.The bracket engine is still being live-validated with our own funds too.Follow the daily scorecard on Telegram.
English · 한국어
🌊 Website: oceanagent.fi · PyPI: ocean-agent
Tell your AI to trade. An MCP server for Pacificathat turns natural language into correct, risk-sized perpetual futures orders,plus a 24/7 autonomous trading entity governed by a policy file you control.
uvx ocean-agent # no install needed
⚠️ This places real orders with real money. Read thedisclaimer before connecting an account.
Built entirely on Pacifica. Calls the Pacifica REST API directly with the sameEd25519 agent-key signing the official tooling uses, no npm dependency.
Why this instead of raw API access
The official Pacifica MCP exposes the API as-is: your AI must compute exactprices and sizes itself, and a price that isn't a multiple of the market's ticksize is rejected by the exchange. ocean-agent adds the layer above that:
| Raw API / official MCP | ocean-agent | |
|---|---|---|
| Order prices | AI computes exact values | Say "3% stop", tick/lot/min-order corrected automatically |
| Position sizing | Manual | Risk-based (fixed % of capital at risk per trade) |
| Safety | None | Two-step confirm gate on every money-moving tool |
| Statistics | None | Measured win rates and expected value, not textbook theory |
MCP tools
Market & analysis
analyze_chart, multi-timeframe indicator snapshot with measured hit ratesper signal on that specific coin and timeframe. Says "no edge detected" whenthere isn't one.top_setups, live ranking of statistically-proven setups (EV × win rate ×sample confidence), with entry, stop, target and leveragemarket_context, Fear & Greed regime readscan_funding, every market ranked by funding APRlearned_winrates/learned_combos, win-rate database built from liveobservation, including multi-signal combinationsreview_predictions, past calls graded against what actually happened
Trading
open_with_bracket, entry plus exchange-native TP/SL in one call. The stopslive on the exchange, so they fire even with your machine off.protect_position, retrofit native TP/SL onto any open positionopen_funding_position/close_funding_position, delta-neutral fundingcarry (spot buy + perp short) executed atomically as a batchplan_oi_hedge, sizes an OI-farming position with its cross-exchange hedge,fee and funding math includedopen_pacifica_leg,check_position,account_status
Print (experimental, uses an endpoint Pacifica has not documented; maychange without notice)
print_quote, live premium, implied volatility and liquidation priceprint_order/print_status/print_closeevaluate_print, statistical verdict on whether a Print offer is worth it:fill probability, average overshoot, and the breakeven APY that wouldcompensate for it
Autonomous trading entity
A self-directed trader governed by policy.yaml, a delegation contract. Itcannot act outside those bounds.
This is a separate always-on process, not an MCP tool. An MCP server onlyruns when your AI client calls it; a trader that must hold positions and managestops around the clock needs its own process. Start it deliberately, and itkeeps running whether or not any AI is connected.
python -m ocean_agent.autonomous --init # create policy.yaml to edit
python -m ocean_agent.autonomous --dry # decide, but place no orders
python -m ocean_agent.autonomous # run continuously
python -m ocean_agent.autonomous --once # single cycle
python -m ocean_agent.autonomous --report # performance summary
Read policy.yaml before the first real run, capital, leverage cap, risk pertrade and the hard-stop threshold all live there. Start with --dry.
Each cycle it reads the market, grades what it learned, manages open positions,and enters only setups that clear every gate.
Portfolio buckets, capital split across directional trading, funding carryand a cash reserve, rebalanced every cycle.
Position aftercare, moves the stop to breakeven once a trade is ahead,trails it as profit grows, and takes partial profit at target. Stops only evermove in your favour.
Liquidity gate, skips markets where your own order would be a large shareof daily volume. Thin books are the real hazard: an order that only partlyfills, and a stop that cannot be executed at its price.
Net-exposure limit, caps how one-directional the book can get, so a singlemarket reversal cannot hit every position at once.
Self-remeasurement, this is the actual learning engine. On a schedule thebot re-measures the full matrix of coins × timeframes × signals and updateswhich timeframes it trades and which signals it trusts. Regimes change: in onemeasurement the 8h timeframe showed no edge at all; weeks later it was thebest-performing band. Fixed parameters go stale, so they are not fixed.
python -m ocean_agent.rematrix # remeasure now
python -m ocean_agent.rematrix --show # what it currently believes
Adaptation, signals that lose in live grading are suspended, size is cutduring drawdown and restored on recovery. Parameters adapt within policy bounds;the bot never rewrites its own code.
Final stop, a single hard halt at catastrophic loss. Otherwise it does notstop, it adapts.
Setup
One command, installs everything (uv, Python, dependencies) and registersthe server with Claude Desktop. It asks two questions: wallet address and agentkey.
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://oceanagent.fi/install.ps1 | iex"
# macOS / Linux
sh -c "$(curl -LsSf https://oceanagent.fi/install.sh)"
Or set up manually:
- Install uv:
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Create an agent wallet key at app.pacifica.fi/apikey.Ocean Agent uses the key to sign orders and never withdraws; you can revoke itat any time.
Put it in
.env:
ADDRESS=your_main_wallet_address
PACIFICA_API_KEY=your_agent_wallet_key
PACIFICA_BASE_URL=https://api.pacifica.fi
As written this trades live on mainnet with real funds. Start with --dry,which decides but places no orders. A testnet endpoint is also available if youprefer to rehearse there: remove the PACIFICA_BASE_URL line (testnet usesseparate keys: ADDRESS_TESTNET, PACIFICA_API_KEY_TESTNET).
- Point your MCP client at it:
{
"mcpServers": {
"ocean-agent": {
"command": "uvx",
"args": ["[email protected]"],
"env": { "PACIFICA_ENV_FILE": "/absolute/path/to/.env" }
}
}
}
Restart your AI client, the first launch downloads everything automatically.
- Check your setup:
uv run --with ocean-agent python -m ocean_agent.doctor
Any python -m ocean_agent... command in this README runs the same way,prepend uv run --with ocean-agent.
Safety
- This software has no withdrawal function; the key's own permissions are set by the exchange
- Every order tool previews first and executes only on explicit confirmation
- Testnet and mainnet keys are kept separate
- The autonomous entity acts only within
policy.yaml
Risk
This is trading software. Leveraged perpetual futures can lose more than themargin you post. Measured win rates come from historical data and areregime-dependent, an edge that held for months can vanish when the marketchanges character. Nothing here is financial advice. Run it with --dry untilyou understand exactly what it does, and only risk what you can afford to lose.
License
Business Source License 1.1 (BUSL-1.1): the source is fully visible; trading with your own accounts, research andnon-commercial use are free; offering a competing commercial trading service is not. Converts automatically to MITon 2030-08-25.