You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wow-btc-swap/swap/src/bin/kraken_ticker.rs

18 lines
475 B

use anyhow::{Context, Result};
#[tokio::main]
async fn main() -> Result<()> {
tracing::subscriber::set_global_default(
tracing_subscriber::fmt().with_env_filter("debug").finish(),
)?;
let mut ticker = swap::kraken::connect().context("Failed to connect to kraken")?;
loop {
match ticker.wait_for_update().await? {
Ok(rate) => println!("Rate update: {}", rate),
Err(e) => println!("Error: {:#}", e),
}
}
}