marketstore

Crates.iomarketstore
lib.rsmarketstore
version0.2.0
sourcesrc
created_at2023-01-20 01:50:02.72819
updated_at2023-09-16 18:38:14.656416
descriptionMarketstore rust driver
homepagehttps://github.com/ananthartha/rsmarketstore
repositoryhttps://github.com/ananthartha/rsmarketstore
max_upload_size
id763064
size107,848
Kamal (gKodes)

documentation

README

rsmarketstore

Rust driver for MarketStore

rsmarketstore can query and [write TBD] financial timeseries data from MarketStore

How to install

cargo add rsmarketstore

Examples

// Connect
let agent = Agent::connect(
    Uri::from_static("http://localhost:5995").into()).await;

// Query
agent
    .query(QueryParams {
        symbols: vec!["NIFTY 50".to_string()],
        timeframe: marketstore::MIN,
        attrgroup: "OHLCV".to_string(),
        ..Default::default()
    })
    .await?

// timeframes
let FiveMins = 5 * marketstore::MIN;
let FifteenMin = 15 * marketstore::MIN;

let TwoHours = 2 * marketstore::HOUR;

// stream
    let (stream, receiver) = stream::connect::<Candle>("ws://localhost:5993/ws")
        .await
        .unwrap();

    stream.subscribe(vec!["NIFTY 50".into()]).await?;
    receiver
        .for_each(|msg| async move {
            println!("{:#?}", msg);
        })
        .await;

Serde with Protobuf

Source can be found in examples/ohlcv

# Run
cargo run --example ohlcv --features=serde

Stream

Source can be found in examples/stream

# Run
cargo run --example stream --features=stream
Commit count: 18

cargo fmt