#cryptocurrency #trading #blockchain #data-structures

crypto-message

Unified data structures for all cryptocurrency exchanges

31 stable releases

1.1.20 Mar 31, 2024
1.1.19 Nov 27, 2023
1.1.18 Aug 14, 2023
1.1.17 Mar 12, 2023
1.1.10 Jul 21, 2022

#2823 in Magic Beans

Download history 7/week @ 2023-12-23 10/week @ 2023-12-30 6/week @ 2024-02-17 81/week @ 2024-02-24 18/week @ 2024-03-02 10/week @ 2024-03-09 9/week @ 2024-03-16 2/week @ 2024-03-23 218/week @ 2024-03-30 19/week @ 2024-04-06

249 downloads per month
Used in 4 crates (2 directly)

Apache-2.0

105KB
2.5K SLoC

crypto-message

Unified data structures for all cryptocurrency exchanges.

This library contains all output data types of crypto-msg-parser.

The crypto_message::proto module contains protobuf messages corresponding to message types in lib.rs.

The crypto_message::compact module contains compact messages corresponding to message types in lib.rs.

Differences:

  • Message types in lib.rs are output data types of crypto-msg-parser, and they are designed for JSON and CSV.

  • Message types in crypto_message::proto are protobuf messages, which are designed for disk storage.

  • message types in crypto_message::compact are suitable for RPC.

    Messages types in lib.rs has string fields such as exchange, symbol, which causes a lot of memory allocation and copying, so these types are NOT suitable for high-performance processing.

    Message types in crypto_message::proto are compact, (1) metadata fields such as exchange, symbol and pair are removed to save disk space, because these fields exist in filenames already, and (2) all float numbers are 32-bit to save more disk space.

    Message types in crypto_message::compact are equivalent to message types in lib.rs, with exchange changed to enum, symbol and pair changed to u64 hash values.

Dependencies

~3.5MB
~74K SLoC