Skip to main content

nautilus_polymarket/common/
urls.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! URL resolution for the Polymarket API endpoints.
17
18const CLOB_HTTP_URL: &str = "https://clob.polymarket.com";
19const CLOB_WS_URL: &str = "wss://ws-subscriptions-clob.polymarket.com/ws";
20const CLOB_WS_MARKET_URL: &str = "wss://ws-subscriptions-clob.polymarket.com/ws/market";
21const CLOB_WS_USER_URL: &str = "wss://ws-subscriptions-clob.polymarket.com/ws/user";
22const GAMMA_API_URL: &str = "https://gamma-api.polymarket.com";
23const RTDS_WS_URL: &str = "wss://ws-live-data.polymarket.com";
24
25#[must_use]
26pub const fn clob_http_url() -> &'static str {
27    CLOB_HTTP_URL
28}
29
30#[must_use]
31pub const fn clob_ws_url() -> &'static str {
32    CLOB_WS_URL
33}
34
35#[must_use]
36pub const fn clob_ws_market_url() -> &'static str {
37    CLOB_WS_MARKET_URL
38}
39
40#[must_use]
41pub const fn clob_ws_user_url() -> &'static str {
42    CLOB_WS_USER_URL
43}
44
45#[must_use]
46pub const fn gamma_api_url() -> &'static str {
47    GAMMA_API_URL
48}
49
50#[must_use]
51pub const fn rtds_ws_url() -> &'static str {
52    RTDS_WS_URL
53}