Skip to content

Commit

Permalink
Merge branch 'main' into parse_l2_snapshot_binance
Browse files Browse the repository at this point in the history
  • Loading branch information
soulmachine authored Jul 7, 2024
2 parents eb2b92c + 4ee4356 commit e0d735c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
12 changes: 6 additions & 6 deletions crypto-message/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crypto-message"
version = "1.1.20"
version = "1.1.21"
edition = "2021"
description = "Unified data structures for all cryptocurrency exchanges."
license = "Apache-2.0"
Expand All @@ -12,11 +12,11 @@ keywords = ["cryptocurrency", "blockchain", "trading"]
ahash = "0.8.11"
crypto-market-type = "1.1.6"
crypto-msg-type = "1.0.12"
protobuf = "3.4.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.115"
strum = "0.26.2"
strum_macros = "0.26.2"
protobuf = "3.5.0"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.120"
strum = "0.26.3"
strum_macros = "0.26.4"

[features]
f32 = []
2 changes: 1 addition & 1 deletion crypto-message/src/proto/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_5_0;

/// Tick-by-tick trade message.
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
22 changes: 11 additions & 11 deletions crypto-msg-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crypto-msg-parser"
version = "2.9.1"
version = "2.9.2"
authors = ["soulmachine <[email protected]>"]
edition = "2021"
description = "Parse websocket messages from cryptocurreny exchanges"
Expand All @@ -9,17 +9,17 @@ repository = "https://github.com/crypto-crawler/crypto-msg-parser/tree/main/cryp
keywords = ["cryptocurrency", "blockchain", "trading"]

[dependencies]
chrono = "0.4.31"
crypto-contract-value = "1.7.24"
chrono = "0.4.38"
crypto-contract-value = "1.7.25"
crypto-market-type = "1.1.6"
crypto-msg-type = "1.0.12"
crypto-message = "1.1.19"
crypto-pair = "2.3.19"
crypto-message = "1.1.21"
crypto-pair = "2.3.20"
if_chain = "1.0.2"
once_cell = "1.19.0"
reqwest = { version = "0.11.23", features = ["blocking", "gzip"] }
simple-error = "0.3.0"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
strum = "0.25.0"
strum_macros = "0.25.3"
reqwest = { version = "0.12.5", features = ["blocking", "gzip"] }
simple-error = "0.3.1"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.120"
strum = "0.26.3"
strum_macros = "0.26.4"
14 changes: 8 additions & 6 deletions crypto-msg-parser/src/exchanges/bitmex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const EXCHANGE_NAME: &str = "bitmex";

// symbol -> tickSize
static SYMBOL_INDEX_AND_TICK_SIZE_MAP: Lazy<HashMap<String, (usize, f64)>> = Lazy::new(|| {
let mut m: HashMap<String, (usize, f64)> = vec![
let m: HashMap<String, (usize, f64)> = vec![
("A50G16", (65, 2.5)),
("A50H16", (67, 2.5)),
("A50J16", (72, 2.5)),
Expand Down Expand Up @@ -491,14 +491,16 @@ static SYMBOL_INDEX_AND_TICK_SIZE_MAP: Lazy<HashMap<String, (usize, f64)>> = Laz
.map(|x| (x.0.to_string(), x.1))
.collect();

let from_online = fetch_tick_sizes();
for (symbol, tick_size) in from_online {
m.insert(symbol, tick_size);
}
// deprecated by May 31st 2023
// let from_online = fetch_tick_sizes();
// for (symbol, tick_size) in from_online {
// m.insert(symbol, tick_size);
// }

m
});

#[allow(dead_code)]
fn fetch_tick_sizes() -> BTreeMap<String, (usize, f64)> {
#[derive(Serialize, Deserialize)]
#[allow(non_snake_case)]
Expand Down Expand Up @@ -566,7 +568,7 @@ struct RawOrder {
id: usize,
side: String, // Sell, Buy
size: Option<f64>, // None if action = delete
price: Option<f64>, // None if action = delete
price: Option<f64>, /* always exists after May 31st 2023, see https://www.bitmex.com/app/wsAPI#OrderBookL2 */
timestamp: Option<String>,
#[serde(flatten)]
extra: HashMap<String, Value>,
Expand Down

0 comments on commit e0d735c

Please sign in to comment.