AMM
什么是自动做市商 (AMM)
恒定乘积公式
基本原理
代码实现
// balance{0,1}Adjusted are the balances after the swap, accounting for the fee
uint balance0Adjusted = (balance0 * 10000 - (amount0In * fee * 4) / 5);
uint balance1Adjusted = (balance1 * 10000 - (amount1In * fee * 4) / 5);
// check that the product of the new balances is not less than the product of the old reserves
require(
balance0Adjusted * balance1Adjusted >=
uint(_reserve0) * uint(_reserve1) * (10000 ** 2),
"JAMM: K"
);价格发现机制
价格计算
价格影响
滑点概念
什么是滑点
滑点保护
套利机制
套利的作用
套利示例
流动性提供
流动性的重要性
流动性提供者的角色
无常损失
定义
计算原理
缓解措施
价格预言机
累积价格机制
预言机的用途
最小流动性锁定
永久锁定机制
Last updated