mevcheb/optimal-sandwich
关于
做一点数学,赚一点钱
科学与工程实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Optimal sando frontrun amount
Haven’t public code/math for calculating optimal frontrun sandwich amounts (@libevm’s subway and @Supercycled cake_sniper both use binary search) so here’s a thread on how to derive perfect sando amounts:
The problem statement is: given some amountIn and amountMinOut (from a pending tx), what is the worst ratio (price) between the uniswap reserves must be such that the swap still goes through? Once we know the worst ratio, we can calculate exactly how much $ we need to push the pool to this ratio.
We should do this onchain at the time of execution, rather than offchain in a binary search. So that if someone beats us to the frontrun, we won’t get rekt and revert the meat transaction.

探索相关项目
加载中…