OpenWhale

The programmable layer for composable, AI-native economic strategies.

GitHub
the core idea

Programmable.
Composable.
AI-native.

We don't ask the LLM to guess buy/sell every tick.
We ask it to write the strategy, compile it with esbuild, and hot-reload at runtime.
.ts
strategies as code
git
version · branch · PR
Write once.
Run on any exchange.
Strategy code has zero knowledge of which exchange it runs on.
a strategy in ~10 lines
class MomentumStrategy extends BaseStrategy {
  readonly strategyId = 'momentum'

  async evaluate(context: StrategyContext) {
    const { symbol, threshold } = this.params.base
    const tick = context.getData('price', symbol)
    if (!tick || tick.price < threshold) return []
    return [this.instruction('perp', 'placeOrder',
      { symbol, side: 'buy', type: 'market', amount: 0.01 })]
  }
}
context.getData() — no exchange SDK. No WebSocket boilerplate.
this.instruction() — no direct API calls. Swap the exchange in one line.
This entire class can be generated by AI, compiled with esbuild, and hot-loaded at runtime.
architecture

Four layers.
Every one replaceable.

Swap any layer without rewriting the others. The AI layer is just one node in the graph.

Monitor          ─▶  data collection  (WS / poll → JSONL)
TriggerManager   ─▶  Cron + Monitor AND, time-windowed
Strategy         ─▶  AI inference / rule-based decision
Executor         ─▶  trade execution
monitor
WS + Poll
→ JSONL stream
trigger
AND-logic
time-windowed
strategy
LLM ✕ code
hot-reload
executor
multi-venue
paired orders
vs general agents

Trading-native by design.

🐋
OpenWhale
  • · role — programmer
  • · output — TypeScript code
  • · audit — git diff
  • · LLM call — on recompile
  • · scope — vertical (trade)
🤖
OpenClaw · Hermes
  • · role — agent runtime / loop
  • · output — tool calls
  • · audit — logs
  • · LLM call — every tick
  • · scope — horizontal

tl;dr — they ask AI to make a trade. We ask AI to write a trader.

in the wild

Real strategies, shipped.

copy-trading

Mirror any wallet, proportionally.

Monitor a target address. Mirror trades at a configurable ratio with position caps. One strategy, any exchange.

cross-exchange-arb

Hyperliquid ↔ Binance

Spread AND funding rate — both must align within 60s. Paired orders, two account instances.

llm-news-react

News → structured output → trade.

Schema-validated. Acts only on { confidence > 0.7, action != hold }.

on-chain events

Contract event → action.

Listen to smart contract events. Trigger on-chain or off-chain actions automatically.

nft sniping

Mempool → milliseconds.

Monitor launchpad events. Execute within milliseconds of a trigger.

join

Sign the manifesto.

5 steps · ~2 minutes · NFT raffle on completion.

© 2026 OpenWhale · open source · open whale