Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream into fork #3

Merged
merged 33 commits into from
Mar 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
589bdb6
Fix Clippy Lints
Jan 31, 2023
6607430
Fail CI on build warnings
Jan 31, 2023
7c1ce7b
Add Docker Deployment Workflow
Jan 31, 2023
6b1c623
chore: test bullseye slim
charlesndalton Feb 1, 2023
114c855
Revert "chore: test bullseye slim"
charlesndalton Feb 1, 2023
15b9705
Merge branch 'build-docker-image' of github.com:cowprotocol/milkman-bot
charlesndalton Feb 1, 2023
a37a2c5
chore: add license
charlesndalton Feb 1, 2023
3a05cc2
chore: try alpine instead of debian
charlesndalton Feb 1, 2023
798114d
Merge branch 'main' of github.com:charlesndalton/milkman-bot
charlesndalton Feb 1, 2023
179f814
Merge pull request #4 from cowprotocol/fix-clippy-lints
charlesndalton Feb 1, 2023
54ef83c
chore: add license to deploy.yaml
charlesndalton Feb 1, 2023
7bfca61
Merge branch 'main' of github.com:charlesndalton/milkman-bot
charlesndalton Feb 1, 2023
23fde0f
fix: revert back to bullseye
charlesndalton Feb 1, 2023
6c04879
chore: update deployment yaml to use ghcr
charlesndalton Feb 1, 2023
1748cbc
Make slippage tolerance configurable
fleupold Jun 1, 2023
f000788
Use quoteId when placing orders
fleupold Jun 25, 2023
8bedb01
Debug print isValidSignature call
fleupold Jun 25, 2023
8f8b303
Merge pull request #9 from cowprotocol/make_slippage_tolerance_config…
charlesndalton Jun 26, 2023
6845012
Merge pull request #10 from cowprotocol/debug_print_is_valid_signatur…
charlesndalton Jun 26, 2023
6a32f50
make quote_id part of the order struct
fleupold Jun 27, 2023
bf82241
fix tests
fleupold Jun 27, 2023
2fae0d4
fix clippy as well
fleupold Jun 27, 2023
deab124
Merge pull request #12 from cowprotocol/fix_tests
charlesndalton Jun 27, 2023
f68c9a6
Merge pull request #11 from cowprotocol/use_quote_id
charlesndalton Jun 27, 2023
267e84c
Fix operator precedence in slippage computation
fleupold Jun 29, 2023
222f0de
Merge pull request #13 from cowprotocol/fix_slippage_computation
charlesndalton Jun 29, 2023
628f5d3
Switch to tracing logs to allow for log spans per order
fleupold Aug 26, 2023
74155bd
clippy
fleupold Aug 27, 2023
0f0f953
Update README.md
fleupold Oct 7, 2023
0dfd83e
Merge pull request #15 from cowprotocol/readme-slippage-patch
charlesndalton Oct 22, 2023
5890436
Merge pull request #14 from cowprotocol/tracing_spans
charlesndalton Oct 22, 2023
59ccb41
Merge remote-tracking branch 'upstream/main'
squadgazzz Mar 15, 2024
6236951
Formatting
squadgazzz Mar 15, 2024
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
Prev Previous commit
Formatting
squadgazzz committed Mar 15, 2024
commit 623695193620078cad59d00b98d2fe95c303f516
6 changes: 4 additions & 2 deletions src/configuration.rs
Original file line number Diff line number Diff line change
@@ -52,7 +52,9 @@ impl Configuration {

let slippage_tolerance_bps =
match collect_optional_environment_variable("SLIPPAGE_TOLERANCE_BPS")? {
Some(block_num) => block_num.parse::<u16>().expect("Unable to parse slippage tolerance factor"),
Some(block_num) => block_num
.parse::<u16>()
.expect("Unable to parse slippage tolerance factor"),
None => 50,
};

@@ -64,7 +66,7 @@ impl Configuration {
starting_block_number,
polling_frequency_secs,
node_base_url,
slippage_tolerance_bps
slippage_tolerance_bps,
})
}
}
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -6,18 +6,23 @@ use tokio::time::sleep;
use tracing::Instrument;

mod configuration;

use crate::configuration::Configuration;

mod ethereum_client;

use crate::ethereum_client::EthereumClient;

mod cow_api_client;

use crate::cow_api_client::{CowAPIClient, Order};

mod encoder;

use crate::encoder::SignatureData;

mod types;

use crate::types::Swap;

mod constants;
@@ -200,7 +205,7 @@ async fn handle_swap(
sell_amount: sell_amount_after_fees,
buy_amount: buy_amount_after_fees_and_slippage,
valid_to: quote.valid_to,
fee_amount: U256::zero(),
fee_amount: U256::zero(),
receiver: requested_swap.receiver,
eip_1271_signature: &eip_1271_signature,
quote_id: quote.id,