{"record":{"id":"68435032b3014dcd","repo":"nautechsystems/nautilus_trader","slug":"coinbase-advanced-trade-does-not-publish-mark-pric","errorCode":null,"errorMessage":"Coinbase Advanced Trade does not publish mark prices; cannot subscribe for {} (cmd.instrument_id)","messagePattern":"Coinbase Advanced Trade does not publish mark prices; cannot subscribe for (.+?) \\(cmd\\.instrument_id\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/coinbase/src/data/mod.rs","lineNumber":607,"sourceCode":"        self.spawn_command(async move {\n            if let Err(e) = ws\n                .subscribe(CoinbaseWsChannel::MarketTrades, &[wire_id])\n                .await\n            {\n                log::error!(\"Failed to subscribe to trades: {e:?}\");\n            }\n        });\n\n        Ok(())\n    }\n\n    fn subscribe_mark_prices(&mut self, cmd: SubscribeMarkPrices) -> anyhow::Result<()> {\n        // Coinbase Advanced Trade does not publish a live mark price for its\n        // perpetuals on either WS or REST. `settlement_price` is the prior\n        // daily settlement and drifts from the live index, so synthesizing a\n        // mark from it would be misleading. Reject explicitly so callers\n        // failing this subscription know why.\n        anyhow::bail!(\n            \"Coinbase Advanced Trade does not publish mark prices; \\\n             cannot subscribe for {}\",\n            cmd.instrument_id\n        )\n    }\n\n    fn subscribe_index_prices(&mut self, cmd: SubscribeIndexPrices) -> anyhow::Result<()> {\n        self.deriv_polls.subscribe_index(cmd.instrument_id);\n        Ok(())\n    }\n\n    fn subscribe_funding_rates(&mut self, cmd: SubscribeFundingRates) -> anyhow::Result<()> {\n        self.deriv_polls.subscribe_funding(cmd.instrument_id);\n        Ok(())\n    }\n\n    fn subscribe_instrument_status(\n        &mut self,","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/coinbase/src/data/mod.rs#L589-L625","documentation":"Coinbase Advanced Trade publishes no live mark price for its perpetuals on WebSocket or REST; the settlement_price field is the prior daily settlement and diverges from a live index. subscribe_mark_prices therefore rejects all mark-price subscriptions explicitly rather than returning misleading synthesized data.","triggerScenarios":"Calling subscribe_mark_prices on the Coinbase execution/data client for any instrument_id, typically for CFM perpetual products.","commonSituations":"Running a funding/mark-price-dependent strategy on Coinbase perps after porting from Binance/Bybit; a generic risk module that subscribes to mark prices on every venue.","solutions":["Do not subscribe to mark prices on Coinbase; compute marks from mid/last trade prices locally","Disable mark-price subscriptions for this venue in your strategy/config","If a mark is required, approximate it from the order book mid and document the drift risk","File or track an upstream request for Coinbase to publish a live mark price"],"exampleFix":"// before\nclient.subscribe_mark_prices(mark_cmd)?; // always fails on Coinbase\n\n// after\nif client.is_coinbase() {\n    // derive mark from book mid instead\n    let mark = book.best_bid_price.midpoint(book.best_ask_price);\n} else {\n    client.subscribe_mark_prices(mark_cmd)?;\n}","handlingStrategy":"fallback","validationCode":"// skip mark-price subscriptions on Coinbase\nlet supports_marks = !matches!(venue, Venue::Coinbase(_));","typeGuard":null,"tryCatchPattern":"match client.subscribe_mark_prices(cmd).await {\n    Err(e) if e.to_string().contains(\"does not publish mark prices\") => {\n        // fall back to book-mid mark estimation\n    }\n    other => other?,\n}","preventionTips":["Maintain a venue capability matrix (mark price support: Coinbase = no)","Compute marks from book mid or last trade on venues without a mark feed","Gate mark-price subscriptions behind venue checks in risk modules","Do not synthesize marks from settlement_price — it drifts from the live index"],"tags":["mark-price","unsupported-operation","perpetuals","rust"],"backgroundTag":"operation-not-supported","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}