Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
it4rb committed Dec 12, 2024
1 parent e1a9c03 commit f4f0102
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/source/limitorder/pool_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (p *PoolSimulator) calcAmountWithSwapInfo(swapSide SwapSide, tokenAmountIn
SwapSide: swapSide,
AmountIn: tokenAmountIn.Amount.String(),
}
totalFilledMakingAmountWei := big.NewInt(0)
totalFilledTakingAmountWei := big.NewInt(0)
isFulfillAmountIn := false
totalFeeAmountWei := new(big.Int)

Expand Down Expand Up @@ -277,7 +277,7 @@ func (p *PoolSimulator) calcAmountWithSwapInfo(swapSide SwapSide, tokenAmountIn
swapInfo.FilledOrders = append(swapInfo.FilledOrders, filledOrderInfo)
isFulfillAmountIn = true
addFilledMakingAmount(filledMakingAmountByMaker, order.Maker, filledMakingAmountWei)
totalFilledMakingAmountWei.Add(totalFilledMakingAmountWei, filledTakingAmountWei)
totalFilledTakingAmountWei.Add(totalFilledTakingAmountWei, filledTakingAmountWei)

// Currently, when Aggregator finds route and returns some orders and sends them to the smart contract to execute.
// We will often meet edge cases that these orders can be fulfilled by a trading bot or taker on Aggregator.
Expand Down Expand Up @@ -320,12 +320,12 @@ func (p *PoolSimulator) calcAmountWithSwapInfo(swapSide SwapSide, tokenAmountIn
filledOrderInfo := newFilledOrderInfo(order, remainingTakingAmountWei.String(), remainingMakingAmountWei.String(), feeAmountWeiByOrder.String())
swapInfo.FilledOrders = append(swapInfo.FilledOrders, filledOrderInfo)
addFilledMakingAmount(filledMakingAmountByMaker, order.Maker, remainingMakingAmountWei)
totalFilledMakingAmountWei.Add(totalFilledMakingAmountWei, remainingTakingAmountWei)
totalFilledTakingAmountWei.Add(totalFilledTakingAmountWei, remainingTakingAmountWei)
}
if !isFulfillAmountIn {
return nil, SwapInfo{}, nil, ErrCannotFulfillAmountIn
}
swapInfo.AmountIn = totalFilledMakingAmountWei.String()
swapInfo.AmountIn = totalFilledTakingAmountWei.String()
return totalAmountOutWei, swapInfo, totalFeeAmountWei, nil
}

Expand Down

0 comments on commit f4f0102

Please sign in to comment.