Skip to content

Commit

Permalink
server/market: fix wrong asset for RequiredOrderFunds on market-buy (#…
Browse files Browse the repository at this point in the history
…1323)

Fix wrong asset for RequiredOrderFunds on market-buy
  • Loading branch information
buck54321 committed Dec 5, 2021
1 parent 0f59b5c commit 8ca81e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/market/orderrouter.go
Expand Up @@ -576,7 +576,7 @@ func (r *OrderRouter) handleMarket(user account.AccountID, msg *msgjson.Message)
buyBuffer := tunnel.MarketBuyBuffer()
lotWithBuffer := uint64(float64(lotSize) * buyBuffer)
minReq := matcher.BaseToQuote(midGap, lotWithBuffer)
reqVal = calc.RequiredOrderFunds(minReq, uint64(spendSize), 1, &assets.base.Asset)
reqVal = calc.RequiredOrderFunds(minReq, uint64(spendSize), 1, &assets.funding.Asset)

if market.Quantity < minReq {
errStr := fmt.Sprintf("order quantity does not satisfy market buy buffer. %d < %d. midGap = %d", market.Quantity, minReq, midGap)
Expand Down

0 comments on commit 8ca81e2

Please sign in to comment.