| Crates.io | drm-exchange-opinion |
| lib.rs | drm-exchange-opinion |
| version | 0.1.3 |
| created_at | 2025-12-25 17:08:13.851663+00 |
| updated_at | 2025-12-28 08:42:55.331035+00 |
| description | Opinion exchange implementation for dr-manhattan |
| homepage | |
| repository | https://github.com/gtg7784/dr-manhattan-rust |
| max_upload_size | |
| id | 2004754 |
| size | 97,946 |
Opinion exchange implementation for dr-manhattan.
This crate provides a complete Opinion integration including:
[dependencies]
drm-exchange-opinion = "0.1"
use drm_core::Exchange;
use drm_exchange_opinion::{Opinion, OpinionConfig};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Public API (no auth required)
let exchange = Opinion::with_default_config()?;
// Fetch markets
let markets = exchange.fetch_markets(None).await?;
for market in markets.iter().take(5) {
println!("{}: {:?}", market.question, market.prices);
}
Ok(())
}
For trading operations, you need to provide your API key and wallet credentials:
use drm_exchange_opinion::{Opinion, OpinionConfig};
let config = OpinionConfig::new()
.with_api_key("your-api-key")
.with_private_key("0x...")
.with_multi_sig_addr("0x...");
let exchange = Opinion::new(config)?;
// Now you can create orders, cancel orders, etc.
| Feature | Status |
|---|---|
| Fetch markets | ✅ |
| Fetch orderbook | ✅ |
| Create orders | ✅ |
| Cancel orders | ✅ |
| Fetch positions | ✅ |
| Fetch balance | ✅ |
| WebSocket orderbook | - |
This crate is part of the dr-manhattan-rust project, a Rust port of guzus/dr-manhattan.
MIT