Opus finding
redemption_price_per_share crashes when market_payload is None
mediumbughigh
- agent/settlement.py:44-50
fetch_clob_market_payload can return None (on 404, network error, or non-dict body). redemption_price_per_share takes a `dict` but does not guard against None being passed; calling .get on None raises AttributeError. Callers naturally compose `redemption_price_per_share(fetch_clob_market_payload(cid), token)` and will hit this whenever the fetch fails or the market is missing.
Recommendation
Guard early: `if not market_payload: return None` or change the parameter type to `dict | None` and handle None explicitly.