Skip to content

Commit 9cc2118

Browse files
学习!saniales
学习!
authored andcommitted
fix compile bug
1 parent 573e88d commit 9cc2118

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exchanges/exchange_mock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (wrapper *ExchangeWrapperSimulator) BuyMarket(market *environment.Market, a
8282
break
8383
}
8484
totalQuote = totalQuote.Add(ask.Quantity)
85-
expense = expense.Add(bid.Quantity.Mul(ask.Value))
85+
expense = expense.Add(ask.Quantity.Mul(ask.Value))
8686
if expense.GreaterThan(*baseBalance) {
8787
return "", fmt.Errorf("cannot Buy not enough %s balance", market.BaseCurrency)
8888
}
@@ -123,7 +123,7 @@ func (wrapper *ExchangeWrapperSimulator) SellMarket(market *environment.Market,
123123
break
124124
}
125125
totalQuote = totalQuote.Add(bid.Quantity)
126-
gain = gain.Add(ask.Quantity.Mul(bid.Value))
126+
gain = gain.Add(bid.Quantity.Mul(bid.Value))
127127
}
128128

129129
wrapper.balances[market.BaseCurrency] = baseBalance.Add(gain)

0 commit comments

Comments
 (0)