{"record":{"id":"a51a74b138c49c86","repo":"HKUDS/Vibe-Trading","slug":"feed-must-be-iex-or-sip","errorCode":null,"errorMessage":"feed must be 'iex' or 'sip'","messagePattern":"feed must be 'iex' or 'sip'","errorType":"validation","errorClass":"AlpacaConfigError","httpStatus":null,"severity":"error","filePath":"agent/src/trading/connectors/alpaca/sdk.py","lineNumber":96,"sourceCode":"    \"\"\"\n\n    api_key: str = \"\"\n    secret_key: str = \"\"\n    profile: str = \"paper\"\n    feed: str = \"iex\"\n    timeout: float = 15.0\n    readonly: bool = True\n\n    @classmethod\n    def from_mapping(cls, data: Mapping[str, Any] | None = None) -> \"AlpacaConfig\":\n        \"\"\"Build a config from a JSON-like mapping, normalizing the profile.\"\"\"\n        payload = dict(data or {})\n        profile = str(payload.get(\"profile\") or \"paper\").strip().lower()\n        if profile not in PROFILE_ENVIRONMENTS:\n            raise AlpacaConfigError(\"profile must be 'paper', 'live-readonly' or 'live'\")\n        feed = str(payload.get(\"feed\") or \"iex\").strip().lower()\n        if feed not in (\"iex\", \"sip\"):\n            raise AlpacaConfigError(\"feed must be 'iex' or 'sip'\")\n        return cls(\n            api_key=str(payload.get(\"api_key\") or \"\").strip(),\n            secret_key=str(payload.get(\"secret_key\") or \"\").strip(),\n            profile=profile,\n            feed=feed,\n            timeout=float(payload.get(\"timeout\") or 15.0),\n            readonly=bool(payload.get(\"readonly\", True)),\n        )\n\n    def with_overrides(\n        self,\n        *,\n        api_key: str | None = None,\n        secret_key: str | None = None,\n        profile: str | None = None,\n        feed: str | None = None,\n    ) -> \"AlpacaConfig\":\n        \"\"\"Return a copy with CLI/tool overrides applied.\"\"\"","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/trading/connectors/alpaca/sdk.py#L78-L114","documentation":"Thrown by AlpacaConfig.from_mapping when the normalized 'feed' key is not 'iex' or 'sip' (default is 'iex'). The feed selects which market-data stream Alpaca serves; IEX is free/default while SIP requires a paid subscription, so unknown feeds are rejected at config-build time.","triggerScenarios":"Passing a mapping with feed set to e.g. 'SIP ' works (lowercased/trimmed) but 'sip-pro', 'otc', 'cts', or 'full' raises. Hit via load_config from a JSON file, build_config overrides, or with_overrides.","commonSituations":"Copying feed names from other broker APIs; assuming a paid-tier name like 'nasdaq-totalview' is supported; typos like 'ix' or 'siep'; stale docs from an older SDK version listing other feeds.","solutions":["Set feed to 'iex' or remove it to use the free default","Set feed to 'sip' only if your Alpaca subscription includes SIP data","Double-check spelling — values are lowercased and trimmed, but must match exactly","Re-run after fixing the JSON config file that load_config reads"],"exampleFix":"// before\n{\"profile\": \"paper\", \"feed\": \"nasdaq\"}\n\n// after\n{\"profile\": \"paper\", \"feed\": \"iex\"}","handlingStrategy":"validation","validationCode":"VALID_FEEDS = {\"iex\", \"sip\"}\nfeed = str(cfg.get(\"feed\") or \"iex\").strip().lower()\nif feed not in VALID_FEEDS:\n    raise ValueError(f\"unknown feed {feed!r}; expected 'iex' or 'sip'\")","typeGuard":"def is_valid_alpaca_feed(value: object) -> bool:\n    return isinstance(value, str) and value.strip().lower() in {\"iex\", \"sip\"}","tryCatchPattern":"try:\n    config = AlpacaConfig.from_mapping(data)\nexcept AlpacaConfigError as exc:\n    if \"feed must be\" in str(exc):\n        data[\"feed\"] = \"iex\"\n        config = AlpacaConfig.from_mapping(data)\n    else:\n        raise","preventionTips":["Default to omitting feed (iex) unless you have a SIP subscription","Restrict feed to a dropdown in settings UIs","Add a config-file lint step that runs from_mapping on load in CI"],"tags":["python","alpaca","market-data","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}