Dmitry Beresnev commited on
Commit ·
6e99af6
1
Parent(s): abff89f
add openclaw configs, skills, etc
Browse filesFiles changed (9)
- README.md+20-1
- config/openclaw.env.exampleAdded+14
- openclaw.jsonAdded+62
- schedules/cron.ymlAdded+7
- skills/execution/SKILL.mdAdded+28
- skills/market_data/SKILL.mdAdded+19
- skills/reporting/SKILL.mdAdded+25
- skills/signal_trading/SKILL.mdAdded+26
- tools/README.mdAdded+19
8 unmodified lines91011128 unmodified linesshort_description: AGI Assistant---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference8 unmodified lines9101112131415161718192021222324252627282930318 unmodified linesshort_description: AGI Assistant---This Space hosts the OpenClaw trading bot (paper-only). The LLM runs in a separate Space that you already have; this repo only contains the bot-side architecture and configs.**Architecture**- OpenClaw bot Space (this repo) calls an external LLM Space for analysis and signal generation.- Paper trading via Alpaca API.- Trade logs stored to HF Hub storage (dataset repo).**LLM Space (external)**- Expected to expose a simple HTTP inference endpoint.- The bot calls `${LLM_SPACE_URL}` (see `config/openclaw.env.example`) and expects a JSON response with an output string.- Update `LLM_SPACE_URL` and response path in `openclaw.json` to match your existing LLM Space.**Key Files**- `openclaw.json` defines providers, routing, tools, memory, and safety.- `config/openclaw.env.example` lists all required env vars.- `skills/` contains architecture-only SKILL specs.- `tools/README.md` defines the tool surface to implement later.- `schedules/cron.yml` documents the intended schedule.If you want me to add minimal tool stubs or a working runner later, say the word and I will wire it up.
1234567891011121314# LLM Space (external)LLM_SPACE_URL=https://your-llm-space.hf.space/api/predict
# Alpaca paper tradingALPACA_API_KEY=your_keyALPACA_API_SECRET=your_secretALPACA_BASE_URL=https://paper-api.alpaca.markets
# HF Storage for trade logsHF_TOKEN=hf_xxxHF_TRADES_REPO=username/trading-logs
# Market data (optional extra source)MARKET_DATA_SOURCE=alpaca1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162{ "agent": { "name": "openclaw-trading-bot", "description": "OpenClaw bot for paper trading with Alpaca and external LLM Space", "timezone": "UTC" }, "providers": [ { "name": "hf_space_llm", "type": "custom_http", "base_url": "${LLM_SPACE_URL}", "method": "POST", "timeout_ms": 20000, "request_schema": { "inputs": "${prompt}" }, "response_path": "data.output_text" } ], "routing": { "market_analysis": "hf_space_llm", "signal_generation": "hf_space_llm", "reporting": "hf_space_llm" }, "tools": { "alpaca_paper": { "type": "python", "module": "tools.alpaca_paper", "env": [ "ALPACA_API_KEY", "ALPACA_API_SECRET", "ALPACA_BASE_URL" ] }, "hf_storage": { "type": "python", "module": "tools.hf_storage", "env": [ "HF_TOKEN", "HF_TRADES_REPO" ] }, "market_data": { "type": "python", "module": "tools.market_data", "env": [ "MARKET_DATA_SOURCE" ] } }, "memory": { "type": "sqlite", "path": "/data/openclaw_memory.sqlite", "max_tokens": 1200 }, "safety": { "paper_only": true, "max_order_qty": 5, "max_position_usd": 5000, "require_signal": true }}1234567schedules: market_data: cron: "*/5 * * * *" signal_trading: cron: "*/5 * * * *" reporting: cron: "0 0 * * *"12345678910111213141516171819202122232425262728name: executionversion: 0.1kind: skillsummary: Executes paper orders with safety checks and logs tradestriggers: - event: "signal_ready"inputs: - signaloutputs: - order_id - statustools: - alpaca_paper - hf_storagesteps: - id: preflight run: "risk_checks" - id: place_order tool: alpaca_paper with: action: submit_order signal: "${signal}" - id: log_trade tool: hf_storage with: record: "${order}"notes: - "Keep this paper-only; hard-block live trading in tool implementation"12345678910111213141516171819name: market_dataversion: 0.1kind: skillsummary: Fetches market data snapshots for analysistriggers: - cron: "*/5 * * * *"inputs: - symbolsoutputs: - snapshottools: - market_datasteps: - id: fetch_snapshot tool: market_data with: symbols: "${symbols}"notes: - "This skill is intentionally minimal; implement tool wiring in tools/market_data.py"12345678910111213141516171819202122232425name: reportingversion: 0.1kind: skillsummary: Creates daily summaries of signals and tradestriggers: - cron: "0 0 * * *"inputs: - tradesoutputs: - reportproviders: - hf_space_llmtools: - hf_storagesteps: - id: summarize provider: hf_space_llm with: prompt: "Summarize the trading day from this JSON: ${trades}" - id: store_report tool: hf_storage with: record: "${report}"notes: - "Replace with PDF/CSV generator when ready"1234567891011121314151617181920212223242526name: signal_tradingversion: 0.1kind: skillsummary: Generates trade signals via external LLM and queues orderstriggers: - cron: "*/5 * * * *"inputs: - snapshotoutputs: - signalproviders: - hf_space_llmsteps: - id: build_prompt run: "render_prompt" with: template: "${PROMPT_TEMPLATE}" snapshot: "${snapshot}" - id: generate_signal provider: hf_space_llm with: prompt: "${prompt}" - id: normalize_signal run: "normalize_signal"notes: - "Add a schema validator to keep outputs strict: buy/sell/hold + qty"12345678910111213141516171819# Tools (Architecture Only)
This directory defines the tool surface expected by `openclaw.json`.Implementations are intentionally left as stubs for now.
Expected modules:- `tools/alpaca_paper.py` - `submit_order(signal)` - `list_positions()` - Safety: refuse non-paper base URL- `tools/hf_storage.py` - `append_trade(record)` - `append_report(record)` - Storage target: HF dataset repo- `tools/market_data.py` - `get_snapshot(symbols)` - Optional: Alpaca data or external provider
All tools should accept config via environment variables listed in `openclaw.json`.README.md+20-1
config/openclaw.env.exampleAdded+14
openclaw.jsonAdded+62
schedules/cron.ymlAdded+7
skills/execution/SKILL.mdAdded+28
skills/market_data/SKILL.mdAdded+19
skills/reporting/SKILL.mdAdded+25
skills/signal_trading/SKILL.mdAdded+26
tools/README.mdAdded+19