OpenWhale
The programmable layer for composable, AI-native economic strategies
A TypeScript framework for building automated crypto trading strategies, with AI models callable directly inside strategy logic and a web dashboard.
OpenWhale is a TypeScript framework for building automated trading and economic strategies, aimed mainly at crypto markets. It structures a trading system into three independent layers: a Monitor that collects data from exchanges or other sources, a Strategy that contains the rules or AI logic deciding what action to take, and an Executor that carries out the actual trades. Because these layers are decoupled, you can swap one piece, such as replacing a live exchange executor with a mock one for testing, without touching the others.
A notable feature is that strategies can call AI language models directly as part of their decision logic. A strategy can receive market data, ask an AI model whether to buy, sell, or hold, using a defined structured response format, and then act on that answer, all inside the same strategy code, with support for several AI providers. Strategies written in TypeScript can also be generated or evolved by AI and compiled and loaded at runtime without restarting the whole system.
The trigger system combines scheduled timing, such as running every few minutes, with conditions from multiple monitors at once, for example firing only when a price change and a funding rate condition are both true within a specific time window. This replaces manually written polling loops with a more declarative approach to deciding when a strategy should run.
Stated use cases include copy trading, which mirrors another wallet's trades, cross exchange arbitrage, AI driven market making, and automated responses to on chain events. The project is written in TypeScript, runs on Node.js, and includes a web dashboard for managing strategy instances and credentials. It is released under the MIT license.
Where it fits
- Build a copy-trading bot that mirrors another wallet's trades proportionally with position limits.
- Write a strategy that asks an AI model whether to buy, sell, or hold based on live market data.
- Trigger cross-exchange arbitrage trades only when price spread and funding rate conditions align.