π¦ ClawHub
OpenD CLI for MooMoo
by @oscraters
Agentic trading and market-data workflows for Futu OpenD (MooMoo/Futu OpenAPI), including OpenClaw-compatible secret-ref credential loading, account discover...
TERMINAL
clawhub install opendπ About This Skill
name: opend description: Agentic trading and market-data workflows for Futu OpenD (MooMoo/Futu OpenAPI), including OpenClaw-compatible secret-ref credential loading, account discovery, position queries, and simulated or live order placement. Use when tasks require calling local OpenD through Python/Bash automation with structured JSON output and explicit trading-safety guardrails.
OpenD Skill
Use this skill to execute local OpenD operations through a single CLI surface.
Quick Start
127.0.0.1:11111, or override with OPEND_HOST and OPEND_PORT.moomoo or futu.export OPEND_PASSWORD_SECRET_REF='{"source":"env","id":"MOOMOO_PASSWORD"}'
- Provide the actual MOOMOO_PASSWORD through OpenClaw gateway secret injection, not plain shell export.
pip install keyring cryptography.Primary Interface
Use Bash CLI ./openclaw for routine operations. If the wrapper is unavailable in a published bundle, use python3 opend_cli.py directly and treat that as a packaging bug.
Examples:
./openclaw snapshot --codes HK.00700,US.AAPL
./openclaw accounts
./openclaw --trd-env SIMULATE positions
./openclaw --market HK --trd-env SIMULATE place-order --code HK.00700 --price 100 --qty 100 --side BUY
./openclaw --market HK --trd-env SIMULATE cancel-order --order-id Credential Methods
openclawOPEND_PASSWORD_SECRET_REF first.
- Current local resolver accepts OpenClaw-style env refs only: {"source":"env","id":"ENV_VAR_NAME"}.
- file and exec refs must be resolved by the OpenClaw gateway before launching this skill.
env: reads MOOMOO_PASSWORD
- config: reads MOOMOO_CONFIG_KEY and decrypts config.enc
- keyring: prompts once and stores password in the OS keyring
env, config, and keyring bypass the preferred OpenClaw secret-ref audit path. Use them only for local development or controlled offline workflows.Agentic Defaults
--output json so downstream steps can parse results.SIMULATE unless the user explicitly requests live trading.accounts first for unknown environments, then pass explicit --acc-id.Safety and Secret Handling
setup_config.py and config.enc are legacy compatibility helpers. They no longer print reusable keys to stdout, but they still create local secret material and should be treated as sensitive.keyring stores credentials in the OS keychain. Confirm that storage model is acceptable before using it.OPEND_SDK_PATH changes where Python imports moomoo or futu from. Only point it at trusted code.Environment and Runtime Inputs
Secrets:
OPEND_PASSWORD_SECRET_REFMOOMOO_PASSWORDMOOMOO_CONFIG_KEYNon-secret overrides:
OPEND_HOSTOPEND_PORTOPEND_MARKETOPEND_SECURITY_FIRMOPEND_TRD_ENVOPEND_CREDENTIAL_METHODOPEND_OUTPUTOPEND_SDK_PATHFiles
openclaw: Bash CLI entrypoint.opend_cli.py: structured command interface.opend_core.py: shared OpenD logic.credentials.py: secret-ref, env, keyring, and config password loading.references/api_docs.md: official API links and key limits.references/release_checklist.md: pre-publish validation checklist.Legacy Compatibility
Older scripts delegate to opend_cli.py:
get_market_snapshot.pyquery_positions.pyplace_order.pyplace_order_env.pyplace_order_keyring.pyplace_order_config.pyπ‘ Examples
127.0.0.1:11111, or override with OPEND_HOST and OPEND_PORT.moomoo or futu.export OPEND_PASSWORD_SECRET_REF='{"source":"env","id":"MOOMOO_PASSWORD"}'
- Provide the actual MOOMOO_PASSWORD through OpenClaw gateway secret injection, not plain shell export.
pip install keyring cryptography.