drm-exchange-opinion

Crates.iodrm-exchange-opinion
lib.rsdrm-exchange-opinion
version0.1.3
created_at2025-12-25 17:08:13.851663+00
updated_at2025-12-28 08:42:55.331035+00
descriptionOpinion exchange implementation for dr-manhattan
homepage
repositoryhttps://github.com/gtg7784/dr-manhattan-rust
max_upload_size
id2004754
size97,946
Taegeon Alan Go (gtg7784)

documentation

README

drm-exchange-opinion

Crates.io Documentation License: MIT

Opinion exchange implementation for dr-manhattan.

Overview

This crate provides a complete Opinion integration including:

  • REST API: Fetch markets, create/cancel orders, manage positions
  • Authentication: API key and multi-sig wallet support

Installation

[dependencies]
drm-exchange-opinion = "0.1"

Quick Start

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(())
}

Authentication

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.

Features

Feature Status
Fetch markets
Fetch orderbook
Create orders
Cancel orders
Fetch positions
Fetch balance
WebSocket orderbook -

Part of dr-manhattan-rust

This crate is part of the dr-manhattan-rust project, a Rust port of guzus/dr-manhattan.

License

MIT

Commit count: 0

cargo fmt