Makes _getAmountOut account for differences in the amount of decimals for tokenA and tokenB, instead of just assuming both tokenA and tokenB have the same amount of decimals.
In getTradeDiff(uint,address,address,bool), sample was rounding to 0 in certain cases incorrectly, e.g. if the pool had 0.1 WBTC and 1e9 OptiDoge, sample would be 0, because 0.1 1e8 1e18/ ( 1e9 * 1e18 ) rounds to 0, so we just directly calculate the derivative instead for volatile pairs in getTradeDiff.
Added a getTradeDiffs function just for convenience to be able to bundle many getTradeDiff calls at once (used by v2 UI).
Deployed here https://optimistic.etherscan.io/address/0x82959edf06499c3c931c39ebca8737f0b5551bec and being used in nightride UI
Makes _getAmountOut account for differences in the amount of decimals for tokenA and tokenB, instead of just assuming both tokenA and tokenB have the same amount of decimals.
In getTradeDiff(uint,address,address,bool), sample was rounding to 0 in certain cases incorrectly, e.g. if the pool had 0.1 WBTC and 1e9 OptiDoge, sample would be 0, because 0.1 1e8 1e18/ ( 1e9 * 1e18 ) rounds to 0, so we just directly calculate the derivative instead for volatile pairs in getTradeDiff.
Added a getTradeDiffs function just for convenience to be able to bundle many getTradeDiff calls at once (used by v2 UI).