polymarket-hft 0.0.7

A high-frequency trading system for Polymarket with built-in API clients (Data API, CLOB, CLOB WebSocket, Gamma, RTDS) and CLI
Documentation
1
2
3
4
5
6
7
8
9
10
use std::io::{self, Write};

/// Write pretty JSON to stdout using a streaming writer.
pub fn write_json_output<T: serde::Serialize>(value: &T) -> anyhow::Result<()> {
    let stdout = io::stdout();
    let mut handle = stdout.lock();
    serde_json::to_writer_pretty(&mut handle, value)?;
    writeln!(handle)?;
    Ok(())
}