Skip to content

Commit

Permalink
Expect feePolicies
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinquaXD committed Mar 27, 2024
1 parent 1740937 commit d94f119
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/api/routes/solve/dto/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,38 @@ struct Order {
kind: Kind,
partially_fillable: bool,
class: Class,
fee_policies: Option<Vec<FeePolicy>>,
}

#[serde_as]
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum FeePolicy {
#[serde(rename_all = "camelCase")]
Surplus { factor: f64, max_volume_factor: f64 },
#[serde(rename_all = "camelCase")]
PriceImprovement {
factor: f64,
max_volume_factor: f64,
quote: Quote,
},
#[serde(rename_all = "camelCase")]
Volume { factor: f64 },
}

#[serde_as]
#[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Quote {
#[serde_as(as = "serialize::U256")]
pub sell_amount: eth::U256,
#[serde_as(as = "serialize::U256")]
pub buy_amount: eth::U256,
#[serde_as(as = "serialize::U256")]
pub fee: eth::U256,
}


#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
enum Kind {
Expand Down

0 comments on commit d94f119

Please sign in to comment.