Skip to content

Commit

Permalink
Merge pull request #1 from cowprotocol/support-zero-fee-limit-orders
Browse files Browse the repository at this point in the history
Support zero fee limit orders
  • Loading branch information
squadgazzz authored Mar 15, 2024
2 parents 09a149b + 746fadf commit ac3c3da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use anyhow::Result;
use ethers::prelude::*;
use hex::ToHex;
use log::{debug, error, info};
use std::{collections::HashMap, time::Duration};
Expand Down Expand Up @@ -149,7 +150,7 @@ async fn main() {
}
};

let sell_amount_after_fees = requested_swap.amount_in - quote.fee_amount;
let sell_amount_after_fees = requested_swap.amount_in;
let buy_amount_after_fees_and_slippage = quote.buy_amount_after_fee * 995 / 1000;

let eip_1271_signature = encoder::get_eip_1271_signature(
Expand All @@ -159,7 +160,7 @@ async fn main() {
sell_amount_after_fees,
buy_amount_after_fees_and_slippage,
quote.valid_to,
quote.fee_amount,
U256::zero(),
requested_swap.order_creator,
requested_swap.price_checker,
&requested_swap.price_checker_data,
Expand All @@ -174,7 +175,7 @@ async fn main() {
sell_amount_after_fees,
buy_amount_after_fees_and_slippage,
quote.valid_to,
quote.fee_amount,
U256::zero(),
requested_swap.receiver,
&eip_1271_signature,
)
Expand Down

0 comments on commit ac3c3da

Please sign in to comment.