煎饼交换路由器v2-getAmountsOut



getAmountsOut/getAmountOut和getAmountsIn/getAmountIn到底做什么?Pancakeswap文档中没有解释,所以我不确定如何使用它。两者与有"s"或没有"s"有什么区别?

不同之处在于;s";返回交换的CCD_ 1产生的一系列输出。而那些没有";s";返回单个交换的输出。

因此如果我沿着路径CCD_ 2交换,则CCD_;USDTUSDC";交换返回的值将类似于:[usdtAmount, usdcAmount]

如果我交换";ETHUSDT";则getAmountOut将返回CCD_ 5。

getAmountsIn/getAmountIn的情况正好相反。

定义如下:https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/libraries/PancakeLibrary.sol#L63

最新更新