Skip to content

Commit a75b7d1

Browse files
committed
Rename crypto live profile namespace
1 parent 550c818 commit a75b7d1

16 files changed

Lines changed: 73 additions & 73 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ These profiles depend on artifacts produced by `CryptoLivePoolPipelines` before
3131

3232
| Profile | Name | Notes |
3333
| --- | --- | --- |
34-
| `crypto_leader_rotation` | Crypto Leader Rotation | runtime-enabled trend-following rotation that consumes the ordered live pool published by CryptoLivePoolPipelines. Runtime code may gate and size trades inside that pool, but monthly selection and order remain upstream. |
34+
| `crypto_live_pool_rotation` | Crypto Live Pool Rotation | runtime-enabled trend-following rotation that consumes the ordered live pool published by CryptoLivePoolPipelines. Runtime code may gate and size trades inside that pool, but monthly selection and order remain upstream. |
3535

3636
### Research-only candidates
3737

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CryptoStrategies 是 QuantStrategyLab 的加密货币策略包。为 Binance 执
3131

3232
| Profile | 名称 | 说明 |
3333
| --- | --- | --- |
34-
| `crypto_leader_rotation` | Crypto Leader Rotation | 消费 CryptoLivePoolPipelines 发布的有序 live pool 的趋势轮动策略。运行时代码可以在该池内做交易门控和仓位 sizing,但月度选池和排序属于上游。 |
34+
| `crypto_live_pool_rotation` | Crypto Live Pool Rotation | 消费 CryptoLivePoolPipelines 发布的有序 live pool 的趋势轮动策略。运行时代码可以在该池内做交易门控和仓位 sizing,但月度选池和排序属于上游。 |
3535

3636
### 研究侧候选
3737

docs/crypto_cross_platform_strategy_spec.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Crypto profiles must declare exactly one `target_mode`.
4040

4141
Current default is:
4242

43-
- `crypto_leader_rotation` -> `weight`
43+
- `crypto_live_pool_rotation` -> `weight`
4444

4545
Downstream platforms should translate only at the runtime boundary. Strategy code must not emit exchange-specific order fields.
4646

@@ -55,11 +55,11 @@ A crypto runtime adapter must declare at least:
5555
- `portfolio_input_name` when the strategy needs `ctx.portfolio`
5656
- `artifact_contract` when the strategy consumes upstream artifacts
5757

58-
`crypto_leader_rotation` currently declares an explicit artifact contract:
58+
`crypto_live_pool_rotation` currently declares an explicit artifact contract:
5959

6060
- `requires_snapshot_artifacts = true`
6161
- `requires_snapshot_manifest_path = true`
62-
- `snapshot_contract_version = crypto_leader_rotation.live_pool.v1`
62+
- `snapshot_contract_version = crypto_live_pool_rotation.live_pool.v1`
6363
- `config_source_policy = none`
6464

6565
The strategy package owns this declaration. Downstream platforms may decide how
@@ -68,7 +68,7 @@ profile-name branches.
6868

6969
## Live-pool authority boundary
7070

71-
For `crypto_leader_rotation`, `CryptoLivePoolPipelines` is the authority for monthly live-pool membership, ranking, and order. The execution platform validates and preserves the ordered `live_pool.json["symbols"]` list, then passes it into `StrategyContext.market_data["universe_snapshot"]`.
71+
For `crypto_live_pool_rotation`, `CryptoLivePoolPipelines` is the authority for monthly live-pool membership, ranking, and order. The execution platform validates and preserves the ordered `live_pool.json["symbols"]` list, then passes it into `StrategyContext.market_data["universe_snapshot"]`.
7272

7373
Strategy code may apply runtime gates, sell rules, top-N selection, inverse-volatility sizing, BTC core allocation, and buy-budget allocation inside that upstream pool. It must not rebuild the monthly live pool from local indicators, replace the upstream order with a local ranking, or treat research CSVs as a substitute for the validated artifact contract.
7474

@@ -93,7 +93,7 @@ Forbidden inside strategy code:
9393

9494
Today only one profile is live:
9595

96-
- `crypto_leader_rotation`
96+
- `crypto_live_pool_rotation`
9797

9898
Today only one platform adapter exists:
9999

docs/crypto_cross_platform_strategy_spec.zh-CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
当前默认是:
4343

44-
- `crypto_leader_rotation` -> `weight`
44+
- `crypto_live_pool_rotation` -> `weight`
4545

