crypto-crawler

A rock-solid cryprocurrency crawler.

Crawl realtime trades

```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawltrade, MarketType, Message};

fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));

// Crawl BitMEX inverse_swap market, for all symbols
crawl_trade("bitmex", MarketType::InverseSwap, None, on_msg, None);

} ```

Crawl level2 orderbook update events

```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll2_event, MarketType, Message};

fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));

// Crawl BitMEX inverse_swap market, for all symbols
crawl_l2_event("bitmex", MarketType::InverseSwap, None, on_msg, None);

} ```

Crawl level2 orderbook snapshots

```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll2_snapshot, MarketType, Message};

fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));

// Crawl BitMEX inverse_swap market level2 orderbook snapshots every 60 seconds, for all symbols
crawl_l2_snapshot("bitmex", MarketType::InverseSwap, None, on_msg, Some(60), None);

} ```

Crawl level3 orderbook update events

```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll3_event, MarketType, Message};

fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));

// Crawl CoinbasePro spot market, for all symbols
crawl_l3_event("coinbase_pro", MarketType::Spot, None, on_msg, None);

} ```

Crawl level3 orderbook snapshots

```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll3_snapshot, MarketType, Message};

fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));

// Crawl CoinbasePro spot market level2 orderbook snapshots every 60 seconds, for all symbols
crawl_l3_snapshot("coinbase_pro", MarketType::Spot, None, on_msg, Some(60), None);

} ```