Skip to content

Commit

Permalink
Store auction with liquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
m-lord-renkse committed Apr 25, 2024
1 parent 22fe18e commit 3ea4aa9
Show file tree
Hide file tree
Showing 13 changed files with 524 additions and 12 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/autopilot/src/infra/persistence/dto/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ impl From<boundary::EcdsaSignature> for domain::auction::order::EcdsaSignature {
}
}

#[serde_as]
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum FeePolicy {
Expand Down
1 change: 1 addition & 0 deletions crates/driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ path = "src/main.rs"
[dependencies]
app-data = { path = "../app-data" }
bytes-hex = { path = "../bytes-hex" }
s3 = { path = "../s3" }
async-trait = { workspace = true }
axum = { workspace = true }
bigdecimal = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions crates/driver/src/domain/competition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ impl Competition {
}
})?;

self.solver
.store_auction_with_liquidity(auction, &liquidity);
observe::postprocessing(&solutions, auction.deadline().driver());

// Discard solutions that don't have unique ID.
Expand Down
4 changes: 4 additions & 0 deletions crates/driver/src/domain/eth/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ impl GasPrice {
.into()
}

pub fn base(&self) -> FeePerGas {
self.max
}

pub fn max(&self) -> FeePerGas {
self.max
}
Expand Down
1 change: 1 addition & 0 deletions crates/driver/src/infra/config/file/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub async fn load(chain: eth::ChainId, path: &Path) -> infra::Config {
true => SolutionMerging::Allowed,
false => SolutionMerging::Forbidden,
},
s3: config.s3,
}
}))
.await,
Expand Down
6 changes: 5 additions & 1 deletion crates/driver/src/infra/config/file/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub use load::load;
use {
crate::{domain::eth, util::serialize},
crate::{domain::eth, infra::persistence::S3, util::serialize},
reqwest::Url,
serde::{Deserialize, Serialize},
serde_with::serde_as,
Expand Down Expand Up @@ -198,6 +198,10 @@ struct SolverConfig {
/// auction together.
#[serde(default)]
merge_solutions: bool,

/// S3 path for storing the auctions with liquidity
#[serde(default)]
s3: Option<S3>,
}

#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Serialize)]
Expand Down
1 change: 1 addition & 0 deletions crates/driver/src/infra/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod liquidity;
pub mod mempool;
pub mod notify;
pub mod observe;
pub mod persistence;
pub mod simulator;
pub mod solver;
pub mod time;
Expand Down
Loading

0 comments on commit 3ea4aa9

Please sign in to comment.