AMM Strategy Visualizer

Step-by-step Automated Market Maker (AMM) strategy visualizer. Learn more at ammchallenge.com

Strategy

01// SPDX-License-Identifier: MIT
02pragma solidity ^0.8.24;
03
04import {AMMStrategyBase} from "./AMMStrategyBase.sol";
05import {TradeInfo} from "./IAMMStrategy.sol";
06
07contract Strategy is AMMStrategyBase {
08 function afterInitialize(uint256, uint256)
09 external pure override returns (uint256 bidFee, uint256 askFee)
10 {
11 return (bpsToWad(30), bpsToWad(30));
12 }
13
14 function afterSwap(TradeInfo calldata)
15 external pure override returns (uint256 bidFee, uint256 askFee)
16 {
17 return (bpsToWad(30), bpsToWad(30));
18 }
19
20 function getName() external pure override returns (string memory) {
21 return "Baseline-30bps";
22 }
23}

`afterInitialize` returns 30 bps on both sides. No persistent state is used.

Custom Strategy Editor

0 saved

Simulated Market

Step 0 | Trade 0 | Loading
x · y = kΔy / ΔxReserve XReserve Ystrategynormalizerrecent trail (auto-zoom)
Fair Price100.0000 Y/X
Strategy Spot100.0000 Y/X
Strategy Feesbid 30 bps | ask 30 bps
Slot[0] Feen/a
Trade Ration/a
Cumulative Edge+0.000 (retail +0.000, arb +0.000)

Per-Pool Depth

to 1% and 5% price impact

Strategy

30/30 bps
Buy-side depth (+1% / +5%)0.496 X / 2.410 X
Sell-side depth (-1% / -5%)0.505 X / 2.606 X
Cost to buy 1 X: 101.314 YPayout for sell 1 X: 98.716 Y

Normalizer

30/30 bps
Buy-side depth (+1% / +5%)0.496 X / 2.410 X
Sell-side depth (-1% / -5%)0.505 X / 2.606 X
Cost to buy 1 X: 101.314 YPayout for sell 1 X: 98.716 Y