@alphafox/cli 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,38 +1,40 @@
1
1
  ---
2
2
  name: alphafox-strategy
3
- description: Strategy definitions and chats via public operationIds.
4
- version: 0.3.5
3
+ description: Strategy definitions — list types (grid, dca, copy, …) and validate config. Creating a running strategy is creating a trader; use alphafox-trading for that.
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
- # Strategy / Chat
7
+ # Strategy definitions
8
8
 
9
- Always `--format json --no-input`. Read scopes `trading:read`; writes `chats:write`.
9
+ Always `--format json --no-input`. Read scopes `trading:read`; validate is `trading:write`.
10
10
 
11
- Whenever the human names a coin or ticker, resolve it with `alphafox resolve-symbols` (`skills/market`) before writing strategy config or symbols arrays. Exact matches may be used; a single close match needs confirmation; multiple close matches must be chosen by the human.
11
+ A **definition** is a strategy type (grid, dca, copy, …). A **trader** is one running instance of a definition. Instantiating a definition is `alphafox-trading`, not this skill.
12
+
13
+ Whenever the human names a ticker (US stock, coin, or contract), resolve it with `alphafox resolve-symbols` (`skills/market`) before writing symbols into a config you later validate or hand to create. 美股 are equity perps in `binance_perp_usdt` (`NVDA/USDT:USDT`, `assetClass=equity_perp`) — do not swap them for a crypto coin.
12
14
 
13
15
  ## Read
14
16
 
15
17
  ```bash
16
18
  alphafox schema trading.strategy_definitions.list --format json --no-input
17
19
  alphafox api GET /api/v1/trading/strategy-definitions --format json --no-input
20
+ alphafox trading strategy_definitions byId get --definitionId <id> --format json --no-input
18
21
  ```
19
22
 
20
- ## Write (ordinary)
23
+ Use the list to pick the definition the operator named. Copy / rebate-copy / DCA / grid are rows in this catalog, not a separate product.
24
+
25
+ ## Validate config
21
26
 
22
- Read `request.body` first. Do not invent chat or strategy fields.
27
+ Read `request.body` first. Do not invent definition or config fields.
23
28
 
24
29
  ```bash
25
- alphafox schema chats.create --format json --no-input
26
- alphafox chats create --body '{"strategyGenerationMode":"simple"}' --format json --no-input
27
- # large / nested bodies:
28
- # alphafox chats create --config @./create-chat.json --format json --no-input
30
+ alphafox schema trading.strategy_definitions.byId.validate_config --format json --no-input
31
+ alphafox trading strategy_definitions byId validate_config --definitionId <id> --config @./strategy-config.json --format json --no-input
29
32
  ```
30
33
 
31
- Requires auth. Sends `Idempotency-Key` when available. Duplicate key `409`; do not invent a new key unless the operator asks to create another chat.
32
-
33
- Engine strategy backtest (WASM tape + persist) is `skills/engine-backtest` (`alphafox engine-backtest run`). Chat-attached `/api/v1/backtests` (`backtests.*`) is not a CLI surface — do not call it.
34
+ After the config validates, create the running instance with `alphafox-trading`.
34
35
 
35
36
  ## operationIds
36
37
 
37
38
  - `trading.strategy_definitions.list`
38
- - `chats.create`
39
+ - `trading.strategy_definitions.byId.get`
40
+ - `trading.strategy_definitions.byId.validate_config`
@@ -1,14 +1,26 @@
1
1
  ---
2
2
  name: alphafox-trading
3
- description: Traders list and high-risk start/stop with confirmation gates.
4
- version: 0.3.5
3
+ description: Running strategies (traders) — create, list, start, and stop. A trader is a live or paper strategy instance (grid, dca, copy, …), not a person.
4
+ version: 0.3.7
5
5
  ---
6
6
 
7
- # Trading
7
+ # Running strategies (traders)
8
8
 
9
- Always `--format json --no-input`. Read first. Writes need scopes `trading:write`; start/stop also `trading:high-risk`.
9
+ Always `--format json --no-input`. Read first. Creates and updates need `trading:write`; start/stop also `trading:high-risk`.
10
10
 
11
- Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skills/market`) before they are written into trader config.
11
+ A **trader** is a running strategy instance (paper or live). Creating a strategy means creating a trader. Bind it to a **strategy definition**, an exchange connector, and runtime settings.
12
+
13
+ Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skills/market`) before they are written into trader config. 美股 stay `equity_perp` contracts such as `NVDA/USDT:USDT`.
14
+
15
+ Pick the create operation from the definition the operator asked for:
16
+
17
+ | Kind | Create |
18
+ |---|---|
19
+ | Engine definitions (grid, dca, …) | `trading.traders.create` |
20
+ | Hyperliquid copy | `trading.hl_copy_traders.create` |
21
+ | Rebate copy | `trading.rebate_copy_traders.create` |
22
+
23
+ Copy leads come from `trading.signal_sources.list` when the operator named one. Same trader lifecycle (list / start / stop) after create.
12
24
 
13
25
  ## Read
14
26
 
@@ -16,9 +28,23 @@ Human-mentioned tickers must be resolved with `alphafox resolve-symbols` (`skill
16
28
  alphafox api GET /api/v1/trading/traders --format json --no-input
17
29
  ```
18
30
 
19
- ## High-risk write
31
+ ## Create
32
+
33
+ Read `alphafox schema <operationId>` first. Body may only include documented `request.body` fields. Large / nested bodies use `--config @file`.
34
+
35
+ ```bash
36
+ alphafox schema trading.traders.create --format json --no-input
37
+ alphafox trading traders create --config @./create-trader.json --dry-run --format json --no-input
38
+ alphafox trading traders create --config @./create-trader.json --yes --format json --no-input
39
+ ```
40
+
41
+ `trading.traders.create` is `high-risk-write` and needs `--yes`. Copy creates follow whatever `risk` the schema reports — `--dry-run` first, then `--yes` when required.
42
+
43
+ If a required field is missing, re-read the schema and ask the operator. Do not invent ids. The CLI has no authoring-session surface; instantiate from a definition, connector, and config.
44
+
45
+ ## High-risk start / stop
20
46
 
21
- Read `alphafox schema trading.traders.byId.start` first. Body may only include documented fields (`reason` is optional). Do not invent keys.
47
+ Read `alphafox schema trading.traders.byId.start` first. Body may only include documented fields (`reason` is optional).
22
48
 
23
49
  ```bash
24
50
  alphafox schema trading.traders.byId.start --format json --no-input
@@ -39,5 +65,9 @@ Stop: `POST /api/v1/trading/traders/{traderId}/stop` with the same `--dry-run` t
39
65
  ## operationIds
40
66
 
41
67
  - `trading.traders.list`
68
+ - `trading.traders.create`
69
+ - `trading.hl_copy_traders.create`
70
+ - `trading.rebate_copy_traders.create`
71
+ - `trading.signal_sources.list`
42
72
  - `trading.traders.byId.start`
43
73
  - `trading.traders.byId.stop`