Skip to main content

Construct an exchange

use openpx::ExchangeInner;
use serde_json::json;

let ex = ExchangeInner::new("polymarket", json!({
    "private_key": std::env::var("POLYMARKET_PRIVATE_KEY")?,
    "funder": std::env::var("POLYMARKET_FUNDER")?,
}))?;

Fetch markets

use openpx::FetchMarketsParams;

let (markets, cursor) = ex.fetch_markets(&FetchMarketsParams::default()).await?;
The TypeScript binding’s fetchMarkets() auto-paginates and returns every market in one call. Rust and Python expose the cursor.