An open-source, no-close trend-following trading agent powered by Bittensor data — MANTIS consensus (SN123) and Synth forecasts — delivered through the IQ MCP. Point it at one URL with a bearer token and it has its edge.
The defining idea: the LLM only ever opens positions. It has no tool to close anything and no tool to move a stop. Every exit is owned by a mechanical trailing stop. This isn't a gimmick — it's the result of measuring thousands of live cycles where discretionary LLM closes bled value (cutting winners short, churning fees) while the mechanical trail captured the trends. So we removed the close decision from the model entirely. The model finds entries; the machine banks exits.
IQ MCP (data) this agent execution
┌──────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ mantis_arbos │──feed─▶ │ LLM: OPEN only │──open─▶ │ paper book (def)│
│ synth_* │ │ (no close/adjust)│ │ or Hyperliquid │
└──────────────┘ └──────────────────┘ └────────┬─────────┘
▲ │
└──── trailing stop ─────────┘
(owns every exit)
- MANTIS / SN123 (
mantis_arbos_feed): the digested, emission-weighted consensus across five challenges — directional buckets for BTC/ETH, per-asset breakout continuation, and cross-sectional strength ranks. - Synth (
synth_percentiles,synth_volatility): probabilistic price + vol forecasts to size or filter entries.
Both arrive through the MCP, gated by your token's scopes. Spot prices for marking come from a public venue (Hyperliquid mids) — the MCP brokers edge data, not commodity quotes.
git clone https://github.com/Delta-Compute/iq-arbos-agent
cd iq-arbos-agent
npm install
cp .env.example .env # then fill in IQ_MCP_TOKEN + OPENROUTER_API_KEY
node src/index.mjs entitlements # sanity-check your MCP token + scopes
node src/index.mjs init # create a fresh $2,200 paper book
node src/index.mjs once # run one cycle
node src/index.mjs loop 15 # run every 15 minutesYou need two credentials:
IQ_MCP_TOKEN— a bearer token for the IQ MCP (ask the operator). Needs thedata:mantisanddata:synthscopes.OPENROUTER_API_KEY— your own key; pick any tool-calling model withAGENT_MODEL(defaultdeepseek/deepseek-chat-v3-0324).
Want to watch it think without spending anything? npm run dry logs intended
actions with no LLM spend and no orders.
- Fetch prices; mark the book and run the mechanical exits (trailing stop → stop-loss → take-profit) before the model sees anything.
- Pull
mantis_arbos_feed(andsynth_forecaston demand) from the MCP. - The LLM reads the signal + account state and calls
open_positionfor any high-conviction entries — each with a mandatory stop. It cannot close. - The executor fills the opens; the book/decisions are persisted.
Every state change is appended to data/decisions.jsonl — an open/close
fan-out stream you can tail to mirror the agent onto any venue of your own.
A position's exit is fully mechanical:
- Initial stop-loss (required on every open) caps the downside.
- Trailing stop: once a position's peak return reaches
AGENT_TRAIL_ACTIVATE_PCT(default +3%), it exits if the return gives backAGENT_TRAIL_GIVEBACK(default 25%) of that peak. Peak +6% locks ~+4.5%; peak +20% locks ~+15%. It only ever tightens. - Optional take-profit if the model sets one.
Tune via AGENT_TRAIL_ACTIVATE_PCT / AGENT_TRAIL_GIVEBACK.
A simulated book in data/book.json with realistic slippage (5 bps) and fees
(4 bps/fill). No keys, no risk. The reference implementation of the engine.
Set AGENT_EXECUTOR=hyperliquid to run the same model on a real Hyperliquid
account: market-open + a reduce-only trigger stop, with the trailing stop
ratcheted on-exchange.
⚠️ This module is unaudited. Trade at your own risk.
- Start on testnet (
HL_TESTNET=1) and withAGENT_DRY_RUN=1.- Hard caps are enforced regardless of the model:
HL_MAX_NOTIONAL_USD,HL_MAX_PORT_NOTIONAL_USD, and a mandatory stop (HL_REQUIRE_STOP).- Needs the optional dep:
npm i @nktkas/hyperliquid, plusHL_PRIVATE_KEY(an API/agent wallet) andHL_ACCOUNT_ADDRESS.
Everything is environment-driven — see .env.example for the
full annotated list (MCP, model, sizing, trail, executor, caps, Telegram).
# systemd, cron, pm2, Docker — anything that can run `node src/index.mjs once`
# on a schedule, or keep `node src/index.mjs loop 15` alive.
*/15 * * * * cd /path/to/iq-arbos-agent && node --env-file=.env src/index.mjs onceThis software is provided for research and educational purposes under the MIT license. It is not investment advice. Trading leveraged derivatives risks the total loss of capital. You are solely responsible for any use, any keys you supply, and any trades it places. Nothing here is a guarantee of performance.