programgarden-core 1.28.3__tar.gz → 1.30.0__tar.gz

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.
Files changed (85) hide show
  1. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/PKG-INFO +9 -1
  2. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/README.md +8 -0
  3. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/__init__.py +1 -0
  4. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/i18n/locales/en.json +16 -1
  5. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/i18n/locales/ko.json +16 -1
  6. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/workflow.py +39 -1
  7. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/__init__.py +2 -0
  8. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/broker.py +4 -3
  9. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/data_futures.py +9 -3
  10. programgarden_core-1.30.0/programgarden_core/nodes/orderable_quantity_futures.py +60 -0
  11. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/registry/node_registry.py +2 -2
  12. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/pyproject.toml +1 -1
  13. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/__init__.py +0 -0
  14. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/client.py +0 -0
  15. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/components.py +0 -0
  16. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/listener.py +0 -0
  17. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/mixins.py +0 -0
  18. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/products.py +0 -0
  19. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/sql.py +0 -0
  20. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/bases/storage.py +0 -0
  21. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/code_node.py +0 -0
  22. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/exceptions.py +0 -0
  23. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/expression/__init__.py +0 -0
  24. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/expression/evaluator.py +0 -0
  25. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/i18n/__init__.py +0 -0
  26. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/i18n/translator.py +0 -0
  27. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/korea_alias.py +0 -0
  28. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/__init__.py +0 -0
  29. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/connection_rule.py +0 -0
  30. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/credential.py +0 -0
  31. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/edge.py +0 -0
  32. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/event.py +0 -0
  33. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/exchange.py +0 -0
  34. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/field_binding.py +0 -0
  35. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/job.py +0 -0
  36. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/order_diagnostics.py +0 -0
  37. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/plugin_resource.py +0 -0
  38. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/resilience.py +0 -0
  39. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/resource.py +0 -0
  40. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/models/validation.py +0 -0
  41. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/account_futures.py +0 -0
  42. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/account_korea_stock.py +0 -0
  43. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/account_stock.py +0 -0
  44. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/ai.py +0 -0
  45. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/backtest.py +0 -0
  46. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/backtest_futures.py +0 -0
  47. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/backtest_korea_stock.py +0 -0
  48. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/backtest_stock.py +0 -0
  49. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/base.py +0 -0
  50. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/calculation.py +0 -0
  51. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/code.py +0 -0
  52. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/condition.py +0 -0
  53. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/data.py +0 -0
  54. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/data_korea_stock.py +0 -0
  55. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/data_stock.py +0 -0
  56. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/display.py +0 -0
  57. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/event.py +0 -0
  58. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/fundamental_korea_stock.py +0 -0
  59. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/fundamental_stock.py +0 -0
  60. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/infra.py +0 -0
  61. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/market_external.py +0 -0
  62. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/market_status.py +0 -0
  63. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/open_orders_futures.py +0 -0
  64. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/open_orders_korea_stock.py +0 -0
  65. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/open_orders_stock.py +0 -0
  66. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/order.py +0 -0
  67. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/portfolio.py +0 -0
  68. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/realtime_futures.py +0 -0
  69. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/realtime_korea_stock.py +0 -0
  70. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/realtime_stock.py +0 -0
  71. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/risk.py +0 -0
  72. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/symbol.py +0 -0
  73. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/symbol_futures.py +0 -0
  74. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/symbol_korea_stock.py +0 -0
  75. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/symbol_stock.py +0 -0
  76. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/nodes/trigger.py +0 -0
  77. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/presets/__init__.py +0 -0
  78. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/presets/news_analyst.json +0 -0
  79. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/presets/risk_manager.json +0 -0
  80. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/presets/strategist.json +0 -0
  81. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/presets/technical_analyst.json +0 -0
  82. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/registry/__init__.py +0 -0
  83. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/registry/credential_registry.py +0 -0
  84. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/registry/plugin_registry.py +0 -0
  85. {programgarden_core-1.28.3 → programgarden_core-1.30.0}/programgarden_core/retry_executor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: programgarden-core
3
- Version: 1.28.3
3
+ Version: 1.30.0
4
4
  Summary: ProgramGarden Core - 노드 기반 DSL 핵심 타입 정의
5
5
  License-Expression: AGPL-3.0-or-later
6
6
  Author: 프로그램동산
@@ -123,3 +123,11 @@ unknown currency stays null. Futures monetary values and portfolio MDD require
123
123
  accounting evidence absent from this ledger and remain null. Consumers must
