Skip to content
Draft
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
1,092 changes: 696 additions & 396 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"apps/anvil_orchestrator",
"apps/anvil_provisioner",
"apps/index_deployer",
"apps/solver_lambda",
"apps/tracker",
"_deprecated/liquidity_tracker",
"_deprecated/alloy-evm-connector",
Expand Down Expand Up @@ -79,6 +80,7 @@ rust_decimal_macros = { workspace = true }
safe-math = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_with = { workspace = true }
sha2 = { workspace = true }
statrs = { workspace = true }
string_cache = { workspace = true }
Expand Down Expand Up @@ -156,6 +158,7 @@ rust_decimal_macros = "1"
safe-math = { path = "./proc-macros/safe-math" }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
serde_with = { version = "3.15.0", features = ["macros"] }
sha2 = "0.10"
statrs = "0.16"
string_cache = "0.8.9"
Expand Down
25 changes: 25 additions & 0 deletions apps/solver_lambda/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "solver_lambda"
version = "0.1.0"
edition = "2021"

[dependencies]
alloy = { workspace = true }
axum = { workspace = true }
axum-server = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true }
crossbeam = { workspace = true }
eyre = { workspace = true }
hex = { workspace = true }
index-core = { workspace = true }
index-maker = { workspace = true }
itertools = { workspace = true }
parking_lot = { workspace = true }
rust_decimal = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
symm-core = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
123 changes: 123 additions & 0 deletions apps/solver_lambda/example_data/1_input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"market_data_events": [
{
"TopOfBook": {
"symbol": "BTCUSDC",
"sequence_number": 1,
"best_bid_price": "50000.0",
"best_ask_price": "50010.0",
"best_bid_quantity": "0.01",
"best_ask_quantity": "0.02"
}
},
{
"TopOfBook": {
"symbol": "ETHUSDC",
"sequence_number": 1,
"best_bid_price": "5000.0",
"best_ask_price": "5010.0",
"best_bid_quantity": "0.05",
"best_ask_quantity": "0.09"
}
},
{
"OrderBookSnapshot": {
"symbol": "BTCUSDC",
"sequence_number": 1,
"bid_updates": [
{
"price": "50000.0",
"quantity": "0.01"
}
],
"ask_updates": [
{
"price": "50010.0",
"quantity": "0.02"
}
]
}
},
{
"OrderBookSnapshot": {
"symbol": "ETHUSDC",
"sequence_number": 1,
"bid_updates": [
{
"price": "5000.0",
"quantity": "0.05"
}
],
"ask_updates": [
{
"price": "5010.0",
"quantity": "0.09"
}
]
}
}
],
"order_events": [],
"server_events": [
{
"NewIndexOrder": {
"chain_id": 8453,
"address": "0xc0d3c9e530ca6d71469bb678e6592274154d9cad",
"client_order_id": "C1",
"symbol": "SO2",
"side": "Buy",
"collateral_amount": "0.10",
"timestamp": "2025-10-09T13:28:00.000Z"
}
}
],
"chain_events": [
{
"Deposit": {
"chain_id": 8453,
"address": "0xc0d3c9e530ca6d71469bb678e6592274154d9cad",
"seq_num": "0x1",
"amount": "0.10",
"timestamp": "2025-10-09T13:28:00.000Z"
}
}
],
"router_events": [],
"state": {
"order_ids": [
"O1",
"O2",
"O3",
"O4",
"O5",
"O6"
],
"payment_ids": [
"P1",
"P2"
],
"batch_ids": [
"B1",
"B2",
"B3"
],
"indexes": [
{
"symbol": "SO2",
"basket": [
{
"pair": "BTCUSDC",
"weight": "0.5",
"quantity": "0.01"
},
{
"pair": "ETHUSDC",
"weight": "0.5",
"quantity": "0.1"
}
]
}
]
},
"timestamp": "2025-10-09T13:28:00.000Z"
}
Loading