Skip to content

Commit

Permalink
dev: fuzz inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xqd committed Jul 6, 2024
1 parent ddc370c commit 2a75c48
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions benches/uniswapv2_simulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ use amms::amm::uniswap_v2::UniswapV2Pool;
use amms::amm::AutomatedMarketMaker;

fn criterion_benchmark(c: &mut Criterion) {
// Data is populated from UniswapV2Pool at block 14597943
let token_a = address!("c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2");
let pool = UniswapV2Pool {
address: address!("ddF8390cEd9fAD414b1ca1DD4Fe14F881C2Cfa70"),
token_a,
token_a_decimals: 18,
token_b: address!("fc0d6cf33e38bce7ca7d89c0e292274031b7157a"),
token_b_decimals: 18,
reserve_0: 281815124409715083245_u128,
reserve_1: 631976629342354846935765_u128,
reserve_0: 381815124409715083245_u128,
reserve_1: 531976629342354846935765_u128,
fee: 300,
};
let swap_amount = U256::from(694724330990640303_u128);
let swap_amount = U256::from(594724330990640303_u128);
c.bench_function("uniswapv2_simuluate", |b| {
b.iter(|| {
let _ = pool.simulate_swap(token_a, swap_amount).unwrap();
Expand Down

0 comments on commit 2a75c48

Please sign in to comment.