124
124
  preserve null/status and use the latest cumulative observation, not sum dates.
125
125
 
126
+ ## Workflow account boundary
127
+
128
+ Each workflow allows one account and one product through at most one broker
129
+ connection. Additional connections produce `DUPLICATE_BROKER_NODE`, including
130
+ unbound or cross-product nodes. Reuse one broker for all consumers. Account-free
131
+ workflows and unrelated credentials remain supported. See
132
+ [the shared contract](../../docs/workflow_account_policy.md).
133
+
@@ -107,3 +107,11 @@ Stock realized amounts are stored long-only FIFO gross values excluding fees;
107
107
  unknown currency stays null. Futures monetary values and portfolio MDD require
108
108
  accounting evidence absent from this ledger and remain null. Consumers must
109
109
  preserve null/status and use the latest cumulative observation, not sum dates.
110
+
111
+ ## Workflow account boundary
112
+
113
+ Each workflow allows one account and one product through at most one broker
114
+ connection. Additional connections produce `DUPLICATE_BROKER_NODE`, including
115
+ unbound or cross-product nodes. Reuse one broker for all consumers. Account-free
116
+ workflows and unrelated credentials remain supported. See
117
+ [the shared contract](../../docs/workflow_account_policy.md).
@@ -44,6 +44,7 @@ __all__ = [
44
44
  # Nodes - Broker (상품별 분리)
45
45
  "OverseasStockBrokerNode",
46
46
  "OverseasFuturesBrokerNode",
47
+ "OverseasFuturesOrderableQuantityNode",
47
48
  "KoreaStockBrokerNode",
48
49
  # Nodes - Market (해외주식)
49
50
  "OverseasStockMarketDataNode",
@@ -1329,5 +1329,20 @@
1329
1329
  "fieldNames.FuturesContractNode.futures_exchange": "Exchange",
1330
1330
  "enums.contract_selection.front": "Front month (nearest expiry)",
1331
1331
  "enums.contract_selection.next": "Next month (roll target)",
1332
- "enums.contract_selection.quarterly": "Quarterly (Mar/Jun/Sep/Dec)"
1332
+ "enums.contract_selection.quarterly": "Quarterly (Mar/Jun/Sep/Dec)",
1333
+ "nodes.OverseasFuturesOrderableQuantityNode.name": "Futures Orderable Quantity",
1334
+ "nodes.OverseasFuturesOrderableQuantityNode.description": "Reads contract-specific orderable quantity from the connected futures account. No order is submitted. Require verified=true and sufficient quantity before entry.",
1335
+ "fieldNames.OverseasFuturesOrderableQuantityNode.symbol": "Contract",
1336
+ "fields.OverseasFuturesOrderableQuantityNode.symbol": "Current contract identity: symbol and exchange.",
1337
+ "fieldNames.OverseasFuturesOrderableQuantityNode.side": "Side",
1338
+ "fields.OverseasFuturesOrderableQuantityNode.side": "Direction of the intended order.",
1339
+ "fieldNames.OverseasFuturesOrderableQuantityNode.order_type": "Order Type",
1340
+ "fields.OverseasFuturesOrderableQuantityNode.order_type": "Limit or market order capacity.",
1341
+ "fieldNames.OverseasFuturesOrderableQuantityNode.price": "Order Price",
1342
+ "fields.OverseasFuturesOrderableQuantityNode.price": "Observed proposed limit price; market queries use zero.",
1343
+ "fieldNames.OverseasFuturesOrderableQuantityNode.query_type": "Query Type",
1344
+ "fields.OverseasFuturesOrderableQuantityNode.query_type": "New positions, liquidation or total capacity.",
1345
+ "enums.query_type.new": "New",
1346
+ "enums.query_type.close": "Liquidation",
1347
+ "enums.query_type.total": "Total"
1333
1348
  }
@@ -1329,5 +1329,20 @@
1329
1329
  "fieldNames.FuturesContractNode.futures_exchange": "거래소",
1330
1330
  "enums.contract_selection.front": "근월물 (만기 가장 가까움)",
1331
1331
  "enums.contract_selection.next": "차월물 (롤오버 대상)",
