{"sources": [{"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/simulation/engine.rs", "quote": "// AMM edge is the negative of arbitrageur profit at true price"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/simulation/engine.rs", "quote": "trade.amount_x * fair_price - trade.amount_y"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/simulation/engine.rs", "quote": "/// 3. Retail orders arrive and are routed to best AMM"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/amm/cfmm.rs", "quote": "// Update reserves - fees go to separate bucket, not into liquidity"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/amm/cfmm.rs", "quote": "if let Ok((bid_fee, ask_fee)) = self.strategy.after_swap(trade_info) {"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/market/arbitrageur.rs", "quote": "/// - Buy X from AMM (AMM sells X): Δx_out = x - sqrt(k / (γ·p)) (profit-maximizing)"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/market/router.rs", "quote": "/// Implements optimal order splitting so that the marginal price is equal"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/market/router.rs", "quote": "/// - Δy_1* = (r * (y_2 + γ_2 * Y) - y_1) / (γ_1 + r * γ_2)"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/market/retail.rs", "quote": "/// trade randomly (buy or sell with equal probability by default)."}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/IAMMStrategy.sol", "quote": "Post-trade X reserves (WAD precision)"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/VanillaStrategy.sol", "quote": "uint256 public constant FEE = 30 * BPS;"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/contracts/src/AMMStrategyBase.sol", "quote": "/// @notice Fixed storage array - strategies can only use these 32 slots"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/evm/strategy.rs", "quote": "const GAS_LIMIT_TRADE: u64 = 250_000;"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py", "quote": "rng = np.random.default_rng(seed=i)"}, {"url": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py", "quote": "retail_arrival_rate_min=0.6,"}, {"url": "https://api.imdnotdead.fun/artifacts/c33720874aa1285e9dc766540b8a90410118a8e8b840d949ea0dcc211bdb27c1", "quote": "if (!firstInStep && feeUsed > 30 * BPS && gamma > 0) {"}, {"url": "https://api.imdnotdead.fun/artifacts/c33720874aa1285e9dc766540b8a90410118a8e8b840d949ea0dcc211bdb27c1", "quote": "uint256 uncertainty = slots[13];"}]}