4646
如果以后某个平台原生不吃 `weight`,只能在 runtime 边界做翻译,不能把平台分支写进策略代码。
4747

@@ -56,18 +56,18 @@
5656
- 当策略需要 `ctx.portfolio` 时的 `portfolio_input_name`
5757
- 当策略依赖上游 artifact 时的 `artifact_contract`
5858

59-
`crypto_leader_rotation` 当前显式声明的 artifact contract 是:
59+
`crypto_live_pool_rotation` 当前显式声明的 artifact contract 是:
6060

6161
- `requires_snapshot_artifacts = true`
6262
- `requires_snapshot_manifest_path = true`
63-
- `snapshot_contract_version = crypto_leader_rotation.live_pool.v1`
63+
- `snapshot_contract_version = crypto_live_pool_rotation.live_pool.v1`
6464
- `config_source_policy = none`
6565

6666
策略包负责声明这些需求。下游平台可以决定从 Firestore、GCS、本地文件或状态里取 artifact,但不能再靠 profile 名称分支来猜这条策略需要什么 artifact。
6767

6868
## live-pool 权威边界
6969

70-
`crypto_leader_rotation` 来说,`CryptoLivePoolPipelines` 是月度 live pool 成员、ranking 和顺序的权威来源。执行平台负责校验并保留 `live_pool.json["symbols"]` 的有序列表,然后把它传给 `StrategyContext.market_data["universe_snapshot"]`
70+
`crypto_live_pool_rotation` 来说,`CryptoLivePoolPipelines` 是月度 live pool 成员、ranking 和顺序的权威来源。执行平台负责校验并保留 `live_pool.json["symbols"]` 的有序列表,然后把它传给 `StrategyContext.market_data["universe_snapshot"]`
7171

7272
策略代码可以在这个上游池内做运行时门控、卖出规则、top-N 选择、逆波动 sizing、BTC core allocation 和买入预算分配。策略代码不能用本地指标重建月度 live pool,不能用本地 ranking 替换上游顺序,也不能把 research CSV 当作已验证 artifact contract 的替代品。
7373

@@ -92,7 +92,7 @@
9292

9393
现在只有一条 live profile:
9494

95-
- `crypto_leader_rotation`
95+
- `crypto_live_pool_rotation`
9696

9797
现在也只有一个平台 adapter:
9898

src/crypto_strategies/catalog.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
load_strategy_entrypoint,
1515
)
1616

17-
CRYPTO_LEADER_ROTATION_PROFILE = "crypto_leader_rotation"
17+
CRYPTO_LIVE_POOL_ROTATION_PROFILE = "crypto_live_pool_rotation"
1818