1332
- "enums.contract_selection.quarterly": "분기월물 (3·6·9·12월)"
1332
+ "enums.contract_selection.quarterly": "분기월물 (3·6·9·12월)",
1333
+ "nodes.OverseasFuturesOrderableQuantityNode.name": "해외선물 주문가능수량",
1334
+ "nodes.OverseasFuturesOrderableQuantityNode.description": "연결된 해외선물 계좌에서 해당 종목의 주문가능수량을 조회합니다. 주문은 제출하지 않으며, 확인 성공 여부와 가능 수량을 확인한 뒤 진입합니다.",
1335
+ "fieldNames.OverseasFuturesOrderableQuantityNode.symbol": "선물 종목",
1336
+ "fields.OverseasFuturesOrderableQuantityNode.symbol": "현재 거래할 선물 종목과 거래소입니다.",
1337
+ "fieldNames.OverseasFuturesOrderableQuantityNode.side": "매매 방향",
1338
+ "fields.OverseasFuturesOrderableQuantityNode.side": "주문할 매수·매도 방향입니다.",
1339
+ "fieldNames.OverseasFuturesOrderableQuantityNode.order_type": "주문 유형",
1340
+ "fields.OverseasFuturesOrderableQuantityNode.order_type": "지정가 또는 시장가 주문가능수량을 확인합니다.",
1341
+ "fieldNames.OverseasFuturesOrderableQuantityNode.price": "주문 가격",
1342
+ "fields.OverseasFuturesOrderableQuantityNode.price": "현재 시세로 확인한 지정가입니다. 시장가는 0으로 조회합니다.",
1343
+ "fieldNames.OverseasFuturesOrderableQuantityNode.query_type": "조회 구분",
1344
+ "fields.OverseasFuturesOrderableQuantityNode.query_type": "신규 진입·청산·총 주문가능수량 중 조회할 항목입니다.",
1345
+ "enums.query_type.new": "신규",
1346
+ "enums.query_type.close": "청산",
1347
+ "enums.query_type.total": "총가능"
1333
1348
  }
@@ -13,6 +13,44 @@ from programgarden_core.models.edge import Edge
13
13
  from programgarden_core.models.resource import ResourceLimits
14
14
 
15
15
 
16
+ def validate_broker_connections(nodes: List[Dict[str, Any]]) -> List["ErrorInfo"]:
17
+ """Allow at most one account/product connection, including unbound brokers.
18
+
19
+ Inspect registered connection ports so aliases and custom broker node types
20
+ use the same rule. Reusing one connection through multiple edges is allowed;
21
+ account-free workflows and unrelated credential types remain unaffected.
22
+ """
23
+ from programgarden_core.registry import NodeTypeRegistry
24
+ from programgarden_core.models.validation import ErrorCode, ErrorLocation, build_error
25
+
26
+ registry = NodeTypeRegistry()
27
+ brokers = []
28
+ for node in nodes:
29
+ schema = registry.get_schema(node.get("type"))
30
+ if schema and any(port.get("type") == "broker_connection" for port in schema.outputs):
31
+ brokers.append(node)
32
+ if len(brokers) <= 1:
33
+ return []
34
+
35
+ broker_ids = [node.get("id") for node in brokers]
36
+ return [
37
+ build_error(
38
+ ErrorCode.DUPLICATE_BROKER_NODE,
39
+ "Duplicate broker connection: a workflow allows only one account and one product",
40
+ location=ErrorLocation(node_id=node.get("id"), node_type=node.get("type")),
41
+ suggestion=(
42
+ "Reuse the existing broker node for every consumer. Create a separate "
43
+ "workflow for another account or product; do not add another broker."
44
+ ),
45
+ details={
46
+ "existing": broker_ids[0], "duplicate": node.get("id"),
47
+ "broker_node_ids": broker_ids, "max_broker_connections": 1,
48
+ },
49
+ )
50
+ for node in brokers[1:]
51
+ ]
52
+
53
+
16
54
  class InputType(str, Enum):
17
55
  """워크플로우 입력 타입"""
18
56
 
@@ -220,7 +258,7 @@ class WorkflowDefinition(BaseModel):
220
258
  build_error,
221
259
  )
222
260
 
223
- errors: List[ErrorInfo] = []
261
+ errors: List[ErrorInfo] = validate_broker_connections(self.nodes)
224
262
 
225
263
  # 1. Duplicate node IDs
226
264
  node_ids = self.get_node_ids()
@@ -44,6 +44,7 @@ from programgarden_core.nodes.account_stock import OverseasStockAccountNode
44
44
  from programgarden_core.nodes.account_futures import OverseasFuturesAccountNode
45
45
  from programgarden_core.nodes.open_orders_stock import OverseasStockOpenOrdersNode
46
46
  from programgarden_core.nodes.open_orders_futures import OverseasFuturesOpenOrdersNode
