Expand description
§polyoxide-data
Rust client library for Polymarket Data API.
§Features
- User data: open/closed positions, position value, trades, activity, and markets-traded counts
- Market positions (
/v1/market-positions) and token holders - Trade history across users
- Leaderboards, builder stats, open interest, and live volume
- Accounting snapshots (returned as ZIP bytes)
- Type-safe API with idiomatic Rust patterns
- Request builder pattern for flexible, composable queries
§Example
use polyoxide_data::DataApi;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new Data API client
let data = DataApi::new()?;
// Get positions for a user with fluent builder pattern
let positions = data.user("0x1234567890123456789012345678901234567890")
.list_positions()
.limit(10)
.send()
.await?;
for position in positions {
println!("Position: {} - size: {}", position.title, position.size);
}
Ok(())
}Re-exports§
pub use client::DataApi;pub use client::DataApiBuilder;pub use error::DataApiError;