Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions core/src/exchanges/limitless/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export class LimitlessWebSocket {
await this.client.connect();
}

// Subscribe to market
await this.client.subscribe('orderbook', { marketSlugs: [marketSlug] });
// Subscribe to market orderbook updates through the SDK market-price channel.
await this.client.subscribe('subscribe_market_prices', { marketSlugs: [marketSlug] });

if (callback) {
this.orderbookCallbacks.set(marketSlug, callback);
Expand Down Expand Up @@ -210,7 +210,7 @@ export class LimitlessWebSocket {
}

// Subscribe to market prices
await this.client.subscribe('prices', { marketAddresses: [marketAddress] });
await this.client.subscribe('subscribe_market_prices', { marketAddresses: [marketAddress] });

this.priceCallbacks.set(marketAddress, callback);
}
Expand All @@ -228,11 +228,7 @@ export class LimitlessWebSocket {
await this.client.connect();
}

await this.client.subscribe('orders'); // SDK uses 'orders' channel for user positional updates too?
// Actually, the channel type has 'subscribe_positions'. Let's check.
// Wait, I saw 'orders' in SubscriptionChannel.
// Let's use 'orders' as it's common for user data.
// Wait, I saw 'subscribe_positions' in the type.
await this.client.subscribe('subscribe_order_events');
await this.client.subscribe('subscribe_positions' as any);
this.client.on('positions', callback);
}
Expand Down Expand Up @@ -272,11 +268,12 @@ export class LimitlessWebSocket {
this.orderbookCallbacks.delete(marketSlugOrAddress);
this.priceCallbacks.delete(marketSlugOrAddress);

// Unsubscribe from SDK
await this.client.unsubscribe('orderbook', {
// The current SDK only exposes explicit unsubscribe lifecycle channels;
// cast market-price unsubscribe channels until the SDK publishes them.
await this.client.unsubscribe('subscribe_market_prices' as any, {
marketSlugs: [marketSlugOrAddress],
});
await this.client.unsubscribe('prices', {
await this.client.unsubscribe('subscribe_market_prices' as any, {
marketAddresses: [marketSlugOrAddress],
});
}
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/openapi-hosted.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "PMXT Hosted Router API",
"description": "Hosted-only endpoints for cross-venue search, matching, arbitrage, and SQL.",
"version": "bfa6308"
"version": "49fbcd4"
},
"servers": [
{
Expand Down
48 changes: 36 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"dependencies": {
"@types/cli-progress": "^3.11.6",
"cli-progress": "^3.12.0",
"pmxtjs": "^2.17.1"
"pmxtjs": "^2.17.1",
"viem": "2.48.4"
},
"overrides": {
"viem": "2.48.4"
}
}
Loading