@@ -551,8 +551,8 @@ class PortfolioView(BaseModel):
551551 ),
552552 )
553553 stop_prices : Dict [str , "StopPrice" ] = Field (
554- default_factory = list ,
555- description = "List of stop prices for existing positions and positions to open." ,
554+ default_factory = dict ,
555+ description = "Dictionary of stop prices for existing positions and positions to open." ,
556556 )
557557
558558
@@ -592,7 +592,6 @@ def derive_side_from_action(
592592
593593
594594class StopPrice (BaseModel ):
595- symbol : str = Field (..., description = "Exchange symbol, e.g., BTC/USDT" )
596595 stop_gain_price : Optional [float ] = Field (
597596 ...,
598597 description = "Stop gain price for this position." ,
@@ -657,9 +656,9 @@ class TradePlanProposal(BaseModel):
657656 rationale : Optional [str ] = Field (
658657 default = None , description = "Optional natural language rationale"
659658 )
660- stop_prices : List [ StopPrice ] = Field (
661- default_factory = list ,
662- description = "List of stop prices for existing positions and positions to open. " ,
659+ stop_prices : Dict [ str , StopPrice ] = Field (
660+ default_factory = dict ,
661+ description = "Map of ticker symbols to their respective stop prices " ,
663662 )
664663
665664
@@ -931,6 +930,10 @@ class StrategySummary(BaseModel):
931930 default = None ,
932931 description = "Total portfolio value (equity) including cash and positions" ,
933932 )
933+ stop_prices : Dict [str , StopPrice ] = Field (
934+ default_factory = dict ,
935+ description = "Map of ticker symbols to their respective stop prices" ,
936+ )
934937 last_updated_ts : Optional [int ] = Field (default = None )
935938
936939
@@ -954,7 +957,7 @@ class ComposeResult(BaseModel):
954957
955958 instructions : List [TradeInstruction ]
956959 rationale : Optional [str ] = None
957- stop_prices : List [ StopPrice ] = []
960+ stop_prices : Dict [ str , StopPrice ] = {}
958961
959962
960963class FeaturesPipelineResult (BaseModel ):
@@ -977,4 +980,3 @@ class DecisionCycleResult:
977980 history_records : List [HistoryRecord ]
978981 digest : TradeDigest
979982 portfolio_view : PortfolioView
980- stop_prices : List [StopPrice ]
0 commit comments