diff --git a/README.md b/README.md index 41db44b..8406315 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ use polyfill_rs::{ClobClient, Side, OrderType}; #[tokio::main] async fn main() -> Result<(), Box> { - let client = ClobClient::new("https://clob-v2.polymarket.com"); + let client = ClobClient::new("https://clob.polymarket.com"); let markets = client.get_sampling_markets(None).await?; println!("Found {} markets", markets.data.len()); Ok(()) diff --git a/benches/network_benchmarks.rs b/benches/network_benchmarks.rs index c993a6e..a36f4db 100644 --- a/benches/network_benchmarks.rs +++ b/benches/network_benchmarks.rs @@ -11,7 +11,7 @@ fn benchmark_real_simplified_markets(c: &mut Criterion) { c.bench_function("real_fetch_simplified_markets", |b| { b.iter(|| { rt.block_on(async { - let client = ClobClient::new("https://clob-v2.polymarket.com"); + let client = ClobClient::new("https://clob.polymarket.com"); // This is the real network request + JSON parsing let result = client.get_sampling_simplified_markets(None).await; @@ -28,7 +28,7 @@ fn benchmark_real_markets(c: &mut Criterion) { c.bench_function("real_fetch_markets", |b| { b.iter(|| { rt.block_on(async { - let client = ClobClient::new("https://clob-v2.polymarket.com"); + let client = ClobClient::new("https://clob.polymarket.com"); // This is the real network request + JSON parsing let result = client.get_sampling_markets(None).await; @@ -52,7 +52,7 @@ fn benchmark_real_order_creation(c: &mut Criterion) { c.bench_function("real_create_order_eip712", |b| { b.iter(|| { rt.block_on(async { - let client = ClobClient::new("https://clob-v2.polymarket.com"); + let client = ClobClient::new("https://clob.polymarket.com"); // Set up credentials if let Ok(_key) = std::env::var("POLYMARKET_PRIVATE_KEY") { diff --git a/examples/benchmark_with_keepalive.rs b/examples/benchmark_with_keepalive.rs index efed0e0..2fd7ccb 100644 --- a/examples/benchmark_with_keepalive.rs +++ b/examples/benchmark_with_keepalive.rs @@ -6,7 +6,7 @@ async fn main() -> Result<(), Box> { println!("Benchmark with Keep-Alive Enabled"); println!("==================================\n"); - let client = ClobClient::new("https://clob-v2.polymarket.com"); + let client = ClobClient::new("https://clob.polymarket.com"); // Start keep-alive println!("Starting keep-alive..."); diff --git a/examples/demo.rs b/examples/demo.rs index ec6da27..9eae8e5 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -95,7 +95,7 @@ impl PolyfillDemo { pub fn new() -> Result { // Create basic client let config = ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: None, api_credentials: None, diff --git a/examples/final_benchmark.rs b/examples/final_benchmark.rs index 5e98c30..5b501b1 100644 --- a/examples/final_benchmark.rs +++ b/examples/final_benchmark.rs @@ -20,7 +20,7 @@ async fn main() -> Result<(), Box> { for i in 1..=20 { let start = Instant::now(); let response = client - .get("https://clob-v2.polymarket.com/simplified-markets?next_cursor=MA==") + .get("https://clob.polymarket.com/simplified-markets?next_cursor=MA==") .send() .await?; diff --git a/examples/http2_tuning_benchmark.rs b/examples/http2_tuning_benchmark.rs index 9607282..52aebd3 100644 --- a/examples/http2_tuning_benchmark.rs +++ b/examples/http2_tuning_benchmark.rs @@ -184,7 +184,7 @@ async fn test_config( let start = Instant::now(); match client - .get("https://clob-v2.polymarket.com/simplified-markets?next_cursor=MA==") + .get("https://clob.polymarket.com/simplified-markets?next_cursor=MA==") .send() .await { diff --git a/examples/performance_benchmark.rs b/examples/performance_benchmark.rs index c42c046..e8252f7 100644 --- a/examples/performance_benchmark.rs +++ b/examples/performance_benchmark.rs @@ -127,7 +127,7 @@ async fn main() -> Result<(), Box> { }; // Create client with API credentials only (no private key needed for custodial trading) - let mut client = ClobClient::new("https://clob-v2.polymarket.com"); + let mut client = ClobClient::new("https://clob.polymarket.com"); client.set_api_creds(api_creds); println!("✅ Client configured for custodial API trading"); diff --git a/examples/quick_demo.rs b/examples/quick_demo.rs index d63cc7b..9aa37de 100644 --- a/examples/quick_demo.rs +++ b/examples/quick_demo.rs @@ -18,7 +18,7 @@ async fn main() -> Result<()> { info!("======================"); // Create client - let client = ClobClient::new("https://clob-v2.polymarket.com"); + let client = ClobClient::new("https://clob.polymarket.com"); // Test 1: Basic connectivity info!("\nTesting API Connectivity..."); diff --git a/examples/side_by_side_benchmark.rs b/examples/side_by_side_benchmark.rs index 546d32c..c633a16 100644 --- a/examples/side_by_side_benchmark.rs +++ b/examples/side_by_side_benchmark.rs @@ -29,7 +29,7 @@ async fn main() -> Result<(), Box> { for i in 1..=20 { let start = Instant::now(); match baseline_http - .get("https://clob-v2.polymarket.com/simplified-markets?next_cursor=MA==") + .get("https://clob.polymarket.com/simplified-markets?next_cursor=MA==") .send() .await { @@ -68,7 +68,7 @@ async fn main() -> Result<(), Box> { println!("Test 2: polyfill-rs (with keep-alive)"); println!("══════════════════════════════════════"); - let our_client = polyfill_rs::ClobClient::new("https://clob-v2.polymarket.com"); + let our_client = polyfill_rs::ClobClient::new("https://clob.polymarket.com"); our_client .start_keepalive(std::time::Duration::from_secs(30)) .await; diff --git a/src/connection_manager.rs b/src/connection_manager.rs index 4b3ff62..301e087 100644 --- a/src/connection_manager.rs +++ b/src/connection_manager.rs @@ -101,14 +101,14 @@ mod tests { #[tokio::test] async fn test_connection_manager_creation() { let client = reqwest::ClientBuilder::new().no_proxy().build().unwrap(); - let manager = ConnectionManager::new(client, "https://clob-v2.polymarket.com".to_string()); + let manager = ConnectionManager::new(client, "https://clob.polymarket.com".to_string()); assert!(!manager.is_running()); } #[tokio::test] async fn test_keepalive_start_stop() { let client = reqwest::ClientBuilder::new().no_proxy().build().unwrap(); - let manager = ConnectionManager::new(client, "https://clob-v2.polymarket.com".to_string()); + let manager = ConnectionManager::new(client, "https://clob.polymarket.com".to_string()); manager.start_keepalive(Duration::from_secs(30)).await; tokio::time::sleep(Duration::from_millis(100)).await; diff --git a/src/dns_cache.rs b/src/dns_cache.rs index 48885ea..657ebcb 100644 --- a/src/dns_cache.rs +++ b/src/dns_cache.rs @@ -105,7 +105,7 @@ mod tests { #[ignore = "requires external DNS/network access"] async fn test_dns_cache_resolve() { let cache = DnsCache::new().await.unwrap(); - let ips = cache.resolve("clob-v2.polymarket.com").await.unwrap(); + let ips = cache.resolve("clob.polymarket.com").await.unwrap(); assert!(!ips.is_empty()); } @@ -113,7 +113,7 @@ mod tests { #[ignore = "requires external DNS/network access"] async fn test_dns_cache_prewarm() { let cache = DnsCache::new().await.unwrap(); - cache.prewarm("clob-v2.polymarket.com").await.unwrap(); + cache.prewarm("clob.polymarket.com").await.unwrap(); assert_eq!(cache.cache_size().await, 1); } @@ -121,7 +121,7 @@ mod tests { #[ignore = "requires external DNS/network access"] async fn test_dns_cache_clear() { let cache = DnsCache::new().await.unwrap(); - cache.prewarm("clob-v2.polymarket.com").await.unwrap(); + cache.prewarm("clob.polymarket.com").await.unwrap(); cache.clear().await; assert_eq!(cache.cache_size().await, 0); } diff --git a/src/lib.rs b/src/lib.rs index 574ee6d..22f0841 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,7 @@ //! #[tokio::main] //! async fn main() -> Result<(), Box> { //! let bootstrap = ClobClient::from_config(ClientConfig { -//! base_url: "https://clob-v2.polymarket.com".to_string(), +//! base_url: "https://clob.polymarket.com".to_string(), //! chain: 137, //! private_key: Some("your_private_key".to_string()), //! ..ClientConfig::default() @@ -28,7 +28,7 @@ //! //! let api_creds = bootstrap.create_or_derive_api_key(None).await?; //! let client = ClobClient::from_config(ClientConfig { -//! base_url: "https://clob-v2.polymarket.com".to_string(), +//! base_url: "https://clob.polymarket.com".to_string(), //! chain: 137, //! private_key: Some("your_private_key".to_string()), //! api_credentials: Some(api_creds), @@ -59,7 +59,7 @@ //! #[tokio::main] //! async fn main() -> Result<(), Box> { //! // Create a basic client -//! let client = ClobClient::new("https://clob-v2.polymarket.com"); +//! let client = ClobClient::new("https://clob.polymarket.com"); //! //! // Get market data //! let markets = client.get_sampling_markets(None).await.unwrap(); @@ -77,7 +77,7 @@ use tracing::info; // Global constants pub const DEFAULT_CHAIN_ID: u64 = 137; // Polygon -pub const DEFAULT_BASE_URL: &str = "https://clob-v2.polymarket.com"; +pub const DEFAULT_BASE_URL: &str = "https://clob.polymarket.com"; pub const DEFAULT_TIMEOUT_SECS: u64 = 30; pub const DEFAULT_MAX_RETRIES: u32 = 3; pub const DEFAULT_RATE_LIMIT_RPS: u32 = 100; diff --git a/src/types.rs b/src/types.rs index c0df8f5..c410f74 100644 --- a/src/types.rs +++ b/src/types.rs @@ -815,7 +815,7 @@ pub struct ClientConfig { impl Default for ClientConfig { fn default() -> Self { Self { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, // Polygon mainnet private_key: None, api_credentials: None, diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 06b0d8a..a6729c4 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -20,7 +20,7 @@ impl Default for TestConfig { fn default() -> Self { Self { host: env::var("POLYMARKET_HOST") - .unwrap_or_else(|_| "https://clob-v2.polymarket.com".to_string()), + .unwrap_or_else(|_| "https://clob.polymarket.com".to_string()), chain: env::var("POLYMARKET_CHAIN_ID") .unwrap_or_else(|_| "137".to_string()) .parse() diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 79f775e..3a4dd27 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -6,7 +6,7 @@ use polyfill_rs::{ClientConfig, ClobClient, OrderArgs, Side}; use rust_decimal_macros::dec; use std::env; -const HOST: &str = "https://clob-v2.polymarket.com"; +const HOST: &str = "https://clob.polymarket.com"; const CHAIN_ID: u64 = 137; fn load_env_vars() -> (String, Option, Option, Option) { diff --git a/tests/order_posting_test.rs b/tests/order_posting_test.rs index 300aed2..7421082 100644 --- a/tests/order_posting_test.rs +++ b/tests/order_posting_test.rs @@ -13,7 +13,7 @@ async fn test_post_order_authentication() { env::var("POLYMARKET_PRIVATE_KEY").expect("POLYMARKET_PRIVATE_KEY must be set in .env"); let bootstrap = ClobClient::from_config(ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: Some(private_key.clone()), ..ClientConfig::default() @@ -26,7 +26,7 @@ async fn test_post_order_authentication() { .await .expect("Failed to create API key"); let client = ClobClient::from_config(ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: Some(private_key), api_credentials: Some(creds), diff --git a/tests/prices_history_integration_tests.rs b/tests/prices_history_integration_tests.rs index 0868864..189ebed 100644 --- a/tests/prices_history_integration_tests.rs +++ b/tests/prices_history_integration_tests.rs @@ -7,7 +7,7 @@ use polyfill_rs::{ClobClient, PricesHistoryInterval}; -const HOST: &str = "https://clob-v2.polymarket.com"; +const HOST: &str = "https://clob.polymarket.com"; #[tokio::test(flavor = "multi_thread")] #[ignore] diff --git a/tests/simple_auth_test.rs b/tests/simple_auth_test.rs index ed33628..e25d844 100644 --- a/tests/simple_auth_test.rs +++ b/tests/simple_auth_test.rs @@ -4,7 +4,7 @@ use std::env; fn build_bootstrap_client(private_key: &str) -> ClobClient { ClobClient::from_config(ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: Some(private_key.to_string()), ..ClientConfig::default() @@ -30,7 +30,7 @@ async fn test_create_api_key_simple() { println!("Successfully created/derived API key"); println!(" API Key created (len={})", creds.api_key.len()); let client = ClobClient::from_config(ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: Some(private_key), api_credentials: Some(creds), @@ -77,7 +77,7 @@ async fn test_get_api_keys() { .await .expect("Failed to create API key"); let client = ClobClient::from_config(ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: Some(private_key), api_credentials: Some(creds), @@ -118,7 +118,7 @@ async fn test_get_trades() { .await .expect("Failed to create API key"); let client = ClobClient::from_config(ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: Some(private_key), api_credentials: Some(creds), @@ -159,7 +159,7 @@ async fn test_get_notifications() { .await .expect("Failed to create API key"); let client = ClobClient::from_config(ClientConfig { - base_url: "https://clob-v2.polymarket.com".to_string(), + base_url: "https://clob.polymarket.com".to_string(), chain: 137, private_key: Some(private_key), api_credentials: Some(creds), diff --git a/tests/ws_integration_tests.rs b/tests/ws_integration_tests.rs index 692e3e1..f565518 100644 --- a/tests/ws_integration_tests.rs +++ b/tests/ws_integration_tests.rs @@ -14,7 +14,7 @@ use polyfill_rs::{ use std::env; use std::time::Duration; -const HOST: &str = "https://clob-v2.polymarket.com"; +const HOST: &str = "https://clob.polymarket.com"; const WS_MARKET_URL: &str = "wss://ws-subscriptions-clob.polymarket.com/ws/market"; const WS_USER_URL: &str = "wss://ws-subscriptions-clob.polymarket.com/ws/user"; const CHAIN_ID: u64 = 137;