Commit 6c880d29 authored by Moody Salem's avatar Moody Salem

fix(position fee computation): incorrect sub underflow

parent a8baa6d6
...@@ -12,7 +12,7 @@ import { TokenAmount } from '@uniswap/sdk-core' ...@@ -12,7 +12,7 @@ import { TokenAmount } from '@uniswap/sdk-core'
function subIn256(x: BigNumber, y: BigNumber): BigNumber { function subIn256(x: BigNumber, y: BigNumber): BigNumber {
const difference = x.sub(y) const difference = x.sub(y)
return difference.lt(0) ? BigNumber.from(2).pow(256).sub(difference) : difference return difference.lt(0) ? BigNumber.from(2).pow(256).add(difference) : difference
} }
function getCounterfactualFees( function getCounterfactualFees(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment