Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CheetahExchange/orderbook-rs
/ functions
Functions
115 in github.com/CheetahExchange/orderbook-rs
⨍
Functions
115
◇
Types & classes
36
↓ 24 callers
Method
set
(&mut self, k: u64, v: bool)
src/utils/bitmap.rs:37
↓ 18 callers
Function
send_order
(producer: &FutureProducer<DefaultClientContext>, order: &Order)
tests/integration_test.rs:52
↓ 17 callers
Function
create_order
( order_id: u64, user_id: u64, side: Side, price: Decimal, size: Decimal, order_type:
tests/integration_test.rs:26
↓ 14 callers
Method
get
(&self, k: u64)
src/utils/bitmap.rs:25
↓ 10 callers
Method
decr_size
(&mut self, order_id: u64, size: &Decimal)
src/matching/depth.rs:22
↓ 10 callers
Function
make_snowflake_id
(relative_timestamp_ms: i64, node_id: u64, sequence: u64)
src/utils/time_window.rs:265
↓ 9 callers
Method
next_log_seq
(&mut self)
src/matching/order_book.rs:625
↓ 9 callers
Function
print_test_header
(title: &str)
tests/integration_test.rs:69
↓ 8 callers
Method
add
(&mut self, order: &BookOrder)
src/matching/depth.rs:16
↓ 6 callers
Function
new_done_log
( log_seq: u64, product_id: &str, order: &BookOrder, remaining_size: &Decimal, reason: &Do
src/matching/log.rs:126
↓ 5 callers
Method
put
Adds an order to the time window. Returns error if: - The order timestamp is older than min_time (expired) - The order already exists in the window (d
src/utils/time_window.rs:131
↓ 4 callers
Function
current_time_since_snowflake_epoch
Get current time in milliseconds relative to Snowflake epoch. This is used for time-based deduplication window. Returns: (Unix timestamp ms) - SNOWFLA
src/matching/order_book.rs:32
↓ 4 callers
Function
make_book_order
(order_id: u64, size: &str, price: &str)
src/matching/depth.rs:70
↓ 3 callers
Method
extract_timestamp
Extracts the timestamp from a Snowflake ID. Snowflake ID structure: | 1bit sign | 41bit timestamp(ms) | 10bit node | 12bit sequence |
src/utils/time_window.rs:123
↓ 3 callers
Method
len
(&self)
src/utils/bitmap.rs:21
↓ 3 callers
Method
put
(&mut self, val: u64)
src/utils/window.rs:24
↓ 2 callers
Method
cleanup
Removes expired orders based on current time. This should be called periodically to prevent memory leaks when there are no new orders.
src/utils/time_window.rs:175
↓ 2 callers
Method
cmp
(&self, other: &Self)
src/matching/ordering.rs:40
↓ 2 callers
Function
new_match_log
( log_seq: u64, product_id: &str, trade_seq: u64, taker_order: &BookOrder, maker_order: &B
src/matching/log.rs:184
↓ 2 callers
Method
next_trade_seq
(&mut self)
src/matching/order_book.rs:630
↓ 2 callers
Method
remove_expired_internal
Removes all orders with timestamp < min_time.
src/utils/time_window.rs:202
↓ 1 callers
Method
cmp
(&self, other: &Self)
src/utils/time_window.rs:59
↓ 1 callers
Function
create_producer
()
tests/integration_test.rs:18
↓ 1 callers
Function
extract_timestamp_from_id
(order_id: u64)
src/utils/time_window.rs:26
↓ 1 callers
Method
fetch_message
(&mut self)
src/matching/kafka_order.rs:71
↓ 1 callers
Method
fetch_order
(&mut self)
src/matching/kafka_order.rs:83
↓ 1 callers
Method
get_latest
(&mut self)
src/matching/redis_snapshot.rs:46
↓ 1 callers
Function
init_log
(level: &str)
src/main.rs:18
↓ 1 callers
Function
new_kafka_consumer
( brokers: &[String], group_id: &str, topic: &str, session_time_out: u64, )
src/utils/kafka.rs:29
↓ 1 callers
Function
new_kafka_producer
( brokers: &[String], message_time_out: u64, )
src/utils/kafka.rs:12
↓ 1 callers
Function
new_open_log
(log_seq: u64, product_id: &str, taker_order: &BookOrder)
src/matching/log.rs:79
↓ 1 callers
Function
new_redis_client
(ip: &str, port: u16)
src/utils/redis.rs:3
↓ 1 callers
Function
normalize_price
Normalize price to the specified scale using rounding (matches Go version's Round behavior)
src/matching/order_book.rs:20
↓ 1 callers
Function
normalize_size
Normalize size to the specified scale using rounding (matches Go version's Round behavior)
src/matching/order_book.rs:25
↓ 1 callers
Function
print_done_log
(log: &Value, offset: i64)
tests/log_verifier.rs:116
↓ 1 callers
Function
print_match_log
(log: &Value, offset: i64)
tests/log_verifier.rs:96
↓ 1 callers
Function
print_open_log
(log: &Value, offset: i64)
tests/log_verifier.rs:107
↓ 1 callers
Function
read_config
()
src/config.rs:36
↓ 1 callers
Method
restore
(&mut self, snapshot: &Snapshot)
src/matching/engine.rs:99
↓ 1 callers
Method
set_offset
(&mut self, offset: Offset)
src/matching/kafka_order.rs:38
↓ 1 callers
Method
start
( &mut self, snapshot_store: &mut RedisSnapshotStore, order_reader: &mut KafkaOrderRea
src/matching/engine.rs:54
Method
apply_order
(&mut self, order: &Order)
src/matching/order_book.rs:257
Method
cancel_order
(&mut self, order: &Order)
src/matching/order_book.rs:503
Method
cleanup_time_window
Cleanup expired orders from the time window. This should be called periodically to prevent memory leaks when there are no new orders.
src/matching/order_book.rs:620
Method
contains
(&self, val: u64)
src/utils/window.rs:53
Method
contains
Checks if an order exists in the window.
src/utils/time_window.rs:192
Method
default
()
src/utils/time_window.rs:95
Method
default
()
src/matching/order_book.rs:58
Function
deserialize_done_reason
(deserializer: D)
src/models/types.rs:171
Function
deserialize_log_type
(deserializer: D)
src/matching/log.rs:29
Function
deserialize_order_status
(deserializer: D)
src/models/types.rs:138
Function
deserialize_order_type
(deserializer: D)
src/models/types.rs:20
Function
deserialize_side
(deserializer: D)
src/models/types.rs:58
Function
deserialize_time_in_force_type
(deserializer: D)
src/models/types.rs:94
Method
eq
(&self, other: &Self)
src/matching/ordering.rs:28
Function
extract_node_id_from_id
(order_id: u64)
src/utils/time_window.rs:33
Method
fmt
(&self, f: &mut fmt::Formatter)
src/utils/error.rs:18
Method
from_string
(s: String)
src/utils/error.rs:12
Method
get_bit
(byte: u8, bit_idx: u64)
src/utils/bitmap.rs:49
Method
get_seq
(&self)
src/matching/log.rs:74
Function
get_table_index_by_order_id
Returns the table shard index for a given order ID. This uses the node ID embedded in the Snowflake ID to determine the shard. The formula: (order_id
src/utils/time_window.rs:40
Function
get_table_index_by_user_id
Returns the table shard index for a given user ID. The user ID is directly used for sharding to ensure consistent routing.
src/utils/time_window.rs:46
Method
is_order_will_full_match
(&self, order: &Order)
src/matching/order_book.rs:169
Method
is_order_will_not_match
(&self, order: &Order)
src/matching/order_book.rs:129
Function
main
()
src/main.rs:35
Function
main
()
tests/integration_test.rs:76
Function
main
()
tests/log_verifier.rs:10
Method
new
(min: u64, max: u64)
src/utils/window.rs:15
Method
new
Creates a new time-based deduplication window.
src/utils/time_window.rs:102
Method
new
(l: u64)
src/utils/bitmap.rs:14
Method
new
(e: &dyn Error)
src/utils/error.rs:8
Method
new
(price: &Decimal, order_id: u64)
src/matching/ordering.rs:17
Method
new
(product: &Product, snapshot_store: &mut RedisSnapshotStore)
src/matching/engine.rs:36
Method
new_book_order
(order: &Order)
src/matching/order_book.rs:73
Method
new_kafka_log_producer
( brokers: &[String], product_id: &str, message_time_out: u64, )
src/matching/kafka_log.rs:19
Method
new_kafka_order_consumer
( brokers: &[String], group_id: &str, product_id: &str, session_time_out: u64,
src/matching/kafka_order.rs:22
Method
new_order_book
(product: &Product)
src/matching/order_book.rs:110
Method
new_redis_snapshot_store
( product_id: &str, ip: &str, port: u16, )
src/matching/redis_snapshot.rs:18
Method
nullify_order
(&mut self, order: &Order)
src/matching/order_book.rs:556
Method
opposite
(self)
src/models/types.rs:39
Method
partial_cmp
(&self, other: &Self)
src/utils/time_window.rs:69
Method
partial_cmp
(&self, other: &Self)
src/matching/ordering.rs:34
Method
restore
Restores the window from a snapshot. Note: epoch is ignored since it's always SNOWFLAKE_EPOCH.
src/utils/time_window.rs:228
Method
restore
(&mut self, snapshot: &OrderBookSnapshot)
src/matching/order_book.rs:598
Method
run_applier
( &mut self, order_rx: Receiver<OffsetOrder>, log_tx: Sender<Box<dyn LogTrait>>,
src/matching/engine.rs:145
Method
run_committer
( log_seq: u64, log_rx: Receiver<Box<dyn LogTrait>>, snapshot_approve_req_rx: Receiver
src/matching/engine.rs:236
Method
run_fetcher
( order_offset: u64, order_reader: &mut KafkaOrderReader, order_tx: Sender<OffsetOrder
src/matching/engine.rs:105
Method
run_snapshots
( product_id: &str, order_offset: u64, snapshot_req_tx: Sender<Snapshot>, snap
src/matching/engine.rs:315
Function
serialize_done_reason
(done_reason: &DoneReason, serializer: S)
src/models/types.rs:160
Function
serialize_log_type
(log_type: &LogType, serializer: S)
src/matching/log.rs:17
Function
serialize_order_status
( order_status: &OrderStatus, serializer: S, )
src/models/types.rs:120
Function
serialize_order_type
(order_type: &OrderType, serializer: S)
src/models/types.rs:9
Function
serialize_side
(side: &Side, serializer: S)
src/models/types.rs:47
Function
serialize_time_in_force_type
( time_in_force_type: &TimeInForceType, serializer: S, )
src/models/types.rs:78
Method
set_bit
(byte: u8, bit_idx: u64, v: bool)
src/utils/bitmap.rs:57
Method
size
Returns the number of orders in the window.
src/utils/time_window.rs:187
Method
snapshot
Returns a snapshot of the window state for serialization.
src/utils/time_window.rs:217
Method
snapshot
(&self)
src/matching/order_book.rs:575
Method
store
(&mut self, snapshot: &Snapshot)
src/matching/redis_snapshot.rs:33
Method
store
(&self, logs: &[Box<dyn LogTrait>])
src/matching/kafka_log.rs:33
next →
1–100 of 115, ranked by callers