47
+ from programgarden_core.nodes.orderable_quantity_futures import OverseasFuturesOrderableQuantityNode
47
48
  from programgarden_core.nodes.symbol_stock import OverseasStockSymbolQueryNode
48
49
  from programgarden_core.nodes.symbol_futures import OverseasFuturesSymbolQueryNode, FuturesContractNode
49
50
  # Data (상품 무관)
@@ -144,6 +145,7 @@ __all__ = [
144
145
  # Open Orders (미체결 주문 조회)
145
146
  "OverseasStockOpenOrdersNode",
146
147
  "OverseasFuturesOpenOrdersNode",
148
+ "OverseasFuturesOrderableQuantityNode",
147
149
  # Data (상품 무관)
148
150
  "SQLiteNode",
149
151
  "HTTPRequestNode",
@@ -111,7 +111,7 @@ class OverseasStockBrokerNode(BaseBrokerNode):
111
111
  {
112
112
  "pattern": "Wiring a single broker across overseas_stock and overseas_futures nodes",
113
113
  "reason": "Product scope is a hard separator — overseas_futures nodes ignore stock-broker connections and the executor's auto-inject picks the wrong credential.",
114
- "alternative": "Add OverseasFuturesBrokerNode in parallel; each product scope's nodes pick up its matching broker automatically.",
114
+ "alternative": "Use a separate workflow for overseas futures. Each workflow allows only one account and one product; reuse its existing broker node.",
115
115
  },
116
116
  {
117
117
  "pattern": "Omitting OverseasStockBrokerNode when using overseas_stock nodes",
@@ -207,7 +207,7 @@ class OverseasStockBrokerNode(BaseBrokerNode):
207
207
  ],
208
208
  "pitfalls": [
209
209
  "paper_trading must be false — overseas_stock has no LS-Sec paper trading channel",
210
- "One workflow can have only one OverseasStockBrokerNode; duplicates compete for credential injection",
210
+ "A workflow allows at most one broker connection across all products and accounts, including unbound nodes; reuse that node for all consumers",
211
211
  "Credential type must be `broker_ls_overseas_stock` exactly; `broker_ls_overseas_futureoption` will not match",
212
212
  ],
213
213
  }
@@ -367,7 +367,7 @@ class OverseasFuturesBrokerNode(BaseBrokerNode):
367
367
  "pitfalls": [
368
368
  "Credential type must be `broker_ls_overseas_futureoption`",
369
369
  "paper_trading=True is not a full sandbox — some TRs still hit the real datafeed; always double-check order nodes before production",
370
- "Each workflow holds exactly one futures broker; if you also trade stocks, add OverseasStockBrokerNode in parallel",
370
+ "Use one account and one product per workflow. Trade stocks in a separate workflow instead of adding a second broker",
371
371
  ],
372
372
  }
373
373
 
@@ -547,6 +547,7 @@ class KoreaStockBrokerNode(BaseBrokerNode):
547
547
  ],
548
548
  "pitfalls": [
549
549
  "Credential type must be `broker_ls_korea_stock` — overseas credentials will not match even though the fields are identical",
550
+ "Use one account and one product per workflow; reuse this broker for every domestic consumer instead of adding a second connection",
550
551
  "Every live order counts — always gate order nodes behind IfNode or ConditionNode when experimenting",
551
552
  "Use `dry_run=True` in ExecutionContext for sandbox runs (paper trading is not available at the LS-Sec level)",
552
553
  ],
@@ -26,6 +26,11 @@ from programgarden_core.nodes.base import (
26
26
  )
27
27
 
28
28
 
29
+ FUTURES_REST_PRICE_FIELDS = OVERSEAS_FUTURES_PRICE_DATA_FIELDS + [
30
+ {"name": "tick_size", "type": "number", "description": "Observed o3105 UntPrc quotation increment; null if unavailable."},
31
+ ]
32
+
33
+
29
34
  class OverseasFuturesMarketDataNode(BaseNode):
