Skip to content

Commit 7a5273b

Browse files
committed
Add Hyperliquid instrument unsubscribe handling
- Treat instrument unsubscribes as no-ops for cached-only data - Document the Sockudo transport default in Hyperliquid configs
1 parent 01c8f6e commit 7a5273b

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

crates/adapters/hyperliquid/src/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ pub struct HyperliquidDataClientConfig {
5858
/// Interval for refreshing instruments in minutes.
5959
#[builder(default = 60)]
6060
pub update_instruments_interval_mins: u64,
61-
/// WebSocket transport backend (defaults to `Tungstenite`).
61+
/// WebSocket transport backend (`Sockudo` by default; `Tungstenite` when
62+
/// the `transport-sockudo` feature is disabled).
6263
#[builder(default)]
6364
pub transport_backend: TransportBackend,
6465
}
@@ -170,7 +171,8 @@ pub struct HyperliquidExecClientConfig {
170171
/// If true, attach Nautilus builder attribution to eligible mainnet orders.
171172
#[builder(default = true)]
172173
pub include_builder_attribution: bool,
173-
/// WebSocket transport backend (defaults to `Tungstenite`).
174+
/// WebSocket transport backend (`Sockudo` by default; `Tungstenite` when
175+
/// the `transport-sockudo` feature is disabled).
174176
#[builder(default)]
175177
pub transport_backend: TransportBackend,
176178
/// Timeout in seconds for WebSocket post trading requests.

crates/adapters/hyperliquid/src/data.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ use nautilus_common::{
3838
SubscribeIndexPrices, SubscribeInstrument, SubscribeMarkPrices, SubscribeQuotes,
3939
SubscribeTrades, TradesResponse, UnsubscribeBars, UnsubscribeBookDeltas,
4040
UnsubscribeBookDepth10, UnsubscribeCustomData, UnsubscribeFundingRates,
41-
UnsubscribeIndexPrices, UnsubscribeMarkPrices, UnsubscribeQuotes, UnsubscribeTrades,
41+
UnsubscribeIndexPrices, UnsubscribeInstrument, UnsubscribeInstruments,
42+
UnsubscribeMarkPrices, UnsubscribeQuotes, UnsubscribeTrades,
4243
},
4344
},
4445
};
@@ -711,6 +712,18 @@ impl DataClient for HyperliquidDataClient {
711712
Ok(())
712713
}
713714

715+
fn unsubscribe_instrument(&mut self, _cmd: &UnsubscribeInstrument) -> anyhow::Result<()> {
716+
// `subscribe_instrument` only emits the cached instrument; it opens no
717+
// venue channel, so there is nothing to tear down here.
718+
Ok(())
719+
}
720+
721+
fn unsubscribe_instruments(&mut self, _cmd: &UnsubscribeInstruments) -> anyhow::Result<()> {
722+
// See `unsubscribe_instrument`: instrument subscriptions carry no
723+
// venue-side state to unsubscribe from.
724+
Ok(())
725+
}
726+
714727
fn unsubscribe_book_deltas(
715728
&mut self,
716729
unsubscription: &UnsubscribeBookDeltas,

0 commit comments

Comments
 (0)