Hyperliquid L1 · Perpetual futures

An AI trading agent
for Hyperliquid L1

Oneechan watches live on-chain market data, asks a DeepSeek model to reason over it, sizes the trade with a risk engine, and executes it through the Hyperliquid SDK — paper-first, live only when you're ready.

Runs fully in paper mode out of the box — no keys required to try it.

Architecture

How it works

Every decision cycle runs the same five-stage pipeline — read, reason, size, execute, record.

1

Market data

Pulls candles, funding and the order book from the Hyperliquid Info API, then computes SMA, EMA, RSI and ATR indicators.

2

DeepSeek brain

Sends a compact context prompt to DeepSeek and parses a structured LONG / SHORT / CLOSE / HOLD decision.

3

Risk engine

Sizes the position from equity-at-risk to the stop, capped by max notional and max leverage.

4

Executor

Fills orders in simulated paper mode, or signs real market orders via the SDK in live mode.

5

Ledger

Persists equity, positions and trade history to disk every cycle so you can track performance.

Features

Built to trade, designed to be safe

Multi-provider AI

DeepSeek, Claude, GPT-4o, Gemini and more — OpenRouter, Groq, xAI, Mistral. One-line swap.

Paper-first

Simulated fills at mid price with a taker-fee assumption. Zero keys required to start.

Live trading

Real orders on Hyperliquid testnet or mainnet behind an explicit --mode live flag.

Risk controls

Confidence-scaled sizing, stop & take-profit, max notional, max leverage, per-coin cooldown.

Multi-coin

Watch any Hyperliquid perps — BTC, ETH, SOL and hundreds more.

Backtested

Ships with a backtesting harness that replays real Hyperliquid candles and reports honest metrics — return, win rate, drawdown.

Setup guide

Get Oneechan running in 5 minutes

Everything below runs in paper mode — no API keys or funds required. Only switch to live when you're ready.

1 Prerequisites

Python 3.10+ (tested on 3.14). A DeepSeek API key for the real brain. For live mode, a Hyperliquid wallet or API-wallet private key.

2 Install

Create a virtual environment and install the dependencies.

# clone / enter the project
cd oneechan

# create a virtual environment and install
python -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install -r requirements.txt

3 Configure your keys

Copy the environment template and fill in your keys. Paper mode needs none of this.

cp .env.example .env
# .env
DEEPSEEK_API_KEY=sk-xxxxxxxx        # DeepSeek key
HYPERLIQUID_PRIVATE_KEY=0x...       # only for live mode (API wallet)

4 Run in paper mode

Try a single decision cycle first, then let it run on a loop.

python main.py --once            # one decision cycle, then exit
python main.py                   # loop every 5 minutes
python main.py --brain mock      # run the pipeline with no LLM at all

5 Go live (when ready)

Real orders. Start on testnet, and use an API wallet that can trade but never withdraw.

python main.py --mode live --network testnet
python main.py --mode live --network mainnet
Reference

Configuration

All settings live in config.yaml. Defaults are safe and paper-only.

KeyDefaultMeaning
agent.modepaperpaper (simulated) or live (real orders)
agent.coins[BTC, ETH, SOL]Perps the agent watches
agent.interval1hCandle interval fed to the brain
agent.lookback96Candles in the context window
agent.cadence_seconds300Seconds between decision cycles
agent.cooldown_seconds3600Min seconds between trades per coin
agent.max_position_pct25.0Max notional per position, % of equity
agent.max_leverage3Max effective leverage
agent.risk_per_trade_pct1.0Equity at risk per trade, %
llm.providerdeepseekdeepseek | openai | anthropic | gemini | openrouter | groq | xai | …
llm.modeldeepseek-v4-proProvider model ID (claude-sonnet-5-5, gpt-4o, …)
hyperliquid.networktestnettestnet or mainnet
hyperliquid.address""Main wallet address (public)
AI providers

Bring your own brain

Oneechan speaks to every major model through one interface. Pick any provider below, set llm.provider and the matching key in .env.

DeepSeek
DeepSeek
deepseek-v4-pro
Anthropic Claude
Claude
claude-sonnet-5-5
OpenAI
OpenAI
gpt-4o
Google Gemini
Gemini
gemini-3-flash-preview
OpenRouter
OpenRouter
any model
Groq
Groq
llama-3.3-70b
xAI Grok
xAI
grok-2-latest
Together AI
Together AI
llama-3.3-70b
Mistral AI
Mistral AI
mistral-large-latest
Perplexity
Perplexity
sonar-pro
Cohere
Cohere
command-r-plus
Fireworks AI
Fireworks AI
llama-v3p3-70b
Cerebras
Cerebras
llama3.3-70b
Qwen
Qwen
qwen-max
Security

Your keys stay yours

Env-only keys

The private key is only ever read from the environment. .env is gitignored and never committed.

API wallet

Trade with a dedicated API wallet that can place and cancel orders but can never withdraw funds.

Paper by default

Nothing is signed unless you explicitly pass --mode live. Paper mode needs no key at all.

FAQ

Frequently asked

Do I need to deposit funds to try it?

No. Paper mode simulates everything with a $10,000 virtual balance and needs zero keys or funds.

What does the DeepSeek model actually decide?

It returns a single structured signal — LONG, SHORT, CLOSE or HOLD — plus a confidence score, stop and take-profit levels, and a suggested leverage. The risk engine then turns that into a concrete position size.

Is this financial advice?

No. Oneechan is educational software. Perpetual futures carry substantial risk of loss. Start in paper mode and never trade money you can't afford to lose.

How do I switch from paper to live?

Add HYPERLIQUID_PRIVATE_KEY to .env and run with --mode live. Start on --network testnet before touching mainnet.

Can I run it on other coins?

Yes. Change agent.coins in config.yaml, or pass --coins BTC SOL ETH on the command line.

Why a mock brain?

It lets you test the full pipeline — data, sizing, execution, ledger — without a DeepSeek key. It uses a simple momentum rule and is not meant for real trading.

Ready to run Oneechan?

Clone the repo, run it in paper mode, and watch DeepSeek read the Hyperliquid market — before you ever risk a cent.

Get started →