30
35
  """
31
36
  해외선물 REST API 시세 조회 노드 (단일 종목)
@@ -80,7 +85,7 @@ class OverseasFuturesMarketDataNode(BaseNode):
80
85
  ],
81
86
  }
82
87
  _features: ClassVar[List[str]] = [
83
- "Returns a single futures contract's snapshot: symbol, exchange, symbol_name, price, change, change_pct, volume, open, high, low, close",
88
+ "Returns a futures contract snapshot including tick_size from observed o3105 UntPrc; missing tick size remains null",
84
89
  "Item-based execution: pair with SplitNode to query multiple contracts in sequence",
85
90
  "is_tool_enabled=True — AI Agent can call this node to look up live futures prices autonomously",
86
91
  "Supported exchanges: CME, EUREX, SGX, HKEX — symbol format includes contract month code (e.g., ESH26)",
@@ -168,6 +173,7 @@ class OverseasFuturesMarketDataNode(BaseNode):
168
173
  ),
169
174
  "output_consumption": (
170
175
  "Consume the `values` port ONLY — an array of {symbol, exchange, symbol_name, price, change, change_pct, volume, open, high, low, close}. "
176
+ "Each REST quote also includes tick_size from o3105 UntPrc; require a finite positive value before tick-dependent orders. "
171
177
  "⚠️ The `value` (singular) port is NOT populated at runtime — the executor emits `values` only; "
172
178
  "binding `{{ nodes.market.value }}` (or `.value.price`) silently resolves to None. "
173
179
  "TableDisplayNode.data ← `{{ nodes.market.values }}`; PositionSizingNode.market_data ← `{{ nodes.market.values }}`."
@@ -191,12 +197,12 @@ class OverseasFuturesMarketDataNode(BaseNode):
191
197
  ]
192
198
  _outputs: List[OutputPort] = [
193
199
  OutputPort(name="value", type="market_data", description="i18n:ports.market_data_value",
194
- fields=OVERSEAS_FUTURES_PRICE_DATA_FIELDS),
200
+ fields=FUTURES_REST_PRICE_FIELDS),
195
201
  OutputPort(
196
202
  name="values",
197
203
  type="array",
198
204
  description="Array of per-contract market quotes — [{symbol, exchange, price, change, change_pct, ...}, ...]",
199
- fields=OVERSEAS_FUTURES_PRICE_DATA_FIELDS,
205
+ fields=FUTURES_REST_PRICE_FIELDS,
200
206
  ),
201
207
  ]
202
208
 
@@ -0,0 +1,60 @@
1
+ """Read contract-specific futures order capacity without submitting an order."""
2
+ from typing import ClassVar, Dict, List, Literal, Optional
3
+
4
+ from pydantic import Field
5
+
6
+ from programgarden_core.nodes.base import BaseNode, BrokerProvider, InputPort, NodeCategory, OutputPort, ProductScope
7
+ from programgarden_core.models.field_binding import ExpressionMode, FieldCategory, FieldSchema, FieldType
8
+
9
+
10
+ class OverseasFuturesOrderableQuantityNode(BaseNode):
11
+ type: Literal["OverseasFuturesOrderableQuantityNode"] = "OverseasFuturesOrderableQuantityNode"
12
+ category: NodeCategory = NodeCategory.ACCOUNT
13
+ description: str = "i18n:nodes.OverseasFuturesOrderableQuantityNode.description"
14
+ _version: ClassVar[str] = "1.0.0"
15
+ _updated_at: ClassVar[str] = "2026-09-16"
16
+ _product_scope: ClassVar[ProductScope] = ProductScope.FUTURES
17
+ _broker_provider: ClassVar[BrokerProvider] = BrokerProvider.LS
18
+
19
+ symbol: Optional[Dict[str, str]] = Field(default=None, description="One current contract with symbol and exchange.")
20
+ side: Literal["buy", "sell"] = "buy"
21
+ order_type: Literal["limit", "market"] = "limit"
22
+ price: Optional[float] = Field(default=None, description="The intended limit order price; market queries use zero.")
23
+ query_type: Literal["new", "close", "total"] = "new"
24
+
25
+ _inputs: List[InputPort] = [InputPort(name="trigger", type="signal", required=False)]
26
+ _outputs: List[OutputPort] = [
27
+ OutputPort(name="quantity", type="number", description="Observed orderable contracts; null if unavailable."),
28
+ OutputPort(name="verified", type="boolean", description="True only for a complete matching broker response."),
29
+ OutputPort(name="error", type="string", description="Reason the quantity is unavailable; null for a valid zero or positive result."),
30
+ ]
31
+ _usage: ClassVar[dict] = {
32
+ "when_to_use": ["Check contract-specific capacity before a futures order; connect the current quote first."],
33
+ "when_not_to_use": ["Stock affordability, account performance, or proof of an accepted/filled order."],
34
+ "typical_scenarios": ["FuturesContractNode → market.values → matching quote → orderable quantity → entry guard → order."],
35
+ }
36
+ _features: ClassVar[list] = [
37
+ "Queries CIDBQ01400 using the actual contract, side, order type and price.",
38
+ "Uses the same broker account as the workflow; never submits an order.",
39
+ "Zero capacity is a normal result. Missing, partial or mismatched responses remain unavailable.",
40
+ "Deep validation uses an offline fixture and does not prove real account capacity.",
41
+ ]
42
+ _node_guide: ClassVar[dict] = {
43
+ "input_handling": "Bind symbol as a full {symbol, exchange} object from the runtime contract and price from the matching current quote. Put an ordering edge from every producer. Use query_type=new only for new positions, close for liquidation, total only when explicitly intended.",
44
+ "output_consumption": "Require verified=true and quantity >= the intended contract count. Also verify holdings, pending orders, price/tick validity and their identities. Never replace unknown capacity with zero or compare a quoted futures price to cash as a margin check.",
45
+ "pitfalls": ["Capacity is a snapshot, not a reservation or an order guarantee. ACK and actual fills require separate evidence."],
46
+ }
47
+
48
+ @classmethod
49
+ def is_tool_enabled(cls) -> bool:
50
+ return True
51
+
52
+ @classmethod
53
+ def get_field_schema(cls) -> Dict[str, FieldSchema]:
54
+ return {
55
+ "symbol": FieldSchema(name="symbol", type=FieldType.OBJECT, description="Current contract identity.", category=FieldCategory.PARAMETERS, expression_mode=ExpressionMode.BOTH, required=True, object_schema=[{"name":"symbol","type":"STRING","required":True},{"name":"exchange","type":"STRING","required":True}]),
56
+ "side": FieldSchema(name="side", type=FieldType.ENUM, enum_values=["buy","sell"], default="buy", category=FieldCategory.PARAMETERS, expression_mode=ExpressionMode.BOTH),
57
+ "order_type": FieldSchema(name="order_type", type=FieldType.ENUM, enum_values=["limit","market"], default="limit", category=FieldCategory.PARAMETERS, expression_mode=ExpressionMode.BOTH),
58
+ "price": FieldSchema(name="price", type=FieldType.NUMBER, description="Proposed order price in the contract's quotation units.", category=FieldCategory.PARAMETERS, expression_mode=ExpressionMode.BOTH),
59
+ "query_type": FieldSchema(name="query_type", type=FieldType.ENUM, enum_values=["new","close","total"], default="new", category=FieldCategory.PARAMETERS, expression_mode=ExpressionMode.BOTH),
60
+ }
@@ -164,7 +164,7 @@ class NodeTypeRegistry:
164
164
  # Account - Futures (해외선물)
165
165
  OverseasFuturesAccountNode, OverseasFuturesRealAccountNode, OverseasFuturesRealOrderEventNode,
166
166
  # Open Orders (미체결 조회)
167
- OverseasStockOpenOrdersNode, OverseasFuturesOpenOrdersNode,
167
+ OverseasStockOpenOrdersNode, OverseasFuturesOpenOrdersNode, OverseasFuturesOrderableQuantityNode,
168
168
  # Korea Stock (국내주식)
169
169
  KoreaStockBrokerNode,
170
170
  KoreaStockAccountNode, KoreaStockOpenOrdersNode,
@@ -212,7 +212,7 @@ class NodeTypeRegistry:
212
212
  # Account - Futures (해외선물)
213
213
  OverseasFuturesAccountNode, OverseasFuturesRealAccountNode, OverseasFuturesRealOrderEventNode,
214
214
  # Open Orders (미체결 조회)
215
- OverseasStockOpenOrdersNode, OverseasFuturesOpenOrdersNode,
215
+ OverseasStockOpenOrdersNode, OverseasFuturesOpenOrdersNode, OverseasFuturesOrderableQuantityNode,
216
216
  # Korea Stock (국내주식)
217
217
  KoreaStockBrokerNode,
218
218
  KoreaStockAccountNode, KoreaStockOpenOrdersNode,
@@ -5,7 +5,7 @@ authors = [
5
5
  homepage = "https://programgarden.com"
6
6
  requires-python = ">=3.12"
7
7
  name = "programgarden-core"
8
- version = "1.28.3"
8
+ version = "1.30.0"
9
9
  license = "AGPL-3.0-or-later"
10
10
  description = "ProgramGarden Core - 노드 기반 DSL 핵심 타입 정의"
11
11
  readme = "README.md"