1919
CRYPTO_CANONICAL_REQUIRED_INPUTS = frozenset(
2020
{
@@ -27,10 +27,10 @@
2727
)
2828

2929
STRATEGY_TARGET_MODES: dict[str, str] = {
30-
CRYPTO_LEADER_ROTATION_PROFILE: "weight",
30+
CRYPTO_LIVE_POOL_ROTATION_PROFILE: "weight",
3131
}
3232

33-
CRYPTO_LEADER_ROTATION_DEFAULT_CONFIG = {
33+
CRYPTO_LIVE_POOL_ROTATION_DEFAULT_CONFIG = {
3434
"trend_pool_size": 5,
3535
"rotation_top_n": 2,
3636
"min_history_days": 365,
@@ -39,40 +39,40 @@
3939
"weight_mode": "inverse_vol",
4040
"allow_rotation_refresh": True,
4141
"atr_multiplier": 2.5,
42-
"artifact_contract_version": "crypto_leader_rotation.live_pool.v1",
42+
"artifact_contract_version": "crypto_live_pool_rotation.live_pool.v1",
4343
"artifact_max_age_days": 45,
4444
"artifact_acceptable_modes": ("core_major",),
4545
}
4646

4747
STRATEGY_DEFINITIONS: dict[str, StrategyDefinition] = {
48-
CRYPTO_LEADER_ROTATION_PROFILE: StrategyDefinition(
49-
profile=CRYPTO_LEADER_ROTATION_PROFILE,
48+
CRYPTO_LIVE_POOL_ROTATION_PROFILE: StrategyDefinition(
49+
profile=CRYPTO_LIVE_POOL_ROTATION_PROFILE,
5050
domain=CRYPTO_DOMAIN,
5151
supported_platforms=frozenset({"binance"}),
5252
components=(
5353
StrategyComponentDefinition(
5454
name="core",
55-
module_path="crypto_strategies.strategies.crypto_leader_rotation.core",
55+
module_path="crypto_strategies.strategies.crypto_live_pool_rotation.core",
5656
),
5757
StrategyComponentDefinition(
5858
name="rotation",
59-
module_path="crypto_strategies.strategies.crypto_leader_rotation.rotation",
59+
module_path="crypto_strategies.strategies.crypto_live_pool_rotation.rotation",
6060
),
6161
),
6262
entrypoint=StrategyEntrypointDefinition(
6363
module_path="crypto_strategies.entrypoints",
64-
attribute_name="crypto_leader_rotation_entrypoint",
64+
attribute_name="crypto_live_pool_rotation_entrypoint",
6565
),
6666
required_inputs=CRYPTO_CANONICAL_REQUIRED_INPUTS,
67-
default_config=CRYPTO_LEADER_ROTATION_DEFAULT_CONFIG,
68-
target_mode=STRATEGY_TARGET_MODES[CRYPTO_LEADER_ROTATION_PROFILE],
67+
default_config=CRYPTO_LIVE_POOL_ROTATION_DEFAULT_CONFIG,
68+
target_mode=STRATEGY_TARGET_MODES[CRYPTO_LIVE_POOL_ROTATION_PROFILE],
6969
),
7070
}
7171

7272
STRATEGY_METADATA: dict[str, StrategyMetadata] = {
73-
CRYPTO_LEADER_ROTATION_PROFILE: StrategyMetadata(
74-
canonical_profile=CRYPTO_LEADER_ROTATION_PROFILE,
75-
display_name="Crypto Leader Rotation",
73+
CRYPTO_LIVE_POOL_ROTATION_PROFILE: StrategyMetadata(
74+
canonical_profile=CRYPTO_LIVE_POOL_ROTATION_PROFILE,
75+
display_name="Crypto Live Pool Rotation",
7676
description="Trend-following crypto rotation with staged entries, degradation controls, and cash parking.",
7777
aliases=(),
7878
cadence="daily",

src/crypto_strategies/entrypoints/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
StrategyDecision,
1212
)
1313

14-
from crypto_strategies.manifests import crypto_leader_rotation_manifest
14+
from crypto_strategies.manifests import crypto_live_pool_rotation_manifest
1515

1616

1717
"""Unified crypto strategy entrypoints built on top of legacy core/rotation modules."""
1818

1919

2020
def _merge_runtime_config(ctx: StrategyContext) -> dict[str, object]:
21-
config = dict(crypto_leader_rotation_manifest.default_config)
21+
config = dict(crypto_live_pool_rotation_manifest.default_config)
2222
config.update(dict(ctx.runtime_config))
2323
return config
2424

@@ -110,13 +110,13 @@ def _set_symbol_trade_state(state, symbol, symbol_state):
110110

111111

112112
def _load_legacy_modules():
113-
from crypto_strategies.strategies.crypto_leader_rotation import core as legacy_core
114-
from crypto_strategies.strategies.crypto_leader_rotation import rotation as legacy_rotation
113+
from crypto_strategies.strategies.crypto_live_pool_rotation import core as legacy_core
114+
from crypto_strategies.strategies.crypto_live_pool_rotation import rotation as legacy_rotation
115115

116116
return legacy_core, legacy_rotation
117117

118118

119-
def evaluate_crypto_leader_rotation(ctx: StrategyContext) -> StrategyDecision:
119+
def evaluate_crypto_live_pool_rotation(ctx: StrategyContext) -> StrategyDecision:
120120
legacy_core, legacy_rotation = _load_legacy_modules()
121121
config = _merge_runtime_config(ctx)
122122
prices = _require_market_data(ctx, "market_prices")
@@ -256,10 +256,10 @@ def evaluate_crypto_leader_rotation(ctx: StrategyContext) -> StrategyDecision:
256256
)
257257

258258

259-
crypto_leader_rotation_entrypoint = CallableStrategyEntrypoint(
260-
manifest=crypto_leader_rotation_manifest,
261-
_evaluate=evaluate_crypto_leader_rotation,
259+
crypto_live_pool_rotation_entrypoint = CallableStrategyEntrypoint(
260+
manifest=crypto_live_pool_rotation_manifest,
261+
_evaluate=evaluate_crypto_live_pool_rotation,
262262
)
263263

264264

265-
__all__ = ["crypto_leader_rotation_entrypoint", "evaluate_crypto_leader_rotation"]
265+
__all__ = ["crypto_live_pool_rotation_entrypoint", "evaluate_crypto_live_pool_rotation"]

src/crypto_strategies/manifests/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from quant_platform_kit.strategy_contracts import StrategyManifest
44

55

6-
crypto_leader_rotation_manifest = StrategyManifest(
7-
profile="crypto_leader_rotation",
6+
crypto_live_pool_rotation_manifest = StrategyManifest(
7+
profile="crypto_live_pool_rotation",
88
domain="crypto",
9-
display_name="Crypto Leader Rotation",
9+
display_name="Crypto Live Pool Rotation",
1010
description="Trend-following crypto rotation with staged entries, degradation controls, and cash parking.",
1111
required_inputs=frozenset(
1212
{
@@ -26,17 +26,17 @@
2626
"weight_mode": "inverse_vol",
2727
"allow_rotation_refresh": True,
2828
"atr_multiplier": 2.5,
29-
"artifact_contract_version": "crypto_leader_rotation.live_pool.v1",
29+
"artifact_contract_version": "crypto_live_pool_rotation.live_pool.v1",
3030
"artifact_max_age_days": 45,
3131
"artifact_acceptable_modes": ("core_major",),
3232
},
3333
)
3434

35-
MANIFESTS = {crypto_leader_rotation_manifest.profile: crypto_leader_rotation_manifest}
35+
MANIFESTS = {crypto_live_pool_rotation_manifest.profile: crypto_live_pool_rotation_manifest}
3636

3737

3838
def get_strategy_manifest(profile: str) -> StrategyManifest:
3939
return MANIFESTS[profile]
4040

4141

42-
__all__ = ["MANIFESTS", "crypto_leader_rotation_manifest", "get_strategy_manifest"]
42+
__all__ = ["MANIFESTS", "crypto_live_pool_rotation_manifest", "get_strategy_manifest"]

src/crypto_strategies/runtime_adapters.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@
2424
)
2525

2626

27-
CRYPTO_LEADER_ROTATION_ARTIFACT_CONTRACT = StrategyArtifactContract(
27+
CRYPTO_LIVE_POOL_ROTATION_ARTIFACT_CONTRACT = StrategyArtifactContract(
2828
requires_snapshot_artifacts=True,
2929
requires_snapshot_manifest_path=True,
3030
requires_strategy_config_path=False,
31-
snapshot_contract_version="crypto_leader_rotation.live_pool.v1",
31+
snapshot_contract_version="crypto_live_pool_rotation.live_pool.v1",
3232
config_source_policy="none",
3333
)
3434

3535

3636
PLATFORM_RUNTIME_ADAPTERS: dict[str, dict[str, StrategyRuntimeAdapter]] = {
3737
BINANCE_PLATFORM: {
38-
"crypto_leader_rotation": StrategyRuntimeAdapter(
38+
"crypto_live_pool_rotation": StrategyRuntimeAdapter(
3939
status_icon="🪙",
4040
available_inputs=CRYPTO_CANONICAL_REQUIRED_INPUTS,
4141
portfolio_input_name="portfolio_snapshot",
42-
artifact_contract=CRYPTO_LEADER_ROTATION_ARTIFACT_CONTRACT,
42+
artifact_contract=CRYPTO_LIVE_POOL_ROTATION_ARTIFACT_CONTRACT,
4343
),
4444
}
4545
}
@@ -66,7 +66,7 @@ def get_platform_runtime_adapter(profile: str | None, *, platform_id: str) -> St
6666
__all__ = [
6767
"BINANCE_PLATFORM",
6868
"CRYPTO_CANONICAL_REQUIRED_INPUTS",
69-
"CRYPTO_LEADER_ROTATION_ARTIFACT_CONTRACT",
69+
"CRYPTO_LIVE_POOL_ROTATION_ARTIFACT_CONTRACT",
7070
"PLATFORM_RUNTIME_ADAPTERS",
7171
"get_platform_runtime_adapter",
7272
"resolve_canonical_profile",

src/crypto_strategies/strategies/crypto_leader_rotation/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Crypto live pool rotation strategy package."""

0 commit comments

Comments
 (0)