Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IQ Arbos Agent

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)

What it trades on

  • 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.

Quick start (paper, ~2 minutes)

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 minutes

You need two credentials:

  1. IQ_MCP_TOKEN — a bearer token for the IQ MCP (ask the operator). Needs the data:mantis and data:synth scopes.
  2. OPENROUTER_API_KEY — your own key; pick any tool-calling model with AGENT_MODEL (default deepseek/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.

How a cycle works

  1. Fetch prices; mark the book and run the mechanical exits (trailing stop → stop-loss → take-profit) before the model sees anything.
  2. Pull mantis_arbos_feed (and synth_forecast on demand) from the MCP.
  3. The LLM reads the signal + account state and calls open_position for any high-conviction entries — each with a mandatory stop. It cannot close.
  4. 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.

The no-close trailing stop

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 back AGENT_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.

Execution

Paper (default)

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.

Hyperliquid (optional, beta)

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 with AGENT_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, plus HL_PRIVATE_KEY (an API/agent wallet) and HL_ACCOUNT_ADDRESS.

Configuration

Everything is environment-driven — see .env.example for the full annotated list (MCP, model, sizing, trail, executor, caps, Telegram).

Run it as a service

# 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 once

Disclaimer

This 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.

About

Open-source no-close trend-following agent: Bittensor data (MANTIS + Synth) via the IQ MCP. The LLM only opens; a trailing stop owns every exit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages