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

fix: 0.25% slippage check in quickstart #157

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion examples/quickstart/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ async fn main() {
}
println!("Do you want to simulate, execute or skip this swap?");
println!("Please be aware that the market might move while you make your decision, which might lead to a revert if you've set a min amount out or slippage.");
println!("Warning: slippage is set to 0.25% during execution by default.");
print!("(simulate/execute/skip): ");
io::stdout().flush().unwrap();
let mut input = String::new();
Expand Down Expand Up @@ -389,7 +390,7 @@ fn encode(
given_token: sell_token.address,
given_amount: sell_amount,
checked_token: buy_token.address,
slippage: Some(0.01), // 1% slippage
slippage: Some(0.0025), // 0.25% slippage
expected_amount: Some(expected_amount),
exact_out: false, // it's an exact in solution
checked_amount: None, // the amount out will not be checked in execution
Expand Down