octobot-stack
4
总安装量
4
周安装量
#51484
全站排名
安装命令
npx skills add https://github.com/herklos/octobot-stack-vs-workspace --skill octobot-stack
Agent 安装分布
openclaw
4
claude-code
4
github-copilot
4
codex
4
cursor
4
mcpjam
3
Skill 文档
OctoBot Stack Development
Help developers build, extend, and maintain the OctoBot cryptocurrency trading bot stack.
References
Consult these resources as needed:
- ./references/architecture.md — Repository layers, dependency hierarchy, and integration points
- ./references/tentacles.md — Tentacle structure, metadata, exchange implementations, and plugin patterns
- ./references/workflows.md — Common development workflows, CCXT integration, and build tasks
Overview
OctoBot is a modular cryptocurrency trading bot built across multiple repositories with strict layering:
Core Layer (foundational, no upward dependencies):
OctoBot-Commons– Shared utilities, configuration, logging, data structuresAsync-Channel– Async messaging for decoupled component communicationOctoBot-Trading– Trading logic, exchange APIs, orders, portfolio managementOctoBot-Evaluators– Strategy evaluation frameworkOctoBot-Backtesting– Historical data simulationtrading-backend– Backend services
Extension Layer (plugins):
OctoBot-Tentacles– Exchange connectors, evaluators, services as installable plugins
Application Layer (end-user apps):
OctoBot– Main bot applicationOctoBot-Binary,OctoBot-Script,OctoBot-Market-Making,OctoBot-Prediction-Market
Tooling Layer:
Package-Version-Manager– Version management across repos
Critical Rules
Imports
- Use absolute imports with
octobot_prefix:import octobot_trading.exchanges as exchanges - Never import upward in the hierarchy (Core cannot import Application/Extension)
- Avoid circular dependencies between modules
Tentacle Structure
Every tentacle requires:
__init__.py– Package marker- Main class file (e.g.,
binance_exchange.py) metadata.json– NOT YAML – with"origin_package": "OctoBot-Default-Tentacles"tests/directory with relative imports (from ...binance import Binance)
Exchange Tentacles
- Inherit from
RestExchangeorCCXTConnector - Define
DESCRIPTIONclass attribute (string) - Define
DEFAULT_CONNECTOR_CLASS(connector class reference) - Implement
@classmethod get_name(cls)returning lowercase exchange name
File naming:
- Exchange:
{exchange}_exchange.py - WebSocket:
{exchange}_websocket.py - Connector:
{exchange}_connector.pyor insideccxt/
PYTHONPATH Setup
Before development, run the “Setup PYTHONPATH” task to include all repos in the Python path:
# VS Code task includes all repos
PYTHONPATH=<workspace>/Async-Channel:<workspace>/OctoBot-Trading:...
Common Workflows
Link Tentacles
# Link OctoBot-Tentacles to application repos
ln -s $(pwd)/OctoBot-Tentacles/ OctoBot/tentacles
ln -s $(pwd)/OctoBot-Tentacles/ OctoBot-Trading/tentacles
Build New Exchange (CCXT)
cd ccxt
npm run emitAPI polymarket && npm run transpileRest polymarket && npm run transpileWs polymarket
- Edit TypeScript sources in
ccxt/ts/src/*.ts - Never use ternary operators or type annotations (breaks transpilation)
- Use
handleErrorsmethod withexceptions['exact']/['broad']mappings
Generate Tentacles
cd OctoBot
python start.py tentacles -p ../../tentacles_default_export.zip -d ../OctoBot-Tentacles
Run OctoBot
cd OctoBot
python start.py
Test Tentacles
cd OctoBot-Tentacles/Trading/Exchange/binance/tests
pytest
Use relative imports in tests: from ...binance import Binance
Quick Checklist
Before committing:
- Imports follow
octobot_{repo}.*pattern and respect layer hierarchy - New tentacles have
__init__.py, main file,metadata.json - Exchange classes inherit
RestExchangeand implementget_name() - Tests exist under
tests/with proper fixtures - CCXT edits avoid ternary operators and type annotations
- No circular dependencies introduced
- Async patterns use
asyncio.run()entry points,create_task()for concurrency