TaifoonTAIFOON
Taifoon · Docs
SDK

Rust SDK

High-performance crate with a typed client and a low-allocation hot path. Built on reqwest + serde. Planned for Phase B alongside the matcher's own Rust internals.
Heads up
The Rust SDK is PLANNED. Today, hand-roll requests with reqwest; the JSON shapes are stable.

Cargo

# PLANNED Phase B
[dependencies]
taifoon-clob = "0.1"
tokio = { version = "1", features = ["full"] }

Sketch of the API

use taifoon_clob::{Client, OrderRequest, Tif};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let c = Client::new("https://api.taifoon.dev", "bot-demo");

    let order = c.place_order(OrderRequest {
        market: "BTC-PERP".into(),
        side: "buy".into(),
        qty: "0.01".into(),
        price: "75000".into(),
        tif: Tif::Gtc,
        ..Default::default()
    }).await?;

    println!("{}", order.order_id);
    Ok(())
}

Today: drop down to reqwest

let body = serde_json::json!({
    "market":"BTC-PERP","side":"buy","qty":"0.01",
    "price":"75000","tif":"gtc","attribution":"bot-demo",
});
let r: serde_json::Value = reqwest::Client::new()
    .post("https://api.taifoon.dev/book/v1/orders")
    .json(&body).send().await?.json().await?;