Skip to content

Commit

Permalink
Remove stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinquaXD committed Dec 11, 2024
1 parent 5b26d73 commit dc5f0e6
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 1,551 deletions.
8 changes: 0 additions & 8 deletions crates/solver/src/settlement/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,6 @@ impl Settlement {
self.encoder.clearing_prices()
}

/// Returns the clearing price for the specified token.
///
/// Returns `None` if the token is not part of the settlement.
#[cfg(test)]
pub(crate) fn clearing_price(&self, token: H160) -> Option<U256> {
self.clearing_prices().get(&token).copied()
}

/// Returns all orders included in the settlement.
pub fn traded_orders(&self) -> impl Iterator<Item = &Order> + '_ {
self.encoder.all_trades().map(|trade| &trade.data.order)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
use {
crate::liquidity::{ConstantProductOrder, WeightedProductOrder},
anyhow::anyhow,
ethcontract::{H160, U256},
shared::{
baseline_solver::BaselineSolvable,
sources::{balancer_v2::swap::WeightedPoolRef, uniswap_v2::pool_fetching::Pool},
},
std::{fmt::Debug, str::FromStr},
};

// Wrapper type for AWS ARN identifiers
#[derive(Debug, Clone)]
pub struct Arn(pub String);

impl FromStr for Arn {
type Err = anyhow::Error;

fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
// Could be more strict here, but this should suffice to catch unintended
// configuration mistakes
if s.starts_with("arn:aws:kms:") {
Ok(Self(s.to_string()))
} else {
Err(anyhow!("Invalid ARN identifier: {}", s))
}
}
}

impl BaselineSolvable for ConstantProductOrder {
fn get_amount_out(&self, out_token: H160, input: (U256, H160)) -> Option<U256> {
amm_to_pool(self).get_amount_out(out_token, input)
Expand Down
25 changes: 0 additions & 25 deletions crates/solver/src/solver/mod.rs

This file was deleted.

Loading

0 comments on commit dc5f0e6

Please sign in to comment.