@@ -2,7 +2,7 @@ import { DutchOrder, FillInfo, OrderValidation } from '@uniswap/uniswapx-sdk'
2
2
3
3
import { Unit } from 'aws-embedded-metrics'
4
4
import { default as Logger } from 'bunyan'
5
- import { ethers } from 'ethers'
5
+ import { BigNumber , ethers } from 'ethers'
6
6
import Joi from 'joi'
7
7
import { ORDER_STATUS , SettledAmount } from '../../entities'
8
8
import { checkDefined } from '../../preconditions/preconditions'
@@ -96,7 +96,7 @@ export class CheckOrderStatusHandler extends SfnLambdaHandler<ContainerInjected,
96
96
gasCostInETH ,
97
97
receipt . effectiveGasPrice . toString ( ) ,
98
98
receipt . gasUsed . toString ( ) ,
99
- settledAmounts . reduce ( ( prev , cur ) => ( prev && prev . amountOut > cur . amountOut ? prev : cur ) )
99
+ settledAmounts . reduce ( ( prev , cur ) => ( prev && BigNumber . from ( prev . amountOut ) . gt ( cur . amountOut ) ? prev : cur ) )
100
100
)
101
101
102
102
const percentDecayed = ( timestamp - order . decayStartTime ) / ( order . decayEndTime - order . decayStartTime )
@@ -198,7 +198,7 @@ export class CheckOrderStatusHandler extends SfnLambdaHandler<ContainerInjected,
198
198
gasCostInETH ,
199
199
receipt . effectiveGasPrice . toString ( ) ,
200
200
receipt . gasUsed . toString ( ) ,
201
- settledAmounts . reduce ( ( prev , cur ) => ( prev && prev . amountOut > cur . amountOut ? prev : cur ) )
201
+ settledAmounts . reduce ( ( prev , cur ) => ( prev && BigNumber . from ( prev . amountOut ) . gt ( cur . amountOut ) ? prev : cur ) )
202
202
)
203
203
204
204
const percentDecayed =
0 commit comments