Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,509 changes: 5,145 additions & 364 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = [
"crates/matching-engine",
"crates/matching_engine",
"crates/settlement",
"crates/gateway",
"crates/indexer",
Expand All @@ -16,8 +16,22 @@ license = "MIT"


[workspace.dependencies]
# Local workspace members
matching_engine = { path = "crates/matching_engine" }
common = { path = "crates/common" }

# Shared external dependencies
rust_decimal = "1.40.0"
uuid = { version = "1.10.0", features = ["v4", "serde"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.149"
thiserror = "2.0.18"
tokio = { version = "1.49.0", features = ["full"] }
tokio-util = { version = "0.7.18", features = ["time"] }
anyhow = "1.0.101"
tracing = "0.1.44"
tracing-subscriber = "0.3.22"
metrics = "0.24.3"
metrics-exporter-prometheus = "0.18.1"
revm = { version = "34.0.0", features = ["std", "serde"] }
futures = "0.3.31"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Meridian Protocol.

Biggest gas saving in the contract: 256 nonce per storage slot. A trader submitting 256 fills in one block touches only 1 cold SLOAD + 1 SSTORE instead of 256.
Biggest gas saving in the contract: 256 nonce per storage slot.
A trader submitting 256 fills in one block touches only 1 cold SLOAD + 1 SSTORE instead of 256.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "matching-engine"
name = "matching_engine"
version.workspace = true
edition.workspace = true

Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions crates/settlement/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,30 @@ version.workspace = true
edition.workspace = true

[dependencies]
matching_engine = { workspace = true }
common = {workspace = true}
tokio = {workspace = true}
serde = {workspace = true}
thiserror = {workspace = true}
anyhow = {workspace = true}
uuid = {workspace = true}
rust_decimal = {workspace = true}
tracing = {workspace = true}

alloy = { version = "1.6.3", features = [
"full",
"node-bindings",
"rpc-types",
"provider-http",
"signers",
"signer-local",
"contract",
"sol-types"
] }

revm = {workspace = true}
tokio-util = {workspace = true}
futures = {workspace = true}
tracing-subscriber = {workspace = true}
metrics = {workspace = true}
metrics-exporter-prometheus = {workspace = true}
5 changes: 5 additions & 0 deletions crates/settlement/src/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
For batch flush trigger, when ANY of these conditions are met:
1. fills >= MAX_BATCH_SIZE (eg 50) - size cap
2. elapsed >= MAX_BATCH_AGE_MS (eg 500ms) - latency cap
3. gas_price <= GAS_PRICE_THRESHOLD - opportunistic flush ( dynamic gas price trigger)
4. fills >= MIN_BATCH_SIZE && gas_price is below rolling average - smart: only flush small batches when gas is cheap.
Loading